Home Commands Examples Getting Started With Scripts Global Keywords
Block BlockIngredient BlockState
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

Fallable

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.block.type.falling.Fallable;

Methods

Gets the damage source used when this block falls on an entity.

Returns: The damage source used when this block falls on an entity.
Return Type: DamageSource

script.zs
// Fallable.getFallDamageSource() as DamageSource
(<block:minecraft:sand> as Fallable).getFallDamageSource();

Gets a predicate that determines if an entity should be damaged by this falling block.

Returns: The predicate that determines if an entity should be damaged by this falling block.
Return Type: Predicate<Entity>

script.zs
// Fallable.getHurtsEntitySelector() as Predicate<Entity>
(<block:minecraft:sand> as Fallable).getHurtsEntitySelector();
script.zs
Fallable.onBrokenAfterFall(level as Level, pos as BlockPos, fallingEntity as FallingBlockEntity)
ParameterType
Parameter
level
Type
Level
Parameter
pos
Type
BlockPos
Parameter
fallingEntity
Type
FallingBlockEntity
script.zs
Fallable.onLand(level as Level, pos as BlockPos, fallingState as BlockState, placeState as BlockState, fallingEntity as FallingBlockEntity)
ParameterType
Parameter
level
Type
Level
Parameter
pos
Type
BlockPos
Parameter
fallingState
Type
BlockState
Parameter
placeState
Type
BlockState
Parameter
fallingEntity
Type
FallingBlockEntity

Properties

NameTypeHas GetterHas SetterDescription
Name
fallDamageSource
Type
DamageSource
Has Getter
true
Has Setter
false
Description
Gets the damage source used when this block falls on an entity.
Name
hurtsEntitySelector
Type
Predicate<Entity>
Has Getter
true
Has Setter
false
Description
Gets a predicate that determines if an entity should be damaged by this falling block.