Class EntityData

java.lang.Object
be.seeseemelk.mockbukkit.entity.data.EntityData

public class EntityData extends Object
  • Field Details

  • Constructor Details

    • EntityData

      protected EntityData(@NotNull @NotNull EntityType type, @NotNull @NotNull String data)
      Constructs a new EntityData with a specified EntityType and provided entity data.
      Parameters:
      type - The type of entity to create on
      data - The data of the entity
  • Method Details

    • getWidth

      public double getWidth(EntitySubType subType, EntityState state)
      Shortcut method to get the width of a entity
      Parameters:
      subType - Subtype of entity
      state - State of entity
      Returns:
      the width of the entity
    • getHeight

      public double getHeight(EntitySubType subType, EntityState state)
      Shortcut method to get the height of a entity
      Parameters:
      subType - Subtype of entity
      state - State of entity
      Returns:
      The height of the entity
    • getValueFromKey

      public com.google.gson.JsonElement getValueFromKey(String key, EntitySubType subType, EntityState state)
      Gets entity data for a specific key. Defaults to a default state, if the state does not provide a value for the key.
      Parameters:
      key - The specific key
      subType - Subtype of entity
      state - State of entity
      Returns:
      The value matching the specified key