GameMasterBlockItem .java

net.minecraft.world.item.GameMasterBlockItem (class, 20 lines): extends BlockItem. members: getPlacementState. imports: BlockPlaceContext.

net.minecraft.world.itemclass20 linescommonextends BlockItem700 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

GameMasterBlockItem.java20 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item;
2
3
import net.minecraft.world.entity.player.Player;
4
import net.minecraft.world.item.context.BlockPlaceContext;
5
import net.minecraft.world.level.block.Block;
6
import net.minecraft.world.level.block.state.BlockState;
7
import org.jspecify.annotations.Nullable;
8
9
public class GameMasterBlockItem extends BlockItem {
10
	public GameMasterBlockItem(final Block block, final Item.Properties properties) {
11
		super(block, properties);
12
	}
13
14
	@Override
15
	protected @Nullable BlockState getPlacementState(final BlockPlaceContext context) {
16
		Player player = context.getPlayer();
17
		return player != null && !player.canUseGameMasterBlocks() ? null : super.getPlacementState(context);
18
	}
19
}
20

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