Nekromantcer Posted September 6, 2019 Posted September 6, 2019 Hi guys. How can I change the text of the sign. It is necessary to create an auto farm issuing objects with RMB on the sign. I tried to use new TesctComponentsString but it do nothing. @SubscribeEvent public void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { if (event.getWorld().isRemote) { return; } TileEntity te = event.getEntityPlayer().world.getTileEntity(event.getPos()); if (te != null && te instanceof TileEntitySign) { ITextComponent[] signText = ((TileEntitySign) te).signText; System.out.println(signText[1].getUnformattedText()); System.out.println(signText[0].getUnformattedText()); System.out.println("test"+signText[1].getUnformattedText()); String ln1 = signText[0].getUnformattedText(); TileEntitySign t1 = (TileEntitySign) te; t1.signText[0] = new TextComponentString("ffff"); if (ln1.equals("444")) {System.out.println("Totototoot");} } } Quote
Nekromantcer Posted September 6, 2019 Author Posted September 6, 2019 Thank you! It works for me! 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.