PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.39k stars 2.2k forks source link

Add EntityAvoidEntityEvent #10835

Open joshuaprince opened 1 month ago

joshuaprince commented 1 month ago

Add a new event for when an entity avoids another entity.


This is a replacement for https://github.com/PaperMC/Paper/pull/10798. The original intent was to fire an event when an armadillo rolls up, but this covers even more entities to be as generic as possible.

Affected Entities

I tested with these entities (all entities that have an AvoidEntityGoal, plus extra handling for armadillos and villagers). Cancelling the event behaves as expected, and in some cases, ends violently.

(should this be documented somewhere?)