Posted June 26, 20196 yr Minecraft version: 1.12.2 Forge version: 1.12.2-14.23.5.2824 Java version: Version 8 Update 211 (build 1.8.0_211-b12) When there was IInventory and ISidedInventory, inventory names were simple to use (getInventoryName, hasCustomInventoryName), but now there are capabilities and they don't have anything like inventory name. How Am I supposed to change name of inventory of TileEntity in GuiContainer ? I want to display in GUI the name of block renamed in anvil. I know how to save it in NBT, I just want to know if there is some way to retrieve it. Edited June 26, 20196 yr by Dipo
June 26, 20196 yr Author I know how to tell client about change, but i mean how to retrieve the name of it on the server side. I want to do exactly what is in chest. When u rename chest block in anvil and place it, then open it, the name of the item chest is shown above the inventory. But I don't know how to "move" the name of the ItemStack to the tileentity. But I've figured it out by overriding onBlockPlacedBy in my block class: @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { TileEntity atm = world.getTileEntity(pos); if (atm instanceof TileEntityATM) ((TileEntityATM) atm).setCustomName(stack.getDisplayName()); } But thanks anyway Edited June 26, 20196 yr by Dipo
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.