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.

DiabolusNeil

Members
  • Joined

  • Last visited

  1. Okay. I've tried everything, and I cannot figure out what I'm doing wrong. This seems like the only help there is on this subject: http://pastebin.com/SnPaAvUd, and it doesn't work. Instead of the item being damaged, it gets used up. This is my code that I'm working with: // My item class. public class ItemKnifeBase extends Item { public ItemKnifeBase(ToolMaterial material) { this.setCreativeTab(ToolForgeryMod.tabToolForgery); this.setUnlocalizedName(ToolForgeryMod.MOD_ID + ":knife_" + material.toString().toLowerCase()); this.setTextureName(ToolForgeryMod.RESOURCES_PREFIX + "knife_" + material.toString().toLowerCase()); this.setMaxDamage(material.getMaxUses()); } @Override public ItemStack getContainerItem(ItemStack itemStack) { ItemStack result = itemStack.copy(); result.setItemDamage(result.getItemDamage() + 1); result.stackSize = 1; return result; } @Override public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) { return false; } } // Registering the crafting recipe in the preInit() method. GameRegistry.addShapelessRecipe(new ItemStack(Blocks.planks, 4, 0), new ItemStack(Blocks.log, 1, 0), new ItemStack(TFItems.knife_stone, 1, OreDictionary.WILDCARD_VALUE)); To clarify, the recipe shows up, and I can use it, but instead of damaging the knife, the knife gets used up. And I'm registering the item before the recipe. SOLUTION: You need to add @Override public boolean hasContainerItem() { return true; } to the item's class.
  2. I also have the same problem. Should we submit it as a bug?
  3. I presume you're trying to do a lot of specific comparisons. You could do this: return (testEntity instanceof EntityZombie || testEntity instanceof EntitySkeleton || testEntity instanceof EntityCreeper); To make the code easier to read, but no, there isn't an easier way to do what you're already doing.
  4. If the mod's not open source, then the mod author(s) don't want you to deobfuscate it.
  5. I suggest you learn more about Java and modding before you tackle something so complex as this.
  6. You need an updated version of Damage Indicators or a downgraded Forge workspace.
  7. Pahimar's open source mod, Equivalent Exchange 3, shows the proper way to to packet handling: https://github.com/pahimar/Equivalent-Exchange-3/tree/master/src/main/java/com/pahimar/ee3/network
  8. Figure out where you have the Minecraft directory used by your Eclipse workspace, and put your wanted mods in the "mods" folder.
  9. Reading the error message would help you. It tells you exactly what the exception is.
  10. Java and JavaScript are two different programming languages. JavaScript is a scripting language used for websites.
  11. This is the code I'm working with: http://pastebin.com/aEAswtBR and I've come across a big problem. Trying to break the block from the block object gathered from world.getBlock() doesn't do anything. Even doing world.getBlockToAir() doesn't do anything. I even tried using a packet handler because I thought the event was only being called client-side only (which it wasn't). Is it a Forge bug? EDIT: It seems that Block.breakBlock() is only for special purposes (i.e. dumping out the contents of an inventory, removing a tile entity, etc) and is not meant for actually breaking a block. What wesserboy said, you need to do something like this: private void breakBlock(World world, int x, int y, int z){ if(world.getBlock(x, y, z) != Blocks.bedrock){ world.getBlock(x, y, z).dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); world.setBlockToAir(x, y, z); } }
  12. If you want to do packet handling yourself, check out the source code of Pahimar's EE3: https://github.com/pahimar/Equivalent-Exchange-3/tree/master/src/main/java/com/pahimar/ee3/network
  13. As I'm sure it can be quite annoying to be pestered with small problems such as this, but what's the point in just writing that? Dude, as this may seem like I'm not putting any "effort" I've done my best effort to learn as I go along. May you please reply with a little bit more help - I'm not asking for someone to write this for me, only to point me in a direction of which I can learn. Small problem? If you don't know Java, then modding is going to be much much harder. Knowing Java is not an option, it is a REQUIREMENT. Learn from Vswe's tutorials:
  14. Look at the Minecraft source code (possibly under the net.minecraft.client.gui package) and see how they do it.
  15. Minalien made a great tutorial for using Scala and the IntelliJ IDEA IDE: http://minalien.com/tutorial-setting-up-forgegradle-for-intellij-idea-scala/

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.