public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
Modifier and Type | Method and Description |
---|---|
default boolean |
canBeRiddenInWater(Entity rider)
Checks if this entity can continue to be ridden while it is underwater.
|
default boolean |
canRiderInteract()
If a rider of this entity can interact with this entity.
|
boolean |
canTrample(IBlockState state,
BlockPos pos,
float fallDistance)
Checks if this
Entity can trample a Block . |
boolean |
canUpdate() |
void |
canUpdate(boolean value) |
java.util.Collection<EntityItem> |
captureDrops() |
java.util.Collection<EntityItem> |
captureDrops(java.util.Collection<EntityItem> captureDrops) |
Entity |
changeDimension(DimensionType type,
ITeleporter teleporter)
Override instead of
Entity.changeDimension(DimensionType, ITeleporter) if your entity
needs special handling for specific teleporters. |
default void |
deserializeNBT(NBTTagCompound nbt) |
default Entity |
getEntity() |
NBTTagCompound |
getEntityData()
Returns a NBTTagCompound that can be used to store custom data for this entity.
|
default ItemStack |
getPickedResult(RayTraceResult target)
Called when a user uses the creative pick block button on this entity.
|
boolean |
isAddedToWorld()
Gets whether this entity has been added to a world (for tracking).
|
default boolean |
isCreatureType(EnumCreatureType type,
boolean forSpawnCount)
Returns true if the entity is of the @link{EnumCreatureType} provided
|
void |
onAddedToWorld()
Called after the entity has been added to the world's
ticking list.
|
void |
onRemovedFromWorld()
Called after the entity has been removed to the world's
ticking list.
|
void |
revive()
Revives an entity that has been removed from a world.
|
default NBTTagCompound |
serializeNBT() |
default boolean |
shouldRenderInPass(int pass) |
default boolean |
shouldRiderSit()
Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position.
|
getCapability, getCapability
default Entity getEntity()
default void deserializeNBT(NBTTagCompound nbt)
deserializeNBT
in interface INBTSerializable<NBTTagCompound>
default NBTTagCompound serializeNBT()
serializeNBT
in interface INBTSerializable<NBTTagCompound>
boolean canUpdate()
void canUpdate(boolean value)
@Nullable java.util.Collection<EntityItem> captureDrops()
java.util.Collection<EntityItem> captureDrops(@Nullable java.util.Collection<EntityItem> captureDrops)
NBTTagCompound getEntityData()
default boolean shouldRiderSit()
default ItemStack getPickedResult(RayTraceResult target)
target
- The full target the player is looking atdefault boolean shouldRenderInPass(int pass)
default boolean canRiderInteract()
default boolean canBeRiddenInWater(Entity rider)
rider
- The entity that is riding this entitytrue
if the entity can continue to ride underwater. false
otherwise.@Nullable Entity changeDimension(DimensionType type, ITeleporter teleporter)
Entity.changeDimension(DimensionType, ITeleporter)
if your entity
needs special handling for specific teleporters.type
- The target dimensionteleporter
- The teleporter being used to move the entity to the dimensionnull
if the entity should despawn.boolean canTrample(IBlockState state, BlockPos pos, float fallDistance)
Entity
can trample a Block
.pos
- The block posfallDistance
- The fall distancetrue
if this entity can trample, false
otherwisedefault boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount)
type
- The EnumCreatureType type this entity is evaluatingforSpawnCount
- If this is being invoked to check spawn count caps.boolean isAddedToWorld()
World#onEntityAdded(Entity)
and
World#onEntityRemoved(Entity)
.void onAddedToWorld()
void onRemovedFromWorld()
void revive()