Interface ScreenHandlerFactory

All Known Subinterfaces:
NamedScreenHandlerFactory, VehicleInventory
All Known Implementing Classes:
AbstractChestBoatEntity, AbstractFurnaceBlockEntity, BarrelBlockEntity, BeaconBlockEntity, BlastFurnaceBlockEntity, BrewingStandBlockEntity, ChestBlockEntity, ChestBoatEntity, ChestMinecartEntity, ChestRaftEntity, CrafterBlockEntity, DispenserBlockEntity, DropperBlockEntity, FurnaceBlockEntity, HopperBlockEntity, HopperMinecartEntity, LecternBlockEntity, LockableContainerBlockEntity, LootableContainerBlockEntity, ShulkerBoxBlockEntity, SimpleNamedScreenHandlerFactory, SmokerBlockEntity, StorageMinecartEntity, TrappedChestBlockEntity
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ScreenHandlerFactory
A functional interface to create a new screen handler (menu) on the server.

This interface itself is not used directly. Instead, the subinterface NamedScreenHandlerFactory is passed to PlayerEntity.openHandledScreen(net.minecraft.screen.NamedScreenHandlerFactory). In vanilla, block entity instances implement that interface, allowing them to be passed. SimpleNamedScreenHandlerFactory is a screen handler factory implementation for use cases that do not involve a block entity.

The factory should create a new instance of a screen handler with the server-side constructor (one that takes inventories, etc). If the screen handler requires a property delegate or a context, create an instance and pass it here.

See Also:
Mappings:
Namespace Name
named net/minecraft/screen/ScreenHandlerFactory
intermediary net/minecraft/class_1270
official cuj
  • Method Details

    • createMenu

      @Nullable @Nullable ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      named createMenu Lnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;
      intermediary createMenu Lnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;
      official createMenu Lcuj;createMenu(ILcpv;Lcpw;)Lctb;