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.

AdamRobero

Members
  • Joined

  • Last visited

  1. Hi all! So last night, I received some help on another forum creating an auto-smelt enchantment. What currently happens with the enchantment is that if you mine a block with a smelting recipe, it'll only drop the smelted result. However, this only works the first time you use the enchantment on a block. What I mean is that if you mine a block of Gold Ore with auto-smelt, it'll drop a Gold Ingot. Then you could go and mine an Iron Ore and it would drop an Iron Ingot. If you were to then mine Gold Ore again, nothing would be dropped at all. Here is the event code (apologies, couldn't get the code button to work): package SkyeStark.Rhencraft.main; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.event.world.BlockEvent; import scala.actors.threadpool.Arrays; public class AutoSmelt { int j = 0; int i; @SubscribeEvent public void onHarvestDrops(BlockEvent.HarvestDropsEvent event) { System.out.println(event.drops); System.out.println("Event has started"); if(event.harvester != null){ System.out.println("Harvester exists"); ItemStack heldItem = event.harvester.inventory.getCurrentItem(); if (heldItem != null && heldItem.getItem() == MainClass.toolRheniumPickaxe) { System.out.println("Found Pickaxe"); int enchantmentLevel = EnchantmentHelper.getEnchantmentLevel(MainClass.autoSmelt.effectId, heldItem); if (enchantmentLevel > 0 && event.harvester.inventory.hasItem(Items.coal)) { System.out.println("Level is more than 0"); ItemStack smelted = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(event.block).copy()); if (smelted != null) { System.out.println("" + smelted + " will be added to the drops"); event.drops.clear(); j = j + 1; if(j >= { j = 0; event.harvester.inventory.consumeInventoryItem(Items.coal); } System.out.println("J is equal to " + j); event.drops.add(smelted); } } } } } } There is no reason why the smelted item should not be dropped, is there?

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.