Interface EntitySnapshot


public interface EntitySnapshot
Represents an immutable copy of an entity's state. Can be used at any time to create an instance of the stored entity.
  • Method Details

    • createEntity

      @NotNull Entity createEntity(@NotNull World world)
      Creates an entity using this template. Does not spawn the copy in the world.
      Parameters:
      world - the world to create the entity in
      Returns:
      a copy of this entity.
    • createEntity

      @NotNull Entity createEntity(@NotNull Location to)
      Creates an entity using this template and spawns it at the provided location.
      Parameters:
      to - the location to copy to
      Returns:
      the new entity.
    • getEntityType

      @NotNull EntityType getEntityType()
      Gets the type of entity this template holds.
      Returns:
      the type
    • getAsString

      @NotNull @Experimental String getAsString()
      Get this EntitySnapshot as an NBT string.

      This string should not be relied upon as a serializable value.

      Returns:
      the NBT string