EntityProperties

Link to entityproperties

Builder to create an 'EntityProperties' loot condition.

This condition checks the LootContext for an MCEntity that matches the targeted one, specified via TargetedEntity, along with some additional properties like world and origin. The entity, if present, is matched against an EntityPredicate which will be used to determine entity-specific properties.

The condition passes if and only if there exists a valid entity to target and the predicate matches.

A valid 'EntityProperties' loot condition has to specify a targeted entity. The predicate, on the other hand, is optional: a lack of predicate means that the condition will simply check for the presence of the targeted entity.

Diese Klasse importieren

Link to diese-klasse-importieren

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
Copy
import crafttweaker.api.loot.conditions.vanilla.EntityProperties;

Implemented Interfaces

Link to implemented-interfaces

EntityProperties implements the following interfaces. That means all methods defined in these interfaces are also available in EntityProperties

Name: withPredicate

Creates and sets the EntityPredicate that will be matched against the targeted entity.

Any changes that have already been made to the predicate will be overwritten, effectively replacing the previous predicate, if any.

This parameter is <strong>optional</strong>.

Returns: This builder for chaining.
Return Type: EntityProperties

ZenScript
Copy
EntityProperties.withPredicate(builder as Consumer<EntityPredicate>) as EntityProperties
ParameterTypeBeschreibung
Parameter
bauer
Type
Consumer<EntityPredicate>
Beschreibung
A consumer that will be used to configure the EntityPredicate.

Name: withTargetedEntity

Sets the entity that should be targeted by the loot condition.

Refer to TargetedEntity for a full list and their respective meaning.

This parameter is <strong>required</strong>.

Returns: This builder for chaining.
Return Type: EntityProperties

ZenScript
Copy
EntityProperties.withTargetedEntity(entity as TargetedEntity) as EntityProperties
ParameterTypeBeschreibung
Parameter
entity
Type
TargetedEntity
Beschreibung
The entity that should be targeted.