EntityTypePredicate

Link to entitytypepredicate

Represents the predicate for an MCEntity's type.

This predicate will check an entity's type against either a tag (MCTag<T>) or a MCEntityType directly. The first check will override the second if they are both present.

By default, any entity type is valid for this predicate.

Импорт класса

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
Copy
import crafttweaker.api.predicate.EntityTypePredicate;

Extending AnyDefaultingVanillaWrappingPredicate

Link to extending-anydefaultingvanillawrappingpredicate

EntityTypePredicate extends AnyDefaultingVanillaWrappingPredicate. That means all methods available in AnyDefaultingVanillaWrappingPredicate are also available in EntityTypePredicate

Name: withTag

Sets the MCTag<T> that this predicate should use for matching the entity's type.

The predicate will match successfully only if the given entity type is part of the given tag.

Specifying both a tag and an entity type to check against will make the tag override the direct type comparison.

Returns: This predicate for chaining.
Return Type: EntityTypePredicate

ZenScript
Copy
EntityTypePredicate.withTag(tag as MCTag<MCEntityType>) as EntityTypePredicate
ПараметрТипОписание
Параметр
tag
Тип
MCTag<MCEntityType>
Описание
The tag the predicate should use for matching.

Name: withType

Sets the MCEntityType that this predicate should match exactly.

If a tag to match against has already been set, then the tag check will override this check.

Returns: This predicate for chaining.
Return Type: EntityTypePredicate

ZenScript
Copy
EntityTypePredicate.withType(type as MCEntityType) as EntityTypePredicate
ПараметрТипОписание
Параметр
type
Тип
MCEntityType
Описание
The entity type this predicate should match.