EntityEquipmentPredicate
Link to entityequipmentpredicate
Represents the predicate for an MCEntity's equipment.
The predicate can be used to check any number and combination of items that are being used by the entity as armor or held as weapons, either in the main hand or in the off-hand, with the help of ItemPredicates.
By default, the entity passes the checks no matter its current equipment.
导入类
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.predicate.EntityEquipmentPredicate;
Extending AnyDefaultingVanillaWrappingPredicate
Link to extending-anydefaultingvanillawrappingpredicate
EntityEquipmentPredicate extends AnyDefaultingVanillaWrappingPredicate. That means all methods available in AnyDefaultingVanillaWrappingPredicate are also available in EntityEquipmentPredicate
使用方式
Link to 使用方式
Name: withChestItem
Creates and sets the ItemPredicate that will be used to match the entity's chest armor slot.
Any changes that have been made previously to the item predicate will be discarded, if any.
Returns: The predicate itself for chaining.
Return Type: EntityEquipmentPredicate
ZenScript CopyEntityEquipmentPredicate.withChestItem(builder as Consumer<ItemPredicate>) as EntityEquipmentPredicate
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<ItemPredicate> | 描述 A consumer that will be used to configure the ItemPredicate. |
Name: withFeetItem
Creates and sets the ItemPredicate that will be used to match the entity's feet armor slot.
Any changes that have been made previously to the item predicate will be discarded, if any.
Returns: The predicate itself for chaining.
Return Type: EntityEquipmentPredicate
ZenScript CopyEntityEquipmentPredicate.withFeetItem(builder as Consumer<ItemPredicate>) as EntityEquipmentPredicate
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<ItemPredicate> | 描述 A consumer that will be used to configure the ItemPredicate. |
Name: withHeadItem
Creates and sets the ItemPredicate that will be used to match the entity's head armor slot.
Any changes that have been made previously to the item predicate will be discarded, if any.
Returns: The predicate itself for chaining.
Return Type: EntityEquipmentPredicate
ZenScript CopyEntityEquipmentPredicate.withHeadItem(builder as Consumer<ItemPredicate>) as EntityEquipmentPredicate
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<ItemPredicate> | 描述 A consumer that will be used to configure the ItemPredicate. |
Name: withItemInHand
Creates and sets the ItemPredicate that will be used to match the item held in the entity's hand.
It is assumed that the entity can carry items only in its main hand.
Any changes that have been made previously to the item predicate will be discarded, if any.
Returns: The predicate itself for chaining.
Return Type: EntityEquipmentPredicate
ZenScript CopyEntityEquipmentPredicate.withItemInHand(builder as Consumer<ItemPredicate>) as EntityEquipmentPredicate
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<ItemPredicate> | 描述 A consumer that will be used to configure the ItemPredicate. |
Name: withItemInMainHand
Creates and sets the ItemPredicate that will be used to match the item held in the entity's main hand.
Any changes that have been made previously to the item predicate will be discarded, if any.
Returns: The predicate itself for chaining.
Return Type: EntityEquipmentPredicate
ZenScript CopyEntityEquipmentPredicate.withItemInMainHand(builder as Consumer<ItemPredicate>) as EntityEquipmentPredicate
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<ItemPredicate> | 描述 A consumer that will be used to configure the ItemPredicate. |
Name: withItemInOffHand
Creates and sets the ItemPredicate that will be used to match the item held in the entity's off hand.
Any changes that have been made previously to the item predicate will be discarded, if any.
Returns: The predicate itself for chaining.
Return Type: EntityEquipmentPredicate
ZenScript CopyEntityEquipmentPredicate.withItemInOffHand(builder as Consumer<ItemPredicate>) as EntityEquipmentPredicate
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<ItemPredicate> | 描述 A consumer that will be used to configure the ItemPredicate. |
Name: withLegsItem
Creates and sets the ItemPredicate that will be used to match the entity's legs armor slot.
Any changes that have been made previously to the item predicate will be discarded, if any.
Returns: The predicate itself for chaining.
Return Type: EntityEquipmentPredicate
ZenScript CopyEntityEquipmentPredicate.withLegsItem(builder as Consumer<ItemPredicate>) as EntityEquipmentPredicate
参数 | 类型 | 描述 |
---|---|---|
参数 生成器 | 类型 Consumer<ItemPredicate> | 描述 A consumer that will be used to configure the ItemPredicate. |