[SPIGOT-7112] Mobs Added 1.17 and After Do Not Create an EntityTargetEvent Properly Created: 22/Jul/22 Updated: 25/Dec/24 Resolved: 16/Aug/22 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | RT5Phantom | Assignee: | Doc |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 1.17, 1.18, 1.19, API, EntityTargetEvent, Spigot | ||
| Environment: |
Tested on the latest version of Vanilla Spigot, as well as some past major versions of Spigot Minecraft that I already had on my computer |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Version: | CraftBukkit version 3552-Spigot-14a2382-fc30711 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT) | ||||||||
| Guidelines Read: | Yes | ||||||||
| Description |
|
I've been working with the EntityTargetEvent to run code when specific mobs try to target a player who has food in their hand. I have found that the EntityTargetEvent works as expected, except for mobs which have been added to Minecraft during and after version 1.17. In this case, the mobs will not create a targeting event and continue as normal, which stops me from modifying vanilla behavior. Other ways of targeting appear to work (EG: a goat targeting an entity to ram them). I have tested this in a few versions of Spigot and Minecraft and it seems to be occurring since Spigot builds for Minecraft 1.17.
Me holding wheat and being targeted by a cow, sheep, and goat
My console during this point in time - only the cow and sheep create an event not the goat
From my testing, this occurs with every mob added during and after 1.17. that will follow a player because they are holding food. This includes axolotls, frogs, and goats. I also found the following from testing which I believe could also be part of this issue:
I have included a plugin that I created to test the range of this bug. It simply prints to the console when an entity attempts to target another entity. |
| Comments |
| Comment by Doc [ 24/Jul/22 ] |
|
Ok about the issue...
|