public class BaseEntity extends java.lang.Object implements NbtValued
An instance of this class contains all the information needed to accurately reproduce the entity, provided that the instance was made correctly. In some implementations, it may not be possible to get a snapshot of entities correctly, so, for example, the NBT data for an entity may be missing.
This class identifies entities using its entity type string, although this is not very efficient as the types are currently not interned. This may be changed in the future.
Constructor and Description |
---|
BaseEntity(BaseEntity other)
Make a clone of a
BaseEntity . |
BaseEntity(EntityType type)
Create a new base entity with no NBT data.
|
BaseEntity(EntityType type,
CompoundTag nbtData)
Deprecated.
|
BaseEntity(EntityType type,
LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> nbtData)
Create a new base entity.
|
Modifier and Type | Method and Description |
---|---|
LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> |
getNbtReference()
Get the object's NBT data (tile entity data).
|
EntityType |
getType()
Get the type of entity.
|
void |
setNbtReference(LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> nbtData)
Set the object's NBT data (tile entity data).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNbt, getNbtData, hasNbtData, setNbt, setNbtData
@Deprecated public BaseEntity(EntityType type, CompoundTag nbtData)
BaseEntity(EntityType, LazyReference)
type
- the entity typenbtData
- NBT datapublic BaseEntity(EntityType type, LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> nbtData)
type
- the entity typenbtData
- NBT datapublic BaseEntity(EntityType type)
type
- the entity typepublic BaseEntity(BaseEntity other)
BaseEntity
.other
- the object to clone@Nullable public LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> getNbtReference()
NbtValued
This only needs to be used if you don't want to immediately resolve the data.
Otherwise, you probably want NbtValued.getNbt()
.
getNbtReference
in interface NbtValued
public void setNbtReference(@Nullable LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> nbtData)
NbtValued
setNbtReference
in interface NbtValued
nbtData
- NBT data, or null if no datapublic EntityType getType()