程序包 org.bukkit.block
接口 TrialSpawner
- 所有超级接口:
BlockState
,Metadatable
,PersistentDataHolder
,TileState
Represents a captured state of a trial spawner.
-
方法概要
修饰符和类型方法说明int
Gets the length in ticks the spawner will stay in cooldown for.Gets theTrialSpawnerConfiguration
used whenisOminous()
is false.Gets theTrialSpawnerConfiguration
used whenisOminous()
is true.int
Get the maximum distance(squared) a player can be in order for this spawner to be active.Gets a list of entities this spawner is currently tracking.Gets the players this spawner is currently tracking.boolean
Checks if this spawner is using the ominousTrialSpawnerConfiguration
.boolean
isTrackingEntity
(@NotNull Entity entity) Checks if this spawner is currently tracking the provided entity.boolean
isTrackingPlayer
(@NotNull Player player) Checks if this spawner is currently tracking the provided player.void
setCooldownLength
(int ticks) Sets the length in ticks the spawner will stay in cooldown for.void
setOminous
(boolean ominous) Changes this spawner between the normal and ominousTrialSpawnerConfiguration
.void
setRequiredPlayerRange
(int requiredPlayerRange) Set the maximum distance (squared) a player can be in order for this spawner to be active.void
startTrackingEntity
(@NotNull Entity entity) Force this spawner to start tracking the provided entity.void
startTrackingPlayer
(@NotNull Player player) Force this spawner to start tracking the provided player.void
stopTrackingEntity
(@NotNull Entity entity) Force this spawner to stop tracking the provided entity.void
stopTrackingPlayer
(@NotNull Player player) Force this spawner to stop tracking the provided player.从接口继承的方法 org.bukkit.block.BlockState
copy, copy, getBlock, getBlockData, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
从接口继承的方法 org.bukkit.block.TileState
getPersistentDataContainer
-
方法详细资料
-
getCooldownLength
int getCooldownLength()Gets the length in ticks the spawner will stay in cooldown for.- 返回:
- the number of ticks
-
setCooldownLength
void setCooldownLength(int ticks) Sets the length in ticks the spawner will stay in cooldown for.- 参数:
ticks
- the number of ticks
-
getRequiredPlayerRange
int getRequiredPlayerRange()Get the maximum distance(squared) a player can be in order for this spawner to be active.
If this value is less than or equal to 0, this spawner is always active (given that there are players online).
Default value is 16.- 返回:
- the maximum distance(squared) a player can be in order for this spawner to be active.
-
setRequiredPlayerRange
void setRequiredPlayerRange(int requiredPlayerRange) Set the maximum distance (squared) a player can be in order for this spawner to be active.
Setting this value to less than or equal to 0 will make this spawner always active (given that there are players online).- 参数:
requiredPlayerRange
- the maximum distance (squared) a player can be in order for this spawner to be active.
-
getTrackedPlayers
Gets the players this spawner is currently tracking.Note: the returned collection is immutable, use
startTrackingPlayer(Player)
orstopTrackingPlayer(Player)
instead.- 返回:
- a collection of players this spawner is tracking or an empty collection if there aren't any
-
isTrackingPlayer
Checks if this spawner is currently tracking the provided player.- 参数:
player
- the player- 返回:
- true if this spawner is tracking the provided player
-
startTrackingPlayer
Force this spawner to start tracking the provided player.Note: the spawner may decide to stop tracking this player at any given time.
- 参数:
player
- the player
-
stopTrackingPlayer
Force this spawner to stop tracking the provided player.Note: the spawner may decide to start tracking this player again at any given time.
- 参数:
player
- the player
-
getTrackedEntities
Gets a list of entities this spawner is currently tracking.Note: the returned collection is immutable, use
startTrackingEntity(Entity)
orstopTrackingEntity(Entity)
instead.- 返回:
- a collection of entities this spawner is tracking or an empty collection if there aren't any
-
isTrackingEntity
Checks if this spawner is currently tracking the provided entity.- 参数:
entity
- the entity- 返回:
- true if this spawner is tracking the provided entity
-
startTrackingEntity
Force this spawner to start tracking the provided entity.Note: the spawner may decide to stop tracking this entity at any given time.
- 参数:
entity
- the entity
-
stopTrackingEntity
Force this spawner to stop tracking the provided entity.Note: the spawner may decide to start tracking this entity again at any given time.
- 参数:
entity
- the entity
-
isOminous
boolean isOminous()Checks if this spawner is using the ominousTrialSpawnerConfiguration
.- 返回:
- true is using the ominous configuration
-
setOminous
void setOminous(boolean ominous) Changes this spawner between the normal and ominousTrialSpawnerConfiguration
.- 参数:
ominous
- true to use the ominous TrialSpawnerConfiguration, false to use the normal one.
-
getNormalConfiguration
Gets theTrialSpawnerConfiguration
used whenisOminous()
is false.- 返回:
- the TrialSpawnerConfiguration
-
getOminousConfiguration
Gets theTrialSpawnerConfiguration
used whenisOminous()
is true.- 返回:
- the TrialSpawnerConfiguration
-