Interface ILivingEntityExtension

All Superinterfaces:
IEntityExtension
All Known Implementing Classes:
net.minecraft.world.entity.AgeableMob, net.minecraft.world.entity.animal.Animal, EntityRendererEventsTest.MyEntity, FakePlayer, GameTestPlayer, net.minecraft.world.entity.LivingEntity, net.minecraft.world.entity.Mob, PartEntityTest.TestEntity, net.minecraft.world.entity.PathfinderMob, net.minecraft.world.entity.animal.Pig, net.minecraft.world.entity.player.Player, net.minecraft.server.level.ServerPlayer

public interface ILivingEntityExtension extends IEntityExtension
  • Method Details

    • self

      default net.minecraft.world.entity.LivingEntity self()
    • canSwimInFluidType

      default boolean canSwimInFluidType(FluidType type)
      Description copied from interface: IEntityExtension
      Returns whether the entity can swim in the fluid.
      Specified by:
      canSwimInFluidType in interface IEntityExtension
      Parameters:
      type - the type of the fluid
      Returns:
      true if the entity can swim in the fluid, false otherwise
    • jumpInFluid

      default void jumpInFluid(FluidType type)
      Performs what to do when an entity attempts to go up or "jump" in a fluid.
      Parameters:
      type - the type of the fluid
    • sinkInFluid

      default void sinkInFluid(FluidType type)
      Performs what to do when an entity attempts to go down or "sink" in a fluid.
      Parameters:
      type - the type of the fluid
    • canDrownInFluidType

      default boolean canDrownInFluidType(FluidType type)
      Returns whether the entity can drown in the fluid.
      Parameters:
      type - the type of the fluid
      Returns:
      true if the entity can drown in the fluid, false otherwise
    • moveInFluid

      default boolean moveInFluid(net.minecraft.world.level.material.FluidState state, net.minecraft.world.phys.Vec3 movementVector, double gravity)
      Performs how an entity moves when within the fluid. If using custom movement logic, the method should return true. Otherwise, the movement logic will default to water.
      Parameters:
      state - the state of the fluid
      movementVector - the velocity of how the entity wants to move
      gravity - the gravity to apply to the entity
      Returns:
      true if custom movement logic is performed, false otherwise
    • onDamageTaken

      default void onDamageTaken(DamageContainer damageContainer)
      Executes in Entity.hurt(DamageSource, float) after all damage and effects have applied. Overriding this method is preferred over overriding the hurt method in custom entities where special behavior is desired after vanilla logic.
      Parameters:
      damageContainer - The aggregated damage details preceding this hook, which includes changes made to the damage sequence by events.