Interface Beacon

All Superinterfaces:
BlockState, Lockable, Metadatable, Nameable, PersistentDataHolder, TileState

public interface Beacon extends TileState, Lockable, Nameable
Represents a captured state of a beacon.
  • Method Details

    • getEntitiesInRange

      @NotNull @NotNull Collection<LivingEntity> getEntitiesInRange()
      Returns the list of players within the beacon's range of effect.

      This will return an empty list if the block represented by this state is no longer a beacon.

      the players in range
      IllegalStateException - if this block state is not placed
    • getTier

      int getTier()
      Returns the tier of the beacon pyramid (0-4). The tier refers to the beacon's power level, based on how many layers of blocks are in the pyramid. Tier 1 refers to a beacon with one layer of 9 blocks under it.
      the beacon tier
    • getPrimaryEffect

      @Nullable @Nullable PotionEffect getPrimaryEffect()
      Returns the primary effect set on the beacon
      the primary effect or null if not set
    • setPrimaryEffect

      void setPrimaryEffect(@Nullable @Nullable PotionEffectType effect)
      Set the primary effect on this beacon, or null to clear.
      effect - new primary effect
    • getSecondaryEffect

      @Nullable @Nullable PotionEffect getSecondaryEffect()
      Returns the secondary effect set on the beacon.
      the secondary effect or null if no secondary effect
    • setSecondaryEffect

      void setSecondaryEffect(@Nullable @Nullable PotionEffectType effect)
      Set the secondary effect on this beacon, or null to clear. Note that tier must be >= 4 for this effect to be active.
      effect - desired secondary effect
    • getEffectRange

      double getEffectRange()
      Gets the effect range of this beacon. A negative range value means the beacon is using its default range based on tier.
      Either the custom range set with setEffectRange(double) or the range based on the beacon tier.
    • setEffectRange

      void setEffectRange(double range)
      Sets the effect range of the beacon A negative range value means the beacon is using its default range based on tier.
      range - Radius of effect range.
    • resetEffectRange

      void resetEffectRange()
      Resets the custom range from this beacon and falls back to the range based on the the beacon tier. Shortcut for setting the effect range to a negative number.