procedure error for opening GUI

Started by TheMeowyCat90 on

Topic category: Help with modding (Java Edition)

Last seen on 00:38, 9. May 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
procedure error for opening GUI

i have a procedure error for opening GUI here is the code: 
public class CatMenuKeyOnKeyPressedProcedure { 
    public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) { 
        if (entity == null) 
            return; 
        { 
            if (entity instanceof ServerPlayer _ent) { 
                BlockPos _bpos = new BlockPos(x, y, z); 
                NetworkHooks.openGui((ServerPlayer) _ent, new MenuProvider() { 
                    @Override 
                    public Component getDisplayName() { 
                        return new TextComponent("CatMenu"); 
                    } 

                    @Override 
                    public AbstractContainerMenu createMenu(int id, Inventory inventory, Player player) { 
                        return new MatMenuMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(_bpos)); 
                    } 
                }, _bpos); 
            } 
        } 
    } 
}