BlockStateProperty
Link to blockstateproperty
Builder to create a 'BlockStateProperty' loot condition.
This condition compares the the block state obtained from the LootContext and attempts to match it to the given MCBlock. If this comparison succeeds, then the state is further compared according to the rules outlined in the StatePropertiesPredicate.
This condition thus passes only if the block matches the given one and, optionally, if all the state properties match according to the predicate given to this loot condition.
A 'BlockStateProperty' condition requires a block to be correctly built. Properties may or may not be specified.
导入类
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.loot.conditions.vanilla.BlockStateProperty;
已实现的接口
Link to 已实现的接口
BlockStateProperty implements the following interfaces. That means all methods defined in these interfaces are also available in BlockStateProperty
使用方式
Link to 使用方式
Name: withBlock
Sets the block that should be matched by the loot condition.
This parameter is required.
Returns: This builder for chaining.
Return Type: BlockStateProperty
ZenScript CopyBlockStateProperty.withBlock(block as MCBlock) as BlockStateProperty
参数 | 类型 | 描述 |
---|---|---|
参数 block #方块 | 类型 MCBlock #MC方块 | 描述 The block to be matched. |
Name: withStatePropertiesPredicate
Creates and sets the StatePropertiesPredicate that will be matched against the state's properties.
Any changes that have already been made to the predicate will be overwritten, effectively replacing the previous predicate, if any.
This parameter is optional.
Returns: This builder for chaining.
Return Type: BlockStateProperty
ZenScript CopyBlockStateProperty.withStatePropertiesPredicate(builder as Consumer<StatePropertiesPredicate>) as BlockStateProperty
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<StatePropertiesPredicate> | 描述 A consumer that will be used to configure the StatePropertiesPredicate. |