Interface FallingBlock
- All Superinterfaces:
CommandSender,Entity,Metadatable,Nameable,Permissible,PersistentDataHolder,ServerOperator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the HurtEntities state of this block.Get the data for the falling blockbooleanGet if the falling block will not become a block upon landing and not drop an item.floatGet the amount of damage inflicted upon entities multiplied by the distance that the block had fallen when this falling block lands on them.booleanGet if the falling block will break into an item if it cannot be placed.Deprecated.intGet the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.voidsetCancelDrop(boolean cancelDrop) Get if the falling block will not become a block upon landing and not drop an item.voidsetDamagePerBlock(float damage) Set the amount of damage inflicted upon entities multiplied by the distance that the block had fallen when this falling block lands on them.voidsetDropItem(boolean drop) Set if the falling block will break into an item if it cannot be placed.voidsetHurtEntities(boolean hurtEntities) Set the HurtEntities state of this block.voidsetMaxDamage(int damage) Set the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.Methods inherited from interface org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessageMethods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, 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, teleportMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.Nameable
getCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainerMethods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Method Details
-
getMaterial
Deprecated.usegetBlockData()Get the Material of the falling block- Returns:
- Material of the block
-
getBlockData
Get the data for the falling block- Returns:
- data of the block
-
getDropItem
boolean getDropItem()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.- Returns:
- true if the block will break into an item when obstructed
-
setDropItem
void setDropItem(boolean drop) 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.- Parameters:
drop- true to break into an item when obstructed
-
getCancelDrop
boolean getCancelDrop()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.- Returns:
- true if the block will disappear
-
setCancelDrop
void setCancelDrop(boolean cancelDrop) 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.- Parameters:
cancelDrop- true to make the block disappear when landing
-
canHurtEntities
boolean canHurtEntities()Get the HurtEntities state of this block.- Returns:
- whether entities will be damaged by this block.
-
setHurtEntities
void setHurtEntities(boolean hurtEntities) Set the HurtEntities state of this block.- Parameters:
hurtEntities- whether entities will be damaged by this block.
-
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.- Returns:
- the damage per block
-
setDamagePerBlock
void setDamagePerBlock(float damage) 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).- Parameters:
damage- the damage per block to set. Must be >= 0.0
-
getMaxDamage
int getMaxDamage()Get the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.- Returns:
- the max damage
-
setMaxDamage
void setMaxDamage(int damage) 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).- Parameters:
damage- the max damage to set. Must be >= 0
-
getBlockData()