Class EntitySpawnContext

java.lang.Object
cz.jeme.bestium.api.inject.variant.EntitySpawnContext

public final class EntitySpawnContext extends Object
A context object wrapping an Entity and its properties when spawning.

This should be the only source of data for the logic within VariantRule.apply(Map, EntitySpawnContext).

  • Constructor Details

    • EntitySpawnContext

      @Internal public EntitySpawnContext(Entity entity)
      Creates an entity spawn context from the given entity.

      This constructor is intended for internal use only.

      Parameters:
      entity - the entity to create context for
  • Method Details

    • getEntity

      public Entity getEntity()
      Returns the Bukkit Entity being spawned.
      Returns:
      the spawning Bukkit entity
    • getInjection

      public EntityInjection<?,?> getInjection()
      Returns the EntityInjection used to register this Bestium entity.
      Returns:
      the entity's Bestium injection
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object