WaterAvoidingRandomFlyingGoal .java

net.minecraft.world.entity.ai.goal.WaterAvoidingRandomFlyingGoal (class): members: getPosition. imports: HoverRandomPos, AirAndWaterRandomPos, Vec3.

net.minecraft.world.entity.ai.goalclass24 linescommonextends WaterAvoidingRandomStrollGoal949 B

API Surface (0)

No public/protected methods detected (fields or constants only).

Code Graph: Dependencies (5)

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

Full Source

WaterAvoidingRandomFlyingGoal.java24 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity.ai.goal;
2
3
import net.minecraft.world.entity.PathfinderMob;
4
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
5
import net.minecraft.world.entity.ai.util.HoverRandomPos;
6
import net.minecraft.world.phys.Vec3;
7
import org.jspecify.annotations.Nullable;
8
9
public class WaterAvoidingRandomFlyingGoal extends WaterAvoidingRandomStrollGoal {
10
	public WaterAvoidingRandomFlyingGoal(final PathfinderMob mob, final double speedModifier) {
11
		super(mob, speedModifier);
12
	}
13
14
	@Override
15
	protected @Nullable Vec3 getPosition() {
16
		Vec3 wanderDirection = this.mob.getViewVector(0.0F);
17
		int xzDist = 8;
18
		Vec3 groundBasedPosition = HoverRandomPos.getPos(this.mob, 8, 7, wanderDirection.x, wanderDirection.z, (float) (Math.PI / 2), 3, 1);
19
		return groundBasedPosition != null
20
			? groundBasedPosition
21
			: AirAndWaterRandomPos.getPos(this.mob, 8, 4, -2, wanderDirection.x, wanderDirection.z, (float) (Math.PI / 2));
22
	}
23
}
24

Decompiled Minecraft 26.3 source of WaterAvoidingRandomFlyingGoal (net/minecraft/world/entity/ai/goal/WaterAvoidingRandomFlyingGoal.java) with Mojang official mappings, stored verbatim on the site.