Interface StructureEntity<Entity,Location>


public interface StructureEntity<Entity,Location>
Represents an entity stored in a structure.
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates a virtual entity, which is not added to the world but the data can be extracted.
    Gets the nbt data of the stored entity in string format.
    Gets the relative source location inside the structure.
    Tries to spawn an entity from the stored nbt data at the given location.
  • Method Details

    • spawnEntity

      Optional<Entity> spawnEntity(Location location)
      Tries to spawn an entity from the stored nbt data at the given location.
      Parameters:
      location - Target StructureEntity.
      Returns:
      A valid entity or empty optional.
    • getEntity

      Optional<Entity> getEntity()
      Generates a virtual entity, which is not added to the world but the data can be extracted. This entity is destroyed after peeking.
      Returns:
      A valid entity or empty optional.
    • getSourceLocation

      Location getSourceLocation()
      Gets the relative source location inside the structure.
      Returns:
      StructureEntity.
    • getNbtData

      String getNbtData()
      Gets the nbt data of the stored entity in string format.
      Returns:
      NBT data.