Interface IContainerButtonClickAcceptorServer<C extends net.minecraft.world.inventory.AbstractContainerMenu>
- All Known Implementing Classes:
ContainerExtended
,ContainerInfoBookTest
,InventoryContainer
,ItemInventoryContainer
,ScrollingInventoryContainer
public interface IContainerButtonClickAcceptorServer<C extends net.minecraft.world.inventory.AbstractContainerMenu>
A container button click acceptor.
Events will be received both server-side and client-side.
This will only work if the client-side button's pressable has been generated with
ContainerScreenExtended.createServerPressable(String, Button.OnPress)
}.-
Method Summary
Modifier and TypeMethodDescriptionboolean
onButtonClick
(String buttonId) When the button is clicked, both server and client side.void
putButtonAction
(String buttonId, IContainerButtonAction<C> action) Set a button action.
-
Method Details
-
putButtonAction
Set a button action. The used button id should correspond to id that was used to create the button's pressable in the gui.- Parameters:
buttonId
- The button id.action
- The action to set for the given button id.
-
onButtonClick
When the button is clicked, both server and client side.- Parameters:
buttonId
- The button id.- Returns:
- If an action was found and executed.
-