Class LivingEntity

java.lang.Object
org.geysermc.connector.entity.Entity
org.geysermc.connector.entity.LivingEntity
Direct Known Subclasses:
ArmorStandEntity, InsentientEntity, PlayerEntity

public class LivingEntity extends Entity
  • Field Details

    • helmet

      protected com.nukkitx.protocol.bedrock.data.inventory.ItemData helmet
    • chestplate

      protected com.nukkitx.protocol.bedrock.data.inventory.ItemData chestplate
    • leggings

      protected com.nukkitx.protocol.bedrock.data.inventory.ItemData leggings
    • boots

      protected com.nukkitx.protocol.bedrock.data.inventory.ItemData boots
    • hand

      protected com.nukkitx.protocol.bedrock.data.inventory.ItemData hand
    • offHand

      protected com.nukkitx.protocol.bedrock.data.inventory.ItemData offHand
    • health

      protected float health
    • maxHealth

      protected float maxHealth
  • Constructor Details

    • LivingEntity

      public LivingEntity(long entityId, long geyserId, EntityType entityType, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, com.nukkitx.math.vector.Vector3f rotation)
  • Method Details

    • updateBedrockMetadata

      public void updateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata, GeyserSession session)
      Description copied from class: Entity
      Applies the Java metadata to the local Bedrock metadata copy
      Overrides:
      updateBedrockMetadata in class Entity
      Parameters:
      entityMetadata - the Java entity metadata
      session - GeyserSession
    • isShaking

      protected boolean isShaking(GeyserSession session)
      Description copied from class: Entity
      If true, the entity should be shaking on the client's end.
      Overrides:
      isShaking in class Entity
      Returns:
      whether EntityFlag.SHAKING should be set to true.
    • setDimensions

      protected void setDimensions(com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose pose)
      Description copied from class: Entity
      Set the height and width of the entity's bounding box
      Overrides:
      setDimensions in class Entity
    • setFreezing

      protected void setFreezing(GeyserSession session, float amount)
      Description copied from class: Entity
      Set a float from 0-1 - how strong the "frozen" overlay should be on screen.
      Overrides:
      setFreezing in class Entity
    • createHealthAttribute

      protected com.nukkitx.protocol.bedrock.data.AttributeData createHealthAttribute()
      Returns:
      a Bedrock health attribute constructed from the data sent from the server
    • updateArmor

      public void updateArmor(GeyserSession session)
    • updateMainHand

      public void updateMainHand(GeyserSession session)
    • updateOffHand

      public void updateOffHand(GeyserSession session)
    • updateBedrockAttributes

      public void updateBedrockAttributes(GeyserSession session, List<com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute> attributes)
      Attributes are properties of an entity that are generally more runtime-based instead of permanent properties. Movement speed, current attack damage with a weapon, current knockback resistance.
      Parameters:
      attributes - the Java list of attributes sent from the server
    • updateAttribute

      protected void updateAttribute(com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute javaAttribute, List<com.nukkitx.protocol.bedrock.data.AttributeData> newAttributes)
      Takes the Java attribute and adds it to newAttributes as a Bedrock-formatted attribute
    • calculateAttribute

      protected com.nukkitx.protocol.bedrock.data.AttributeData calculateAttribute(com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute javaAttribute, GeyserAttributeType type)
      Calculates the complete attribute value to send to Bedrock. Will be overriden if attributes need to be cached.