Fallable
Link to fallable
导入类
Link to 导入类
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.
ZenScript Copyimport crafttweaker.api.block.type.falling.Fallable;
使用方式
Link to 使用方式
Name: getFallDamageSource
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
ZenScript Copy// Fallable.getFallDamageSource() as DamageSource
(<block:minecraft:sand> as Fallable).getFallDamageSource();
Name: getHurtsEntitySelector
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>
ZenScript Copy// Fallable.getHurtsEntitySelector() as Predicate<Entity>
(<block:minecraft:sand> as Fallable).getHurtsEntitySelector();
Name: onBrokenAfterFall
ZenScript CopyFallable.onBrokenAfterFall(level as Level, pos as BlockPos, fallingEntity as FallingBlockEntity)
参数 | 类型 |
---|---|
参数 level | 类型 Level |
参数 点 | 类型 BlockPos |
参数 fallingEntity | 类型 FallingBlockEntity |
Name: onLand
ZenScript CopyFallable.onLand(level as Level, pos as BlockPos, fallingState as BlockState, placeState as BlockState, fallingEntity as FallingBlockEntity)
参数 | 类型 |
---|---|
参数 level | 类型 Level |
参数 点 | 类型 BlockPos |
参数 fallingState | 类型 BlockState |
参数 placeState | 类型 BlockState |
参数 fallingEntity | 类型 FallingBlockEntity |
名称 | 类型 | 可获得 | 可设置 | 描述 |
---|---|---|---|---|
名称 fallDamageSource | 类型 DamageSource | 可获得 true | 可设置 false | 描述 Gets the damage source used when this block falls on an entity. |
名称 hurtsEntitySelector | 类型 Predicate<Entity> | 可获得 true | 可设置 false | 描述 Gets a predicate that determines if an entity should be damaged by this falling block. |