EntityAttachment .java

net.minecraft.world.entity.EntityAttachment (enum): members: PASSENGER, VEHICLE, NAME_TAG, WARDEN_CHEST, createFallbackPoints, Fallback, fallback.

net.minecraft.world.entityenum31 linescommon986 B

API Surface (1)

List<Vec3> createFallbackPoints(final float width, final float height)

Fields & Constants (1)

fallback

Code Graph: Dependencies (1)

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

Full Source

EntityAttachment.java31 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity;
2
3
import java.util.List;
4
import net.minecraft.world.phys.Vec3;
5
6
public enum EntityAttachment {
7
	PASSENGER(EntityAttachment.Fallback.AT_HEIGHT),
8
	VEHICLE(EntityAttachment.Fallback.AT_FEET),
9
	NAME_TAG(EntityAttachment.Fallback.AT_HEIGHT),
10
	WARDEN_CHEST(EntityAttachment.Fallback.AT_CENTER);
11
12
	private final EntityAttachment.Fallback fallback;
13
14
	EntityAttachment(final EntityAttachment.Fallback fallback) {
15
		this.fallback = fallback;
16
	}
17
18
	public List<Vec3> createFallbackPoints(final float width, final float height) {
19
		return this.fallback.create(width, height);
20
	}
21
22
	public interface Fallback {
23
		List<Vec3> ZERO = List.of(Vec3.ZERO);
24
		EntityAttachment.Fallback AT_FEET = (width, height) -> ZERO;
25
		EntityAttachment.Fallback AT_HEIGHT = (width, height) -> List.of(new Vec3(0.0, height, 0.0));
26
		EntityAttachment.Fallback AT_CENTER = (width, height) -> List.of(new Vec3(0.0, height / 2.0, 0.0));
27
28
		List<Vec3> create(float width, float height);
29
	}
30
}
31

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