程序包 org.bukkit.block
接口 Beacon
- 所有超级接口:
BlockState
,Container
,InventoryHolder
,Lockable
,Metadatable
,Nameable
Represents a captured state of a beacon.
-
方法概要
修饰符和类型方法说明Returns the list of players within the beacon's range of effect.Gets the inventory of the block represented by this block state.Returns the primary effect set on the beaconReturns the secondary effect set on the beacon.Gets the captured inventory snapshot of this container.int
getTier()
Returns the tier of the beacon pyramid (0-4).void
setPrimaryEffect
(PotionEffectType effect) Set the primary effect on this beacon, or null to clear.void
setSecondaryEffect
(PotionEffectType effect) Set the secondary effect on this beacon, or null to clear.从接口继承的方法 org.bukkit.block.BlockState
getBlock, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getTypeId, getWorld, getX, getY, getZ, isPlaced, setData, setRawData, setType, setTypeId, update, update, update
从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
从接口继承的方法 org.bukkit.Nameable
getCustomName, setCustomName
-
方法详细资料
-
getInventory
BeaconInventory getInventory()从接口复制的说明: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.
- 指定者:
getInventory
在接口中Container
- 指定者:
getInventory
在接口中InventoryHolder
- 返回:
- the inventory
-
getSnapshotInventory
BeaconInventory getSnapshotInventory()从接口复制的说明: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.- 指定者:
getSnapshotInventory
在接口中Container
- 返回:
- the captured inventory snapshot
-
getEntitiesInRange
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
PotionEffect getPrimaryEffect()Returns the primary effect set on the beacon- 返回:
- the primary effect or null if not set
-
setPrimaryEffect
Set the primary effect on this beacon, or null to clear.- 参数:
effect
- new primary effect
-
getSecondaryEffect
PotionEffect getSecondaryEffect()Returns the secondary effect set on the beacon.- 返回:
- the secondary effect or null if no secondary effect
-
setSecondaryEffect
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
-