EntityPredicate

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.predicate.EntityPredicate;

Members

static create() as Builder
script.zs
// EntityPredicate.create() as EntityPredicateBuilder;
EntityPredicate.create();

Return Type: EntityPredicateBuilder

static create(entityType as EntityType<?>) as Builder
script.zs
// EntityPredicate.create(entityType as EntityType<?>) as EntityPredicateBuilder;
EntityPredicate.create(myEntityType);

Parameters:

entityType Type: EntityType<?>

Return Type: EntityPredicateBuilder

static create(entityTag as KnownTag<EntityType<?>>) as Builder
script.zs
// EntityPredicate.create(entityTag as KnownTag<EntityType<?>>) as EntityPredicateBuilder;
EntityPredicate.create(myKnownTag);

Parameters:

entityTag Type: KnownTag<EntityType<?>>

Return Type: EntityPredicateBuilder

matches(player as ServerPlayer, entity as Entity) as bool
script.zs
// EntityPredicate.matches(player as ServerPlayer, entity as Entity) as bool;
myEntityPredicate.matches(myServerPlayer, myEntity);

Parameters:

player Type: ServerPlayer
entity Type: Entity

Return Type: bool

matches(level as ServerLevel, pos as Vec3, entity as Entity) as bool
script.zs
// EntityPredicate.matches(level as ServerLevel, pos as Vec3, entity as Entity) as bool;
myEntityPredicate.matches(myServerLevel, myVec3, myEntity);

Parameters:

level Type: ServerLevel
pos Type: Vec3
entity Type: Entity

Return Type: bool