Class EntityMenu<T extends net.minecraft.world.entity.Entity>

java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu

public abstract class EntityMenu<T extends net.minecraft.world.entity.Entity> extends DefaultMenu
A DefaultMenu for entities.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final T
     

    Fields inherited from class org.moddingx.libx.menu.DefaultMenu

    firstInventorySlot, firstOutputSlot, level, player

    Fields inherited from class org.moddingx.libx.menu.MenuBase

    playerInventory

    Fields inherited from class net.minecraft.world.inventory.AbstractContainerMenu

    CARRIED_SLOT_SIZE, containerId, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityMenu(net.minecraft.world.inventory.MenuType<?> type, int windowId, net.minecraft.world.level.Level level, int entityId, net.minecraft.world.entity.player.Inventory playerContainer, net.minecraft.world.entity.player.Player player, int firstOutputSlot, int firstInventorySlot)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends net.minecraft.world.inventory.AbstractContainerMenu>
    net.minecraft.world.inventory.MenuType<T>
    createMenuType(com.mojang.datafixers.util.Function5<Integer,net.minecraft.world.level.Level,Integer,net.minecraft.world.entity.player.Inventory,net.minecraft.world.entity.player.Player,T> constructor)
    Creates a container type for an EntityMenu.
    static <T extends net.minecraft.world.inventory.AbstractContainerMenu>
    net.minecraft.world.inventory.MenuType<T>
    createMenuType(Function6<net.minecraft.world.inventory.MenuType<T>,Integer,net.minecraft.world.level.Level,Integer,net.minecraft.world.entity.player.Inventory,net.minecraft.world.entity.player.Player,T> constructor)
    Creates a menu type for an EntityMenu.
     
    static void
    openMenu(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.inventory.MenuType<? extends BlockEntityMenu<?>> menu, net.minecraft.network.chat.Component title, net.minecraft.world.entity.Entity entity)
    Opens an EntityMenu for a player.
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class org.moddingx.libx.menu.DefaultMenu

    getLevel, quickMoveStack

    Methods inherited from class org.moddingx.libx.menu.MenuBase

    addSlotBox, addSlotBox, addSlotRange, addSlotRange, layoutPlayerInventorySlots, moveItemStackTo

    Methods inherited from class net.minecraft.world.inventory.AbstractContainerMenu

    addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clicked, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removed, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • entity

      public final T extends net.minecraft.world.entity.Entity entity
  • Constructor Details

    • EntityMenu

      public EntityMenu(@Nullable net.minecraft.world.inventory.MenuType<?> type, int windowId, net.minecraft.world.level.Level level, int entityId, net.minecraft.world.entity.player.Inventory playerContainer, net.minecraft.world.entity.player.Player player, int firstOutputSlot, int firstInventorySlot)
  • Method Details

    • stillValid

      public boolean stillValid(@Nonnull net.minecraft.world.entity.player.Player player)
      Specified by:
      stillValid in class net.minecraft.world.inventory.AbstractContainerMenu
    • getEntity

      public T getEntity()
    • createMenuType

      public static <T extends net.minecraft.world.inventory.AbstractContainerMenu> net.minecraft.world.inventory.MenuType<T> createMenuType(com.mojang.datafixers.util.Function5<Integer,net.minecraft.world.level.Level,Integer,net.minecraft.world.entity.player.Inventory,net.minecraft.world.entity.player.Player,T> constructor)
      Creates a container type for an EntityMenu.
      Parameters:
      constructor - A method reference to the menus' constructor.
    • createMenuType

      public static <T extends net.minecraft.world.inventory.AbstractContainerMenu> net.minecraft.world.inventory.MenuType<T> createMenuType(Function6<net.minecraft.world.inventory.MenuType<T>,Integer,net.minecraft.world.level.Level,Integer,net.minecraft.world.entity.player.Inventory,net.minecraft.world.entity.player.Player,T> constructor)
      Creates a menu type for an EntityMenu.
      Parameters:
      constructor - A method reference to the menus' constructor.
    • openMenu

      public static void openMenu(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.inventory.MenuType<? extends BlockEntityMenu<?>> menu, net.minecraft.network.chat.Component title, net.minecraft.world.entity.Entity entity)
      Opens an EntityMenu for a player.