And
Link to and
Builder to create an 'AND' loot condition.
All sub-conditions added to this loot condition must match in order for this condition to pass. Effectively, this means all sub-conditions get merged with an 'AND' connector between them.
This loot condition should have two or more sub-conditions. An 'And' loot condition with a single element behaves as if it were replaced with the sub-condition itself. An 'And' loot condition without any sub-conditions passes directly.
导入类
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.crafttweaker.And;
已实现的接口
Link to 已实现的接口
And implements the following interfaces. That means all methods defined in these interfaces are also available in And
使用方式
Link to 使用方式
Name: add
Adds a new condition to the list of sub-conditions that will get merged together into an 'AND' condition.
At least two sub-conditions should be added to obtain a well-built and well-behaved 'And' loot condition.
Returns: This condition for chaining.
Return Type: And
ZenScript CopyAnd.add<T : ILootConditionTypeBuilder>(lender as Consumer<T>) as And
参数 | 类型 | 描述 |
---|---|---|
参数 lender | 类型 Consumer<T> | 描述 A consumer that allows configuration of the given condition. |
参数 T | 类型 ILootConditionTypeBuilder | 描述 The known type of the condition itself. |