接口 TNTPrimed

所有超级接口:
CommandSender, Entity, Explosive, Metadatable, Nameable, Permissible, PersistentDataHolder, ServerOperator

public interface TNTPrimed extends Explosive
表示已点燃的TNT。
  • 方法详细资料

    • setFuseTicks

      void setFuseTicks(int fuseTicks)
      设置TNT点燃后爆炸的刻数。
      参数:
      fuseTicks - 引信刻数

      原文:Set the number of ticks until the TNT blows up after being primed.

      fuseTicks - The fuse ticks
    • getFuseTicks

      int getFuseTicks()
      获取此TNTPrimed实体爆炸的剩余刻数。
      返回:
      此TNTPrimed爆炸的剩余刻数

      原文:Retrieve the number of ticks until the explosion of this TNTPrimed entity

    • getSource

      获取此已点燃TNT的来源。来源是指创建此已点燃TNT的实体。(例如:玩家使用打火石点燃TNT。)请注意,如果没有合适的来源,这可能为null。(例如由RegionAccessor.spawn(Location, Class)方法创建。)

      如果此已点燃TNT所在的区块被卸载后重新加载,来源将变为null。来源实体可能无效,例如它已经死亡或被卸载。调用者应检查Entity.isValid()。

      返回:
      此已点燃TNT的来源

      原文:Gets the source of this primed TNT. The source is the entity responsible for the creation of this primed TNT. (I.E. player ignites TNT with flint and steel.) Take note that this can be null if there is no suitable source. (created by the RegionAccessor.spawn(Location, Class) method, for example.)

      The source will become null if the chunk this primed TNT is in is unloaded then reloaded. The source entity may be invalid if for example it has since died or been unloaded. Callers should check Entity.isValid().

    • setSource

      void setSource(@Nullable @Nullable Entity source)
      设置此已点燃TNT的来源。 来源是指创建此已点燃TNT的实体。

      必须是LivingEntity的实例,否则将被设置为null。参数类型为Entity,以与getSource()方法保持一致。

      参数:
      source - 此已点燃TNT的来源

      原文:Sets the source of this primed TNT. The source is the entity responsible for the creation of this primed TNT.

      Must be instance of LivingEntity otherwise will be set to null. The parameter is typed Entity to be consistent with getSource() method.

      source - the source of this primed TNT