I have this which calls my beacon GUI, which just adds a bunch of buttons on the side. All those buttons do is change an int.
@Inject(method = "displayGUIChest", at = @At("HEAD"), cancellable = true)
public void onDisplayGUIChest(IInventory chestInventory, CallbackInfo ci) {
if (ModuleManager.getModuleByName("BeaconSelector").isEnabled()) {
if (chestInventory instanceof IInteractionObject) {
if ("minecraft:beacon".equals(((IInteractionObject)chestInventory).getGuiID())) {
Minecraft.getMinecraft().displayGuiScreen(new BeaconGui(this.inventory, chestInventory));
ci.cancel();
}
}
}
}
In the class it changes the int I have a listener changing some packet bytes.