Hi there, For my current plugin i am looking at a way of stopping kiting using wheat. Players in the server cannot harm animals in regions but i cannot seem to find the correct event for it :/ i some how seem to think it may be entitiytargetlivingentityevent but im not sure could somebody please confirm this. Thanks.
My bad dident know it was a WoW term? heard multiple people use it on my server and yes this should be plugin development not requests misread the forum subcatagory
Somebody moved it already And I assumed it was an WoW term because that was the first page that came up when I searched for it Lol, ninja'd by TnT
In an MMORPG, you can grab a mob's attention and keep walking away from it which pulls it along /*Definition from Urban Dictionary *\ And yes you are right it first appeared in WoW guess my players must be WoW noobs hehe :3 Im only joking ofc. Can somebody please confirm that i am looking at the correct even and if not guide me in the right direction ? Thanks.
You could test it yourself, at every entitiytargetlivingentityevent create an debug message containing the target and the targeting entity, if you don't get an message when you attract an pig then you have the wrong event
I've tried both EntityTargetLivingEntityEvent and EntityTargetEvent both fail and return nothing :/ Anybody got any ideas? Thanks
it doesn't fire any sort of target event at present. this is problematic for me as well. I think there's a pull request to address this but it hasn't found its way into the code yet.
https://github.com/Bukkit/CraftBukkit/blob/master/src/main/java/net/minecraft/server/EntityPig.java I think it's PathfinderGoalTempt. You'll have to modify the entity and remove this goal. Didn't check any of the other mobs either, so I'm not sure if they all work in the same way. You can use this lovely tutorial by Jacek : https://forums.bukkit.org/threads/tutorial-how-to-customize-the-behaviour-of-a-mob-or-entity.54547/
Hmm, that is a bit problematic isen't it. Have too wait and see if the pull request gets answered i guess. Thanks for the help.
Garrison's suggestion is the best way to go for now, that's what I ended up doing as well, and IIRC, thats where the pull request added a EntityTargetEntityEvent, but I can't seem to find it now. I'll take another look through github this afternoon.
Problem with that is i would have to change multiple classes because i use a list of entities from a list to protect them (dev.bukkit.org/server-mods/animalprotect) So that would be dificult to do. Thanks for the idea though but i think i will just wait for this feature and make people fence their animal in.