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

Everything posted by DiabolusNeil

  1. No, he's saying that you need to load the configuration file, then register the items. You're doing it the other way around.
  2. All I know about accessing inventories is right-clicking on a block and it creating a new tile entity. How would I do this with an item?
  3. Modding for 1.6.4 doesn't use the ForgeGradle system. Anyways, for good tutorials, check out Vswe's series.
  4. The report says what the error is, you're trying to call part of an array that doesn't exist. Plus, since I don't see any code, we can't help you.
  5. I've heard of it, but I don't quite know what it is and how to use it. Could someone enlighten me on the subject?
  6. Title explains it. I want to get the path of the Minecraft directory the client is currently running on. I've looked into a few of the Forge classes, but I couldn't find anything.
  7. I don't think there is. You may have to create your own.
  8. public boolean hasEffect() { return true; }
  9. I haven't messed around with 1.7 yet, but I suggest giving the block it's own ItemBlock, and using the addInformation() method to that.
  10. Here's an example pulled from my mod. import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; public class WorldGenHandler implements IWorldGenerator { public WorldGenerator myCustomOre; public WorldGenHandler() { GameRegistry.registerWorldGenerator(this); myCustomOre = new WorldGenMinable(2048, 7); // 2048 = Block Id, 7 = Maximum number of ores per cluster } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { generateOre(random, chunkX, chunkZ, world, 8, myCustomOre, 0, 63); // 8 = Number of clusters it tries to generate per chunk } private void generateOre(Random rand, int chunkX, int chunkZ, World world, int iterations, WorldGenerator gen, int lowestY, int highestY) { for (int i = 0; i < iterations; i++) { int x = chunkX * 16; int y = rand.nextInt(highestY - lowestY) + lowestY; int z = chunkZ * 16; gen.generate(world, rand, x, y, z); } } } And inside your mod class, make a new WorldGenHandler object. @EventHandler public void init(FMLInitializationEvent event) { new WorldGenHandler(); } Make sure to import everything correctly. (Eclipse: CTRL+SHIFT+O (Mac: SHIFT+CMD+O))
  11. No code, no help.
  12. Thanks Draco, but I actually just figured out how to get the enchantments. This is what I used to test. ItemStack item = player.inventory.getCurrentItem(); if (item != null) { NBTTagList enchants = item.stackTagCompound.getTagList("ench"); boolean hasSilkTouch = false; for (int i = 0; i < enchants.tagCount(); i++) { if (((NBTTagCompound) enchants.tagAt(i)).getShort("id") == 33) { hasSilkTouch = true; break; } } System.out.println(hasSilkTouch); } I looked at the Enchanted Book code.
  13. Thanks for the advice, but I still don't know how to get the enchantments of an item.
  14. Hello. I've tried experimenting with this for a while, and what I'm trying to do doesn't work. private static ItemStack currentItem = FMLClientHandler.instance().getClient().thePlayer.inventory.getCurrentItem(); public static boolean doesPlayerHaveSilkTouch = currentItem != null && currentItem.isItemEnchanted() && currentItem.getEnchantmentTagList().getId() == 33; I print to the console this in my onBlockDestroyedByPlayer() method, and it results to false, even if my item does have Silk Touch on it. Is there a better way to detect enchantments?
  15. I'm facedesking myself right now. I didn't have a proper ID for the Gold-Emerald ore. Now everything works. Everyone makes mistakes, I guess.
  16. I did call the code. It just randomly stopped working. I'll explain a bit more: I was registering blocks, same as always, it was working perfectly fine. I added two more blocks, I then started to get the error. I then commented out the lines of code where I registered the two new blocks. Same thing happens. It might be my system. I'll test later.
  17. I already stated that I was doing the old method earlier, and didn't have any problems. Now when I try and do the exact same thing that I was doing hours ago, I get that error. Look at the coding timelapse, you'll see.
  18. Okay then. Here's the code registering the blocks, which is being called in the mod class. The code inside BlockCompoundOre. Code from BlockIronCoalOre
  19. This is starting to get really annoying. I'm working on my mod which adds custom blocks, and after launching the game for about the 100th time, every time I try and enter a world (new or old) I keep getting this error message. The error message ends after that. I'm just trying to do a normal GameRegistery.registerBlock(), I'm using a Mac OSX 1.6.8, Eclipse SDK with Java 6 for the decompiler, and Forge 9.11.1.965. Commenting out the register method ends up in Minecraft launching just fine. If you need me to post the code, I will do so. I actually did a coding timelapse a few hours before I had this issue arise. I will post it so you can see that I wasn't having this problem earlier: http://www.youtube.com/watch?v=35FQ9a_QADA
  20. Something like a custom furnace, which I could expand upon. The only updated tutorial I could find was ScratchForFun's videos, but he presents the tutorials so slowly and poorly, to the point that the series is almost unwatchable. Is there any other tutorial for this?
  21. "Goes to Minecraft Forge Forums for help with crashing mod, doesn't read crash report, problem was a common Java error that can be fixed in 5 seconds."
  22. I don't think he knows how to actually make a GUI.

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.