EntityUnload
com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityUnload
Fires when an entity is removed from the client world. The reason is the removal reason's name;
the available names depend on the Minecraft version.
js
JsMacros.on("EntityUnload", JavaWrapper.methodToJava(function (event) {
Chat.log(`${event.entity.getType()} unloaded (${event.reason})`);
}))Constructors
new EventEntityUnload
new EventEntityUnload(Entity e, Entity.RemovalReason reason)#Wraps the entity and captures the removal reason as a string; it does not perform the removal. Construction throws NullPointerException if either argument is
null.Parameters:
e: the Minecraft entity to wrap; must not benullreason: the removal reason to convert to a string; must not benull
Fields
entity
The entity being removed from the client world.
reason
Methods
toString
Returns a diagnostic string containing the event name, entity helper string, and captured reason. The format is
%s:{"entity": %s, "reason": "%s"}; the reason is the captured string, quoted in the output, not a newly computed enum value or serialized entity data.Returns: the diagnostic string in the format described above