Interface ScreenHandlerFactory

All Known Subinterfaces:
NamedScreenHandlerFactory, VehicleInventory
All Known Implementing Classes:
AbstractFurnaceBlockEntity, BarrelBlockEntity, BeaconBlockEntity, BlastFurnaceBlockEntity, BrewingStandBlockEntity, ChestBlockEntity, ChestBoatEntity, ChestMinecartEntity, 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
official cjh
intermediary net/minecraft/class_1270
named net/minecraft/screen/ScreenHandlerFactory
  • Method Details

    • createMenu

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