接口 Conduit
- 所有超级接口:
BlockState
,Metadatable
,PersistentDataHolder
,TileState
-
方法概要
修饰符和类型方法说明int
Get the amount of valid frame blocks that are currently surrounding the conduit.Get aCollection
of allBlocks
that make up the frame of this conduit.Get aBoundingBox
(relative to real-world coordinates) in which the conduit will search for hostile entities to target.int
getRange()
Get the range (measured in blocks) within which players will receive the conduit's benefits.Get the conduit's hunting target.boolean
Check whether or not this conduit has an active (alive) hunting target.boolean
isActive()
Checks whether or not this conduit is active.boolean
Get whether or not this conduit is actively hunting for nearby hostile creatures.boolean
setTarget
(@Nullable LivingEntity target) Set the conduit's hunting target.从接口继承的方法 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
-
方法详细资料
-
isActive
boolean isActive()Checks whether or not this conduit is active.A conduit is considered active if there are at least 16 valid frame blocks surrounding it and the conduit is surrounded by a 3x3x3 area of water source blocks (or waterlogged blocks), at which point its animation will activate, start spinning, and apply effects to nearby players.
- 返回:
- true if active, false otherwise
-
isHunting
boolean isHunting()Get whether or not this conduit is actively hunting for nearby hostile creatures.A conduit will hunt if it is active (see
isActive()
) and its frame is complete (it is surrounded by at least 42 valid frame blocks). While hunting, theconduit's target
, if within itshunting area
, will be damaged every 2 seconds.- 返回:
- true if hunting, false otherwise
-
getFrameBlocks
Get aCollection
of allBlocks
that make up the frame of this conduit. The returned collection will contain only blocks that match the types required by the conduit to make up a valid frame, not the blocks at which the conduit is searching, meaning it will be of variable size depending on how many valid frames are surrounding the conduit at the time of invocation.- 返回:
- the frame blocks
-
getFrameBlockCount
int getFrameBlockCount()Get the amount of valid frame blocks that are currently surrounding the conduit.- 返回:
- the frame block count
-
getRange
int getRange()Get the range (measured in blocks) within which players will receive the conduit's benefits.- 返回:
- the conduit range
-
setTarget
Set the conduit's hunting target.Note that the value set by this method may be overwritten by the conduit's periodic hunting logic. If the target is ever set to
null
, the conduit will continue to look for a new target. Additionally, if the target is set to an entity that does not meet a conduit's hunting conditions (e.g. the entity is not within thehunting area
, has already been killed, etc.) then the passed entity will be ignored and the conduit will also continue to look for a new target.- 参数:
target
- the target entity, or null to remove the target- 返回:
- true if the target was changed, false if the target was the same
-
getTarget
Get the conduit's hunting target.- 返回:
- the hunting target, or null if the conduit does not have a target
-
hasTarget
boolean hasTarget()Check whether or not this conduit has an active (alive) hunting target.- 返回:
- true if has a hunting target, false otherwise
-
getHuntingArea
Get aBoundingBox
(relative to real-world coordinates) in which the conduit will search for hostile entities to target.- 返回:
- the hunting area bounding box
-