接口 FallingBlock
- 所有超级接口:
CommandSender,Entity,Metadatable,Nameable,Permissible,PersistentDataHolder,ServerOperator
原文: Represents a falling block
-
嵌套类概要
从接口继承的嵌套类/接口 org.bukkit.entity.Entity
Entity.Spigot -
方法概要
修饰符和类型方法说明boolean获取此方块能否砸伤实体.获取下落方块的方块数据.boolean获取下落方块落地后是否会消失且不掉落物品.float获取下落方块对实体造成的伤害乘以下落距离的值.boolean获取下落方块被阻挡时是否会变为掉落物.已过时。int获取下落方块落地时对实体造成的最大伤害.voidsetCancelDrop(boolean cancelDrop) 设置下落方块落地后是否会消失且不掉落物品.voidsetDamagePerBlock(float damage) 设置下落方块对实体造成的伤害乘以下落距离的值.voidsetDropItem(boolean drop) 设置下落方块被阻挡时是否会变为掉落物.voidsetHurtEntities(boolean hurtEntities) 设置此方块能否砸伤实体.voidsetMaxDamage(int damage) 设置下落方块落地时对实体造成的最大伤害.从接口继承的方法 org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage从接口继承的方法 org.bukkit.entity.Entity
addPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, getAsString, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isInWorld, isOnGround, isPersistent, isSilent, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spigot, teleport, teleport, teleport, teleport从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata从接口继承的方法 org.bukkit.Nameable
getCustomName, setCustomName从接口继承的方法 org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer从接口继承的方法 org.bukkit.permissions.ServerOperator
isOp, setOp
-
方法详细资料
-
getMaterial
已过时。请使用getBlockData()获取下落方块的类型.原文: Get the Material of the falling block
- 返回:
- 方块的材质
-
getBlockData
获取下落方块的方块数据.原文:Get the data for the falling block
- 返回:
- 方块的数据
-
getDropItem
boolean getDropItem()获取下落方块被阻挡时是否会变为掉落物.请注意, 如果
getCancelDrop()为true, 则下落方块将不会掉落物品, 无论此方法是否返回true.原文: Get if the falling block will break into an item if it cannot be placed.
Note that if
getCancelDrop()istrue, the falling block will not drop an item regardless of whether or not the returned value istrue.- 返回:
- 方块在被阻挡时是否会变为掉落物.
-
setDropItem
void setDropItem(boolean drop) 设置下落方块被阻挡时是否会变为掉落物.请注意, 如果
getCancelDrop()为true, 则下落方块将不会掉落物品, 无论是否设置为true. 原文: Set if the falling block will break into an item if it cannot be placed.Note that if
getCancelDrop()istrue, the falling block will not drop an item regardless of whether or not the value is set totrue.- 参数:
drop- 当被阻挡时变为掉落物时返回 true.
-
getCancelDrop
boolean getCancelDrop()获取下落方块落地后是否会消失且不掉落物品.与
getDropItem()不同, 此属性会阻止方块落地时形成方块, 使其消失. 如果此属性为 true 且getDropItem()为 true, 则 不会 掉落物品.原文:Get if the falling block will not become a block upon landing and not drop an item.
Unlike
getDropItem(), this property will prevent the block from forming into a block when it lands, causing it to disappear. If this property is true andgetDropItem()is true, an item will NOT be dropped.- 返回:
- 方块是否会消失
-
setCancelDrop
void setCancelDrop(boolean cancelDrop) 设置下落方块落地后是否会消失且不掉落物品.与
setDropItem(boolean)不同, 此属性会阻止方块落地时形成方块, 使其消失. 如果此属性为 true 且getDropItem()为 true, 则 不会 掉落物品.原文:Get if the falling block will not become a block upon landing and not drop an item.
Unlike
setDropItem(boolean), this property will prevent the block from forming into a block when it lands, causing it to disappear. If this property is true andgetDropItem()is true, an item will NOT be dropped.- 参数:
cancelDrop- 设为 true 使方块落地时消失
-
canHurtEntities
boolean canHurtEntities()获取此方块能否砸伤实体.原文: Get the HurtEntities state of this block.
- 返回:
- 此方块能否砸伤实体.
-
setHurtEntities
void setHurtEntities(boolean hurtEntities) 设置此方块能否砸伤实体.原文: Set the HurtEntities state of this block.
- 参数:
hurtEntities- 此方块能否砸伤实体.
-
getDamagePerBlock
float getDamagePerBlock()获取下落方块对实体造成的伤害乘以下落距离的值.原文:Get the amount of damage inflicted upon entities multiplied by the distance that the block had fallen when this falling block lands on them.
- 返回:
- 每格伤害
-
setDamagePerBlock
void setDamagePerBlock(float damage) 设置下落方块对实体造成的伤害乘以下落距离的值.如果
damage非零, 此方法会自动调用setHurtEntities(true).原文:Set the amount of damage inflicted upon entities multiplied by the distance that the block had fallen when this falling block lands on them.
If
damageis non-zero, this method will automatically callsetHurtEntities(true).- 参数:
damage- 要设置的每格伤害. 必须 >= 0.0
-
getMaxDamage
int getMaxDamage()获取下落方块落地时对实体造成的最大伤害.原文:Get the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.
- 返回:
- 最大伤害
-
setMaxDamage
void setMaxDamage(int damage) 设置下落方块落地时对实体造成的最大伤害.如果
damage非零, 此方法会自动调用setHurtEntities(true).原文:Set the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.
If
damageis non-zero, this method will automatically callsetHurtEntities(true).- 参数:
damage- 要设置的最大伤害. 必须 >= 0
-
getBlockData()