SteppingOnPredicate .java

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

net.minecraft.advancements.predicates.entityrecord23 linescommon861 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

SteppingOnPredicate.java23 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 SteppingOnPredicate(LocationPredicate predicate) implements EntitySubPredicate {
11
	public static final Codec<SteppingOnPredicate> CODEC = LocationPredicate.CODEC.xmap(SteppingOnPredicate::new, SteppingOnPredicate::predicate);
12
13
	@Override
14
	public boolean matches(final Entity entity, final ServerLevel level, final @Nullable Vec3 position) {
15
		if (!entity.onGround()) {
16
			return false;
17
		}
18
19
		Vec3 onPos = Vec3.atCenterOf(entity.getOnPos());
20
		return this.predicate.matches(level, onPos.x(), onPos.y(), onPos.z());
21
	}
22
}
23

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