Package net.minecraft.entity
Enum Entity.RemovalReason
- All Implemented Interfaces:
Serializable
,Comparable<Entity.RemovalReason>
,java.lang.constant.Constable
- Enclosing class:
- Entity
public static enum Entity.RemovalReason extends Enum<Entity.RemovalReason>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description CHANGED_DIMENSION
The entity changed dimension.DISCARDED
KILLED
The entity is killed.UNLOADED_TO_CHUNK
The entity is unloaded to chunk.UNLOADED_WITH_PLAYER
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description private
RemovalReason(boolean destroy, boolean save)
-
Method Summary
Modifier and Type Method Description boolean
shouldDestroy()
Returns whether the entity should be destroyed or not.boolean
shouldSave()
Returns whether the entity should be saved or not.static Entity.RemovalReason
valueOf(String name)
Returns the enum constant of this type with the specified name.static Entity.RemovalReason[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
KILLED
The entity is killed. -
DISCARDED
-
UNLOADED_TO_CHUNK
The entity is unloaded to chunk.The entity should be saved.
-
UNLOADED_WITH_PLAYER
-
CHANGED_DIMENSION
The entity changed dimension.
-
-
Field Details
-
destroy
private final boolean destroy -
save
private final boolean save
-
-
Constructor Details
-
RemovalReason
private RemovalReason(boolean destroy, boolean save)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
shouldDestroy
public boolean shouldDestroy()Returns whether the entity should be destroyed or not.If an entity should be destroyed, then the entity should not be re-used and any external data on the entity will be cleared.
-
shouldSave
public boolean shouldSave()Returns whether the entity should be saved or not.
-