Expected behavior
When entity attacks bee it should call the EntityTargetEvent/EntityTargetLivingEntityEvent with the TARGET_ATTACKED_ENTITY reason and other bees in radius should call the same event, but with the TARGET_ATTACKED_NEARBY_ENTITY reason.
Observed/Actual behavior
When entity attacks bee all swarm calls the EntityTargetEvent with the TARGET_ATTACKED_ENTITY reason, even if only one bee was attacked.
Steps/models to reproduce
- Create event handler that listens to the
EntityTargetEvent or the EntityTargetLivingEntityEvent and cancel it if the reason is TARGET_ATTACKED_NEARBY_ENTITY.
- Spawn at least two bees.
- Attack one of them.
- See that nothing was canceled because every bee in the swarm thinks that reason is the
TARGET_ATTACKED_ENTITY.
Plugin and Datapack List
Paper version
This server is running Paper version 26.2-121-main@a2a42c5 (2026-08-29T11:32:25Z) (Implementing API version 26.2.build.121-stable)
You are running the latest version
Other
Example of an event handler:
@EventHandler(ignoreCancelled = true)
public void onEntityTarget(EntityTargetLivingEntityEvent event) {
if (!(event.getTarget() instanceof Player player)) return;
if (!(event.getEntity() instanceof Bee)) return;
player.sendMessage("Target Reason: %s".formatted(event.getReason().name()));
event.setCancelled(true);
}
Bug showcase video
https://www.youtube.com/watch?v=NpkIayQz1hE
Expected behavior
When entity attacks bee it should call the
EntityTargetEvent/EntityTargetLivingEntityEventwith theTARGET_ATTACKED_ENTITYreason and other bees in radius should call the same event, but with theTARGET_ATTACKED_NEARBY_ENTITYreason.Observed/Actual behavior
When entity attacks bee all swarm calls the
EntityTargetEventwith theTARGET_ATTACKED_ENTITYreason, even if only one bee was attacked.Steps/models to reproduce
EntityTargetEventor theEntityTargetLivingEntityEventand cancel it if the reason isTARGET_ATTACKED_NEARBY_ENTITY.TARGET_ATTACKED_ENTITY.Plugin and Datapack List
Paper version
Other
Example of an event handler:
Bug showcase video
https://www.youtube.com/watch?v=NpkIayQz1hE