接口 EntitySnapshot


public interface EntitySnapshot
表示实体状态的不可变副本. 可随时用于创建存储实体的实例.
  • 方法详细资料

    • createEntity

      使用此模板创建实体. 不会在世界中生成副本.

      原文:Creates an entity using this template. Does not spawn the copy in the world.

      参数:
      world - 创建实体的世界
      返回:
      此实体的副本
    • createEntity

      使用此模板创建实体并在指定位置生成.

      原文:Creates an entity using this template and spawns it at the provided location.

      参数:
      to - 复制到的位置
      返回:
      新实体
    • getEntityType

      @NotNull @NotNull EntityType getEntityType()
      获取此模板持有的实体类型.

      原文:Gets the type of entity this template holds.

      返回:
      类型
    • getAsString

      将此 EntitySnapshot 作为 NBT 字符串获取.

      此字符串不应作为可序列化值使用.

      原文:Get this EntitySnapshot as an NBT string.

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

      返回:
      NBT 字符串