Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ShowerManiac

Members
  • Joined

  • Last visited

Everything posted by ShowerManiac

  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. 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()); } } } }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.