ContainerUser .java

net.minecraft.world.entity.ContainerUser (interface): members: getLivingEntity, getContainerInteractionRange, hasContainerOpen. imports: BlockPos.

net.minecraft.world.entityinterface19 linescommon529 B

API Surface (0)

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

String literals (1)

"A container user must be a LivingEntity"

Code Graph: Dependencies (3)

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

Full Source

ContainerUser.java19 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.world.level.block.entity.ContainerOpenersCounter;
5
6
public interface ContainerUser {
7
	boolean hasContainerOpen(final ContainerOpenersCounter container, final BlockPos blockPos);
8
9
	double getContainerInteractionRange();
10
11
	default LivingEntity getLivingEntity() {
12
		if (this instanceof LivingEntity livingEntity) {
13
			return livingEntity;
14
		} else {
15
			throw new IllegalStateException("A container user must be a LivingEntity");
16
		}
17
	}
18
}
19

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