Jump to content

ShowerManiac

Members
  • Posts

    8
  • Joined

  • Last visited

ShowerManiac's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I tried this TileEntityTestBlock te = (TileEntityTestBlock) world.getTileEntity(pos); te.setValue(val); What is the correct way?
  2. 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
  3. there is protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {VALUE, FACING, TYPE}); }
  4. 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
  5. Now when I try to place a block it crashes. Log
  6. 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
  7. Great. Thank you :3
  8. 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()); } } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.