Class MobEntity

All Implemented Interfaces:
org.geysermc.geyser.api.entity.type.GeyserEntity, Leashable
Direct Known Subclasses:
AllayEntity, AmbientEntity, CreatureEntity, EnderDragonEntity, FlyingEntity, SlimeEntity

public class MobEntity extends LivingEntity implements Leashable
  • Constructor Details

    • MobEntity

      public MobEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.math.vector.Vector3f motion, float yaw, float pitch, float headYaw)
  • Method Details

    • initializeMetadata

      protected void initializeMetadata()
      Description copied from class: Entity
      Called on entity spawn. Used to populate the entity metadata and flags with default values.
      Overrides:
      initializeMetadata in class LivingEntity
    • setMobFlags

      public void setMobFlags(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata)
    • setLeashHolderBedrockId

      public void setLeashHolderBedrockId(long bedrockId)
      Specified by:
      setLeashHolderBedrockId in interface Leashable
    • testInteraction

      protected final InteractiveTag testInteraction(org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand hand)
      Description copied from class: Entity
      Test interacting with the given hand to see if we should send a tag to the Bedrock client. Should usually mirror Entity.interact(Hand) without any side effects.
      Overrides:
      testInteraction in class Entity
    • interact

      public final InteractionResult interact(org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand hand)
      Description copied from class: Entity
      Simulates interacting with an entity. The code here should mirror Java Edition code to the best of its ability, to ensure packet parity as well as functionality parity (such as sound effect responses).
      Overrides:
      interact in class LivingEntity
    • canShearEquipment

      public boolean canShearEquipment()
    • testMobInteraction

      protected @NonNull InteractiveTag testMobInteraction(@NonNull org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand hand, @NonNull GeyserItemStack itemInHand)
    • mobInteract

      protected @NonNull InteractionResult mobInteract(@NonNull org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand hand, @NonNull GeyserItemStack itemInHand)
    • canBeLeashed

      public boolean canBeLeashed()
      Specified by:
      canBeLeashed in interface Leashable
    • leashHolderBedrockId

      public long leashHolderBedrockId()
      Specified by:
      leashHolderBedrockId in interface Leashable
    • isEnemy

      protected boolean isEnemy()
      Returns if the entity is hostile. Used to determine if it can be leashed.