Interface IForgeEntity
-
- All Superinterfaces:
ICapabilityProvider,ICapabilitySerializable<CompoundNBT>,INBTSerializable<CompoundNBT>
- All Known Implementing Classes:
AbstractArrowEntity,AbstractChestedHorseEntity,AbstractClientPlayerEntity,AbstractFireballEntity,AbstractFishEntity,AbstractGroupFishEntity,AbstractHorseEntity,AbstractIllagerEntity,AbstractMinecartEntity,AbstractPiglinEntity,AbstractRaiderEntity,AbstractSkeletonEntity,AbstractVillagerEntity,AgeableEntity,AmbientEntity,AnimalEntity,AreaEffectCloudEntity,ArmorStandEntity,ArrowEntity,BatEntity,BeeEntity,BlazeEntity,BoatEntity,CatEntity,CaveSpiderEntity,ChestMinecartEntity,ChickenEntity,ClientPlayerEntity,CodEntity,CommandBlockMinecartEntity,ContainerMinecartEntity,CowEntity,CreatureEntity,CreeperEntity,DamagingProjectileEntity,DolphinEntity,DonkeyEntity,DragonFireballEntity,DrownedEntity,EggEntity,ElderGuardianEntity,EnderCrystalEntity,EnderDragonEntity,EnderDragonPartEntity,EndermanEntity,EndermiteEntity,EnderPearlEntity,Entity,EvokerEntity,EvokerFangsEntity,ExperienceBottleEntity,ExperienceOrbEntity,EyeOfEnderEntity,FakePlayer,FallingBlockEntity,FireballEntity,FireworkRocketEntity,FishingBobberEntity,FlyingEntity,FoxEntity,FurnaceMinecartEntity,GhastEntity,GiantEntity,GolemEntity,GuardianEntity,HangingEntity,HoglinEntity,HopperMinecartEntity,HorseEntity,HuskEntity,IllusionerEntity,IronGolemEntity,ItemEntity,ItemFrameEntity,LeashKnotEntity,LightningBoltEntity,LivingEntity,LlamaEntity,LlamaSpitEntity,MagmaCubeEntity,MinecartEntity,MobEntity,MonsterEntity,MooshroomEntity,MuleEntity,OcelotEntity,PaintingEntity,PandaEntity,ParrotEntity,PartEntity,PatrollerEntity,PhantomEntity,PigEntity,PiglinBruteEntity,PiglinEntity,PillagerEntity,PlayerEntity,PolarBearEntity,PotionEntity,ProjectileEntity,ProjectileItemEntity,PufferfishEntity,RabbitEntity,RavagerEntity,RemoteClientPlayerEntity,SalmonEntity,ServerPlayerEntity,SheepEntity,ShoulderRidingEntity,ShulkerBulletEntity,ShulkerEntity,SilverfishEntity,SkeletonEntity,SkeletonHorseEntity,SlimeEntity,SmallFireballEntity,SnowballEntity,SnowGolemEntity,SpawnerMinecartEntity,SpectralArrowEntity,SpellcastingIllagerEntity,SpiderEntity,SquidEntity,StrayEntity,StriderEntity,TameableEntity,ThrowableEntity,TNTEntity,TNTMinecartEntity,TraderLlamaEntity,TridentEntity,TropicalFishEntity,TurtleEntity,VexEntity,VillagerEntity,VindicatorEntity,WanderingTraderEntity,WaterMobEntity,WitchEntity,WitherEntity,WitherSkeletonEntity,WitherSkullEntity,WolfEntity,ZoglinEntity,ZombieEntity,ZombieHorseEntity,ZombieVillagerEntity,ZombifiedPiglinEntity
public interface IForgeEntity extends ICapabilitySerializable<CompoundNBT>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancanBeRiddenInWater(Entity rider)Checks if this entity can continue to be ridden while it is underwater.default booleancanRiderInteract()If a rider of this entity can interact with this entity.booleancanTrample(BlockState state, BlockPos pos, float fallDistance)Checks if thisEntitycan trample aBlock.booleancanUpdate()voidcanUpdate(boolean value)java.util.Collection<ItemEntity>captureDrops()java.util.Collection<ItemEntity>captureDrops(java.util.Collection<ItemEntity> captureDrops)default voiddeserializeNBT(CompoundNBT nbt)default EntityClassificationgetClassification(boolean forSpawnCount)Returns The classification of this entitydefault EntitySizegetDimensionsForge(Pose pose)default EntitygetEntity()default floatgetEyeHeightForge(Pose pose, EntitySize size)default PartEntity<?>[]getParts()Gets the individual sub parts that make up this entity.CompoundNBTgetPersistentData()Returns a NBTTagCompound that can be used to store custom data for this entity.default ItemStackgetPickedResult(RayTraceResult target)Called when a user uses the creative pick block button on this entity.booleanisAddedToWorld()Gets whether this entity has been added to a world (for tracking).default booleanisMultipartEntity()This is used to specify that your entity has multiple individual parts, such as the Vanilla Ender Dragon.voidonAddedToWorld()Called after the entity has been added to the world's ticking list.voidonRemovedFromWorld()Called after the entity has been removed to the world's ticking list.voidrevive()Revives an entity that has been removed from a world.default CompoundNBTserializeNBT()default booleanshouldRiderSit()Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position.-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
-
-
-
-
Method Detail
-
getEntity
default Entity getEntity()
-
deserializeNBT
default void deserializeNBT(CompoundNBT nbt)
- Specified by:
deserializeNBTin interfaceINBTSerializable<CompoundNBT>
-
serializeNBT
default CompoundNBT serializeNBT()
- Specified by:
serializeNBTin interfaceINBTSerializable<CompoundNBT>
-
canUpdate
boolean canUpdate()
-
canUpdate
void canUpdate(boolean value)
-
captureDrops
@Nullable java.util.Collection<ItemEntity> captureDrops()
-
captureDrops
java.util.Collection<ItemEntity> captureDrops(@Nullable java.util.Collection<ItemEntity> captureDrops)
-
getPersistentData
CompoundNBT getPersistentData()
Returns a NBTTagCompound that can be used to store custom data for this entity. It will be written, and read from disc, so it persists over world saves.- Returns:
- A NBTTagCompound
-
shouldRiderSit
default boolean shouldRiderSit()
Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position.- Returns:
- false to prevent an entity that is mounted to this entity from displaying the 'sitting' animation.
-
getPickedResult
default ItemStack getPickedResult(RayTraceResult target)
Called when a user uses the creative pick block button on this entity.- Parameters:
target- The full target the player is looking at- Returns:
- A ItemStack to add to the player's inventory, empty ItemStack if nothing should be added.
-
canRiderInteract
default boolean canRiderInteract()
If a rider of this entity can interact with this entity. Should return true on the ridden entity if so.- Returns:
- if the entity can be interacted with from a rider
-
canBeRiddenInWater
default boolean canBeRiddenInWater(Entity rider)
Checks if this entity can continue to be ridden while it is underwater.- Parameters:
rider- The entity that is riding this entity- Returns:
trueif the entity can continue to ride underwater.falseotherwise.
-
canTrample
boolean canTrample(BlockState state, BlockPos pos, float fallDistance)
Checks if thisEntitycan trample aBlock.- Parameters:
pos- The block posfallDistance- The fall distance- Returns:
trueif this entity can trample,falseotherwise
-
getClassification
default EntityClassification getClassification(boolean forSpawnCount)
Returns The classification of this entity- Parameters:
forSpawnCount- If this is being invoked to check spawn count caps.- Returns:
- If the creature is of the type provided
-
isAddedToWorld
boolean isAddedToWorld()
Gets whether this entity has been added to a world (for tracking). Specifically between the times when an entity is added to a world and the entity being removed from the world's tracked lists. SeeWorld#onEntityAdded(Entity)andWorld#onEntityRemoved(Entity).- Returns:
- True if this entity is being tracked by a world
-
onAddedToWorld
void onAddedToWorld()
Called after the entity has been added to the world's ticking list. Can be overriden, but needs to call super to prevent MC-136995.
-
onRemovedFromWorld
void onRemovedFromWorld()
Called after the entity has been removed to the world's ticking list. Can be overriden, but needs to call super to prevent MC-136995.
-
revive
void revive()
Revives an entity that has been removed from a world. Used as replacement for entity.removed = true. Having it as a function allows the entity to react to being revived.
-
isMultipartEntity
default boolean isMultipartEntity()
This is used to specify that your entity has multiple individual parts, such as the Vanilla Ender Dragon. SeeEnderDragonEntityfor an example implementation.- Returns:
- true if this is a multipart entity.
-
getParts
@Nullable default PartEntity<?>[] getParts()
Gets the individual sub parts that make up this entity. The entities returned by this method are NOT saved to the world in nay way, they exist as an extension of their host entity. The child entity does not track its server-side(or client-side) counterpart, and the host entity is responsible for moving and managing these children. Only used ifisMultipartEntity()returns true. SeeEnderDragonEntityfor an example implementation.- Returns:
- The child parts of this entity. The value to be returned here should be cached.
-
getDimensionsForge
default EntitySize getDimensionsForge(Pose pose)
-
getEyeHeightForge
default float getEyeHeightForge(Pose pose, EntitySize size)
-
-