程序包 org.bukkit.block
接口 CreatureSpawner
- 所有超级接口:
BlockState
,Metadatable
代表一个刷怪笼(快照).
-
方法概要
修饰符和类型方法说明已过时。int
getDelay()
获取刷怪笼的刷怪延迟.int
Set the new maximum amount of similar entities that are allowed to be within spawning range of this spawner.int
The maximum spawn delay amount (in ticks).int
The minimum spawn delay amount (in ticks).int
Get the maximum distance(squared) a player can be in order for this spawner to be active.int
Get how many mobs attempt to spawn.获取刷怪笼的类型.int
Get the radius around which the spawner will attempt to spawn mobs in.void
setCreatureTypeByName
(String creatureType) 已过时。不安全的参数,请使用setSpawnedType(org.bukkit.entity.EntityType)
.void
setDelay
(int delay) 设置刷怪笼刷怪延迟.void
setMaxNearbyEntities
(int maxNearbyEntities) Set the maximum number of similar entities that are allowed to be within spawning range of this spawner.void
setMaxSpawnDelay
(int delay) Set the maximum spawn delay amount (in ticks).void
setMinSpawnDelay
(int delay) Set the minimum spawn delay amount (in ticks).void
setRequiredPlayerRange
(int requiredPlayerRange) Set the maximum distance (squared) a player can be in order for this spawner to be active.void
setSpawnCount
(int spawnCount) Set how many mobs attempt to spawn.void
setSpawnedType
(EntityType creatureType) 设置刷怪笼的类型.void
setSpawnRange
(int spawnRange) Set the new spawn range.从接口继承的方法 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
-
方法详细资料
-
getSpawnedType
EntityType getSpawnedType()获取刷怪笼的类型.原文: Get the spawner's creature type.
- 返回:
- 刷怪笼的类型.
-
setSpawnedType
设置刷怪笼的类型.原文: Set the spawner's creature type.
- 参数:
creatureType
- 刷怪笼的类型.
-
setCreatureTypeByName
已过时。不安全的参数,请使用setSpawnedType(org.bukkit.entity.EntityType)
.设置刷怪笼要生成的生物类型.原文 Set the spawner mob type.
- 参数:
creatureType
- 刷怪笼类型的名称.
-
getCreatureTypeName
已过时。不安全的参数,请使用getSpawnedType()
.获取要刷出的生物的名称.原文: Get the spawner's creature type.
- 返回:
- 要刷出的生物的名称.
-
getDelay
int getDelay()获取刷怪笼的刷怪延迟.
延迟时间以tick为单位.原文: Get the spawner's delay.
This is the delay, in ticks, until the spawner will spawn its next mob.- 返回:
- 延迟.
-
setDelay
void setDelay(int delay) 设置刷怪笼刷怪延迟.
如果设为-1,则刷怪延迟将被重置为一个随机的值(范围在getMinSpawnDelay()
和getMaxSpawnDelay()
之间).原文: Set the spawner's delay.
If set to -1, the spawn delay will be reset to a random value betweengetMinSpawnDelay()
andgetMaxSpawnDelay()
.- 参数:
delay
- 延迟.
-
getMinSpawnDelay
int getMinSpawnDelay()The minimum spawn delay amount (in ticks).
This value is used when the spawner resets its delay (for any reason). It will choose a random number betweengetMinSpawnDelay()
andgetMaxSpawnDelay()
for its nextgetDelay()
. Default value is 200 ticks.- 返回:
- the minimum spawn delay amount
-
setMinSpawnDelay
void setMinSpawnDelay(int delay) Set the minimum spawn delay amount (in ticks).- 参数:
delay
- the minimum spawn delay amount- 另请参阅:
-
getMaxSpawnDelay
int getMaxSpawnDelay()The maximum spawn delay amount (in ticks).
This value is used when the spawner resets its delay (for any reason). It will choose a random number betweengetMinSpawnDelay()
andgetMaxSpawnDelay()
for its nextgetDelay()
.
This value must be greater than 0 and less than or equal togetMaxSpawnDelay()
. Default value is 800 ticks.- 返回:
- the maximum spawn delay amount
-
setMaxSpawnDelay
void setMaxSpawnDelay(int delay) Set the maximum spawn delay amount (in ticks).
This value must be greater than 0, as well as greater than or equal togetMinSpawnDelay()
- 参数:
delay
- the new maximum spawn delay amount- 另请参阅:
-
getSpawnCount
int getSpawnCount()Get how many mobs attempt to spawn.
Default value is 4.- 返回:
- the current spawn count
-
setSpawnCount
void setSpawnCount(int spawnCount) Set how many mobs attempt to spawn.- 参数:
spawnCount
- the new spawn count
-
getMaxNearbyEntities
int getMaxNearbyEntities()Set the new maximum amount of similar entities that are allowed to be within spawning range of this spawner.
If more than the maximum number of entities are within range, the spawner will not spawn and try again with a newgetDelay()
.
Default value is 16.- 返回:
- the maximum number of nearby, similar, entities
-
setMaxNearbyEntities
void setMaxNearbyEntities(int maxNearbyEntities) Set the maximum number of similar entities that are allowed to be within spawning range of this spawner.
Similar entities are entities that are of the sameEntityType
- 参数:
maxNearbyEntities
- the maximum number of nearby, similar, entities
-
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.
-
getSpawnRange
int getSpawnRange()Get the radius around which the spawner will attempt to spawn mobs in.
This area is square, includes the block the spawner is in, and is centered on the spawner's x,z coordinates - not the spawner itself.
It is 2 blocks high, centered on the spawner's y-coordinate (its bottom); thus allowing mobs to spawn as high as its top surface and as low as 1 block below its bottom surface.
Default value is 4.- 返回:
- the spawn range
-
setSpawnRange
void setSpawnRange(int spawnRange) Set the new spawn range.- 参数:
spawnRange
- the new spawn range- 另请参阅:
-
getSpawnedType()
.