ssbbpeople Posted July 21, 2019 Posted July 21, 2019 Hi, I have a block that has a Custom Gui, but every time I right-click the block it won't appear. I know that the TileEntities are working because I wrote a debug line that "checks" if it's working. This is the error that's shown in the console when I right-click: [06:37:34] [Server thread/FATAL] [minecraft/MinecraftServer]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException This is the onBlockActivated boolean in my Block: //BLOCK RIGHT-CLICKED (Opens GUI and Debug) @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { //Sends a message in chat stating "Grinder Clicked" player.sendMessage(new TextComponentString("Grinder Clicked")); //Opens GUI player.openGui(Main.instance, ModGuiHandler.GRINDER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; } I've also tried putting player.openGui outside of the if function, but that results in a crash. The ModGuiHandler is registered correctly as well, for NetworkRegistry.INSTANCE. Additional Info: I followed ShadowFacts tutorial for onBlockActivated Any help is appreciated, thank you. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.