EntityLocationPredicate .java

net.minecraft.advancements.predicates.entity.EntityLocationPredicate (record): members: predicate, matches, CODEC. imports: LocationPredicate, Entity.

net.minecraft.advancements.predicates.entityrecord18 linescommon788 B

Implements

API Surface (1)

boolean matches(final Entity entity, final ServerLevel level, final @Nullable Vec3 position)

Fields & Constants (1)

CODEC

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

EntityLocationPredicate.java18 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.advancements.predicates.entity;
2
3
import com.mojang.serialization.Codec;
4
import net.minecraft.advancements.predicates.LocationPredicate;
5
import net.minecraft.server.level.ServerLevel;
6
import net.minecraft.world.entity.Entity;
7
import net.minecraft.world.phys.Vec3;
8
import org.jspecify.annotations.Nullable;
9
10
public record EntityLocationPredicate(LocationPredicate predicate) implements EntitySubPredicate {
11
	public static final Codec<EntityLocationPredicate> CODEC = LocationPredicate.CODEC.xmap(EntityLocationPredicate::new, EntityLocationPredicate::predicate);
12
13
	@Override
14
	public boolean matches(final Entity entity, final ServerLevel level, final @Nullable Vec3 position) {
15
		return this.predicate.matches(level, entity.getX(), entity.getY(), entity.getZ());
16
	}
17
}
18

Decompiled Minecraft 26.3 source of EntityLocationPredicate (net/minecraft/advancements/predicates/entity/EntityLocationPredicate.java) with Mojang official mappings, stored verbatim on the site.