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.

StretchFre

Members
  • Joined

  • Last visited

Everything posted by StretchFre

  1. Thank you. I will start working on it.
  2. I am trying to add and remove from loot tables.
  3. I have been getting into modding recently and have no idea how to even get started adding items to loot tables. I might be able to figure out how to make one, but when it comes to simply removing or adding to them in my mod i cannot seem to figure it out. Does anybody have any forbidden loot table knowledge they could share with me?
  4. Thanks... But how do i make it so getHeldItem() is not null?
  5. Okay, thanks for attempting to help. What i do not understand is i did exactly what you said to do(without the chat thing) but it crashes still. here is my code: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int coords, float one, float two, float three) { if(player.getHeldItem().getItem() != null) { if(player.getHeldItem().getItem() == MyMod.olKey) { world.setBlock(x, y, z, Blocks.air); player.inventory.consumeInventoryItem(MyMod.olKey); } else { System.out.println("Are you trying to unlock it with THAT?"); } } else { System.out.println("Stpo trying to pry it open"); } return super.onBlockActivated(world, x, y, z, player, coords, one, two, three); }
  6. Okay. Now i got a different problem...i tried fixing it a bit, but it still crashes when i right click with nothing in my hand... @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int coords, float one, float two, float three) { Item item = player.getCurrentEquippedItem().getItem(); if(player.getHeldItem() != null) { if(item == MyMod.olKey) { world.setBlock(x, y, z, Blocks.air); player.inventory.consumeInventoryItem(MyMod.olKey); System.out.println("Old Dungeon unlocked"); } else { System.out.println("Are you trying to unlock it with THAT?"); } } else { System.out.println("Stpo trying to pry it open"); } return super.onBlockActivated(world, x, y, z, player, coords, one, two, three); }
  7. Sorry... i am using eclipse, and i have no idea how to override automatically with it. How do i do this? I tried adding @Override annotation to it(above it) and it did not work, giving me a error. I have no idea how to fix it. Please do not get angry, i am a beginner and have no idea how to @Override, eventhough i know most of the basics. EDIT: OKay.... wow. Yeah your right it was WAY too simple. Sorry to waste your time.
  8. Hello. Nothing happens when i try to use this code i entered into my mod's block class file: public boolean onBlockActivated(Block block, World world, EntityPlayer player, Item item, ItemStack itemstack, int x, int y, int z) { if(player.inventory.getCurrentItem().getItem() == Items.bone) { world.setBlock(x, y, z, Blocks.air); System.out.println("rightclick worked"); return true; } return true; } nothing happens. What am i doing wrong? (also, my block file extends Block)

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.