Posted January 12, 20214 yr here i want to player can open a gui only by clicking on the mob with same name but the gui only open for host player. What i did wrong? public ActionResultType func_230254_b_(PlayerEntity playerEntity, Hand hand) { if (!this.world.isRemote) { String en = this.getCustomName().getString(); String pl = playerEntity.getScoreboardName(); if(en.equals(pl)) { MobScreen.open(); } else playerEntity.sendMessage(new TranslationTextComponent("You are not "+en),Util.DUMMY_UUID); } return ActionResultType.func_233537_a_(this.world.isRemote); }
January 12, 20214 yr Author public static void open() { Minecraft.getInstance().displayGuiScreen(new MobScreen()); }
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.