Interface TNTPrimed

All Superinterfaces:
Audience, CommandSender, Entity, Explosive, HoverEventSource<HoverEvent.ShowEntity>, Metadatable, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ServerOperator, Sound.Emitter

public interface TNTPrimed extends Explosive
Represents a Primed TNT.
  • Method Details

    • setFuseTicks

      void setFuseTicks(int fuseTicks)
      Set the number of ticks until the TNT blows up after being primed.
      Parameters:
      fuseTicks - The fuse ticks
    • getFuseTicks

      int getFuseTicks()
      Retrieve the number of ticks until the explosion of this TNTPrimed entity
      Returns:
      the number of ticks until this TNTPrimed explodes
    • getSource

      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().

      Returns:
      the source of this primed TNT
    • setSource

      void setSource(@Nullable @Nullable Entity source)
      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.

      Parameters:
      source - the source of this primed TNT
    • getSourceLoc

      @Deprecated default Location getSourceLoc()
      Deprecated.
      replaced by Entity.getOrigin()
      Gets the source block location of the TNTPrimed
      Returns:
      the source block location the TNTPrimed was spawned from
    • setBlockData

      void setBlockData(@NotNull BlockData data)
      Sets the visual block data of this primed tnt.
      The explosion of the tnt stays the same and is not affected by this change.
      Parameters:
      data - the visual block data
    • getBlockData

      @NotNull BlockData getBlockData()
      Gets the visual block data of this primed tnt.
      Returns:
      the visual block data