diff --git a/paper-api/src/main/java/org/bukkit/event/Event.java b/paper-api/src/main/java/org/bukkit/event/Event.java index 9524bd7123..61bebb4e4e 100644 --- a/paper-api/src/main/java/org/bukkit/event/Event.java +++ b/paper-api/src/main/java/org/bukkit/event/Event.java @@ -423,6 +423,13 @@ public abstract class Event { * @todo: add javadoc see comment */ ENTITY_DEATH (Category.LIVING_ENTITY), + + /** + * Called when a Skeleton or Zombie catch fire due to the sun + * + * @todo: add javadoc see comment + */ + ENTITY_COMBUST (Category.LIVING_ENTITY), /** * VEHICLE EVENTS diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java new file mode 100644 index 0000000000..e1e54217e3 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java @@ -0,0 +1,27 @@ +package org.bukkit.event.entity; + +import org.bukkit.Entity; +import org.bukkit.event.Cancellable; + +/** + * The event when a skeleton or zombie catch on fire due to the sun. + * If the event is cancelled, the fire is stopped. + */ +public class EntityCombustEvent extends EntityEvent implements Cancellable { + private boolean cancel; + + public EntityCombustEvent(Type type, Entity what) { + super(type, what); + this.cancel = false; + } + + @Override + public boolean isCancelled() { + return cancel; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancel = cancel; + } +} diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityListener.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityListener.java index 60808f5260..f7e4de5c26 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityListener.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityListener.java @@ -14,4 +14,7 @@ public class EntityListener implements Listener { public void onEntityDamagedByEntity(EntityDamagedByEntityEvent event) { } + + public void onEntityCombust(EntityCombustEvent event) { + } } diff --git a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index 346429d59e..75d4d91ceb 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -16,6 +16,7 @@ import org.bukkit.event.CustomEventListener; import org.bukkit.event.Event; import org.bukkit.event.Listener; import org.bukkit.event.block.*; +import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamagedByBlockEvent; import org.bukkit.event.entity.EntityDamagedByEntityEvent; import org.bukkit.event.entity.EntityListener; @@ -179,6 +180,9 @@ public final class JavaPluginLoader implements PluginLoader { case ENTITY_DEATH: // TODO: ENTITY_DEATH hook break; + case ENTITY_COMBUST: + trueListener.onEntityCombust((EntityCombustEvent)event); + break; } } else if (listener instanceof VehicleListener) { VehicleListener trueListener = (VehicleListener)listener;