Lileep / PixelmonDetector

A safe, efficient, lightweight and server owner friendly high version Pixel Radar
16 stars 4 forks source link

Right click functionality #2

Closed oTalDoNexus closed 1 year ago

oTalDoNexus commented 1 year ago

The right click functionality (the one that act's like Ras's lens) doesnt work on either server or client side.. I did a quick look on the code and saw that it was made to work only when isRemote is false (on a server i think?) so the client side is okay not to work, but the thing is that when i right click an entity with nothing in my hand on my main hand, on a wild pokemon (everything that satisfies Ras functionality but with nothing in my hand instead) it doesnt show me anything on the pokemon. I've tried it with a server that was almost completely vanilla the following way: my host was an alt which had just pixelmon mod, and i (the "player" on the server) had pixelmon (ofc) and the detector with allowRightClickInfo = true set properly... whenever i (the player) right clicked the entity, it would not show anything... Also congrats on your mod, this lens thing was pretty smart as pixelmon nature and iv's packets are annoying af to get any info and it is very efficient (in performance)

Only thing i changed on config was allowRightClickInfo to true, i dont know if to use this functionality i have to change anything else on the config, i looked it up and didn't found anything that could be related

Also just for curiosity (you can ignore this part if you want to): if you use a pixelmon item that can atleast do an interaction with the wild pokemon for example a potion (that does the right click animation but doesnt consume it as the pokemon is wild), couldn't you use this little interact moment to get some more info about the entity you're interacting the item with?

oTalDoNexus commented 1 year ago

didnt read the wiki X.X sorry

Lileep commented 1 year ago

@oTalDoNexus Thanks for reply! That config is a bit harmful to servers, so I chose to make it depend on server config.

As for the second question, in my opinion, u can subscribe the item interacting related events in ur event subscriber to get the target of the event. The target usually include all infos that u may need, then u can do whatever u like. Get more info in Forge docs and codes, there're numbers of event u can choose to subscribe. :)