Interface FabricMenuProvider

All Known Subinterfaces:
ExtendedMenuProvider<D>, net.minecraft.world.MenuProvider

public interface FabricMenuProvider
An extension to MenuProvider. Unlike ExtendedMenuProvider, this can be used by any menus, and is implemented via interface injection.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns whether the server should send ClientboundContainerClosePacket when opening the screen.
  • Method Details

    • shouldCloseCurrentScreen

      default boolean shouldCloseCurrentScreen()
      Returns whether the server should send ClientboundContainerClosePacket when opening the screen.

      In vanilla, opening a new screen will always send the close screen packet. This, among other things, causes the mouse cursor to move to the center of the screen, which might not be expected in some cases. If this returns false, the packet is not sent to the client, stopping the behavior.

      Returns:
      whether the server should send ClientboundContainerClosePacket when opening the screen