-
[1.12.2] Storing properties in TileEntity
I tried this TileEntityTestBlock te = (TileEntityTestBlock) world.getTileEntity(pos); te.setValue(val); What is the correct way?
-
[1.12.2] Storing properties in TileEntity
Okay. That actually was the problem. It works now. One more question. Do I update/set the block state with regular world.setBlockState(pos, world.getBlockState(pos).withProperty(VALUE, Integer.valueOf(4)), 2); Or do I do it somehow different? because this is happening (values should be the same as Val in the console) Image
-
[1.12.2] Storing properties in TileEntity
there is protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {VALUE, FACING, TYPE}); }
-
[1.12.2] Storing properties in TileEntity
How can it be null if the block has a default state? I surrounded writeNBT with a try/catch block. Not a difference crash log
-
[1.12.2] Storing properties in TileEntity
Now when I try to place a block it crashes. Log
-
[1.12.2] Storing properties in TileEntity
Hello again! I've been messing around with block properties. I wanted to create a block with multiple properties so I've created a TileEntity for that block. Code \/ Everything compiles and runs ok, Even placing the block works, but whenever I F3 or destroy the block it crashes by throwing and IllegalArgumentException that It cannot set property. What am I doing wrong here? I am new with tile entities so I am probably making some mistakes
-
[1.12.2] Right click Donkey event
Great. Thank you :3
-
[1.12.2] Right click Donkey event
Hello forum members! I am creating an event that triggers when you right click on a donkey. The code works for every mob but horses, mules and donkeys because you "feed" them by right clicking. How do I cancel that? Code @SubscribeEvent public void itemEvent(PlayerInteractEvent.RightClickItem event) { if(event.getEntityPlayer() != null) { if(event.getEntityPlayer().getActiveItemStack() != null) { try { EntityPlayer player = event.getEntityPlayer(); World world = event.getEntity().world; Entity entity = Minecraft.getMinecraft().objectMouseOver.entityHit; ItemStack itemstack = player.getHeldItem(event.getHand()); Item item = itemstack.getItem(); if (item == Items.STICK && entity instanceof EntityDonkey) { System.out.println("works") } } catch(NullPointerException | IllegalArgumentException ex) { System.out.println("Exception: "+ex.getMessage()); } } } }
IPS spam blocked by CleanTalk.