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