Interface Beacon

    • Method Detail

      • getInventory

        @NotNull
        BeaconInventory getInventory()
        Description copied from interface: Container
        Gets the inventory of the block represented by this block state.

        If the block was changed to a different type in the meantime, the returned inventory might no longer be valid.

        If this block state is not placed this will return the captured inventory snapshot instead.

        Specified by:
        getInventory in interface Container
        Specified by:
        getInventory in interface InventoryHolder
        Returns:
        the inventory
      • getSnapshotInventory

        @NotNull
        BeaconInventory getSnapshotInventory()
        Description copied from interface: Container
        Gets the captured inventory snapshot of this container.

        The returned inventory is not linked to any block. Any modifications to the returned inventory will not be applied to the block represented by this block state up until BlockState.update(boolean, boolean) has been called.

        Specified by:
        getSnapshotInventory in interface Container
        Returns:
        the captured inventory snapshot
      • getEntitiesInRange

        @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.

        Returns:
        the players in range
        Throws:
        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.
        Returns:
        the beacon tier
      • getPrimaryEffect

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

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

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

        void setSecondaryEffect​(@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.
        Parameters:
        effect - desired secondary effect