-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Expected behavior
When the EntityBreedEvent is cancelled, their loveTicks should be reset.
Observed/Actual behavior
When cancelling the EntityBreedEvent the two animals will try again every few seconds to produce a baby as long as they are still willing. This results in subsequent calls the EntityBreedEvent.
If you cancel this event, your intention is generally to disallow breeding for the two animals, and not to postpone it.
Steps/models to reproduce
A very simple plugin is sufficient to experience this behavior:
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this,this);
}
@EventHandler
public void onBreed(EntityBreedEvent e){
e.setCancelled(true);
Bukkit.broadcastMessage("Breed");
}Plugin list
Empty; Except plugin to test the EntityBreedEvent cancel behavior.
Paper version
[17:16:49 INFO]: This server is running Paper version git-Paper-575 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
You are running the latest version
Previous version: git-Paper-457 (MC: 1.16.5)
Agreements
- I am running the latest version of Paper available from https://papermc.io/downloads.
- I have searched for and ensured there isn't already an open issue regarding this.
- My version of Minecraft is supported by Paper.
Its certainly not a behavior that should be expected when cancelling the event.
Tho this can be circumvented by resetting the loveModeTicks manually, just doing it by default when the event is cancelled would be a neat improvement to the api. Its really easy to miss that especially if you are new to plugin development and depending on your use case could result in quite unexpected and unnoticed performance issues.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status