Interface StructureEntity<Entity,Location>
public interface StructureEntity<Entity,Location>
Represents an entity stored in a structure.
-
Method Summary
Modifier and TypeMethodDescriptionGenerates 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.spawnEntity(Location location) Tries to spawn an entity from the stored nbt data at the given location.
-
Method Details
-
spawnEntity
Tries to spawn an entity from the stored nbt data at the given location.- Parameters:
location- TargetStructureEntity.- Returns:
- A valid entity or empty optional.
-
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.
-