Interface FallingBlock
- All Superinterfaces:
Audience
,CommandSender
,Entity
,HoverEventSource<HoverEvent.ShowEntity>
,Metadatable
,Nameable
,Permissible
,PersistentDataHolder
,PersistentDataViewHolder
,Pointered
,ServerOperator
,Sound.Emitter
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the HurtEntities state of this block.boolean
Sets if this falling block should expire after: - 30 seconds - 5 seconds and is outside of the worldGet the data for the falling blockGet the data of the falling block represented as aBlockState
which includes potential NBT data that gets applied when the block gets placed on landing.boolean
Get if the falling block will not become a block upon landing and not drop an item.float
Get the amount of damage inflicted upon entities multiplied by the distance that the block had fallen when this falling block lands on them.boolean
Get if the falling block will break into an item if it cannot be placed.Deprecated.int
Get the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.default Location
Deprecated.replaced byEntity.getOrigin()
void
setBlockData
(@NotNull BlockData blockData) Sets the data for the falling block.void
setBlockState
(BlockState blockState) Sets theBlockData
and possibly present tile entity data for the falling block.void
setCancelDrop
(boolean cancelDrop) Get if the falling block will not become a block upon landing and not drop an item.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.void
setDropItem
(boolean drop) Set if the falling block will break into an item if it cannot be placed.void
setHurtEntities
(boolean hurtEntities) Set the HurtEntities state of this block.void
setMaxDamage
(int damage) Set the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.void
shouldAutoExpire
(boolean autoExpires) Sets if this falling block should expire after: - 30 seconds - 5 seconds and is outside of the worldMethods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessage
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, broadcastHurtAnimation, collidesAt, copy, copy, createSnapshot, eject, fromMobSpawner, getAsString, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, hasNoPhysics, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvisible, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isInWorld, isOnGround, isPersistent, isSilent, isSneaking, isTicking, isUnderWater, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvisible, setInvulnerable, setLastDamageCause, setNoPhysics, setPassenger, setPersistent, setPortalCooldown, setPose, setPose, setRotation, setSilent, setSneaking, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, teleportAsync, wouldCollideUsing
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomName
Methods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachment
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
Methods 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
-
setBlockData
Sets the data for the falling block.
Any potential additional data currently stored in the falling blocksgetBlockState()
will be purged by calling this setter.- Parameters:
blockData
- the data to use as the block
-
getBlockState
Get the data of the falling block represented as aBlockState
which includes potential NBT data that gets applied when the block gets placed on landing.- Returns:
- the BlockState representing this block
-
setBlockState
Sets theBlockData
and possibly present tile entity data for the falling block.- Parameters:
blockState
- the BlockState to use
-
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
damage
is 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
damage
is non-zero, this method will automatically callsetHurtEntities(true)
.- Parameters:
damage
- the max damage to set. Must be >= 0
-
getSourceLoc
Deprecated.replaced byEntity.getOrigin()
Gets the source block location of the FallingBlock- Returns:
- the source block location the FallingBlock was spawned from
-
doesAutoExpire
boolean doesAutoExpire()Sets if this falling block should expire after: - 30 seconds - 5 seconds and is outside of the world- Returns:
- if this behavior occurs
-
shouldAutoExpire
void shouldAutoExpire(boolean autoExpires) Sets if this falling block should expire after: - 30 seconds - 5 seconds and is outside of the world- Parameters:
autoExpires
- if this behavior should occur
-
getBlockData()