Interface EnderSignal

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

public interface EnderSignal extends Entity
Represents an EnderSignal, which is created upon throwing an ender eye.
  • Method Details

    • getTargetLocation

      @NotNull @NotNull Location getTargetLocation()
      Get the location this EnderSignal is moving towards.
      Returns:
      the Location this EnderSignal is moving towards.
    • setTargetLocation

      void setTargetLocation(@NotNull @NotNull Location location)
      Set the Location this EnderSignal is moving towards.
      When setting a new target location, the getDropItem() resets to a random value and the despawn timer gets set back to 0.
      Parameters:
      location - the new target location
    • setTargetLocation

      void setTargetLocation(@NotNull @NotNull Location location, boolean update)
      Set the Location this EnderSignal is moving towards.
      Parameters:
      location - the new target location
      update - true to reset the getDropItem() to a random value and getDespawnTimer() to 0
    • getDropItem

      boolean getDropItem()
      Gets if the EnderSignal should drop an item on death.
      If true, it will drop an item. If false, it will shatter.
      Returns:
      true if the EnderSignal will drop an item on death, or false if it will shatter
    • setDropItem

      void setDropItem(boolean drop)
      Sets if the EnderSignal should drop an item on death; or if it should shatter.
      Parameters:
      drop - true if the EnderSignal should drop an item on death, or false if it should shatter.
    • getItem

      Get the ItemStack to be displayed while in the air and to be dropped on death.
      Returns:
      the item stack
    • setItem

      void setItem(@Nullable @Nullable ItemStack item)
      Set the ItemStack to be displayed while in the air and to be dropped on death.
      Parameters:
      item - the item to set. If null, resets to the default eye of ender
    • getDespawnTimer

      int getDespawnTimer()
      Gets the amount of time this entity has been alive (in ticks).
      When this number is greater than 80, it will despawn on the next tick.
      Returns:
      the number of ticks this EnderSignal has been alive.
    • setDespawnTimer

      void setDespawnTimer(int timer)
      Set how long this entity has been alive (in ticks).
      When this number is greater than 80, it will despawn on the next tick.
      Parameters:
      timer - how long (in ticks) this EnderSignal has been alive.