LookAtTradingPlayerGoal .java

net.minecraft.world.entity.ai.goal.LookAtTradingPlayerGoal (class, 24 lines): members: villager, canUse. imports: AbstractVillager, Player.

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

API Surface (1)

boolean canUse()

Fields & Constants (1)

villager

Code Graph: Dependencies (3)

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

Full Source

LookAtTradingPlayerGoal.java24 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity.ai.goal;
2
3
import net.minecraft.world.entity.npc.villager.AbstractVillager;
4
import net.minecraft.world.entity.player.Player;
5
6
public class LookAtTradingPlayerGoal extends LookAtPlayerGoal {
7
	private final AbstractVillager villager;
8
9
	public LookAtTradingPlayerGoal(final AbstractVillager villager) {
10
		super(villager, Player.class, 8.0F);
11
		this.villager = villager;
12
	}
13
14
	@Override
15
	public boolean canUse() {
16
		if (this.villager.isTrading()) {
17
			this.lookAt = this.villager.getTradingPlayer();
18
			return true;
19
		} else {
20
			return false;
21
		}
22
	}
23
}
24

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