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.

Featured Replies

Posted

Hi I made an enchantment for hoe that's called replant that looks for IPlantable in the drop of a block and tries to plant it on a farmland under. The enchantment works but there are a couple of things I can't figure out.

 

 

- The registry name and the name of my enchantment is set to replant, but the in game ID is "enchantment.replant" I supposed I could fix that in a language file like through "enchantment.replant.name=Replant" but it doesn't work, so were do I change that or what syntax did I do wrong?

 

- I get a book in the creativemode inventory but I can't find it in any tab but have to search for it to find it. So how can I specify the tab to be in the tools tab? Also there is a blue text saying Combat or Tools in the info for vanilla enchantment books in creative. How do you add that to be Tools for my replant enchantment?

 

- I can't enchant the hoe through the enchantment table, only by anvil and book. Where do I add such properties? Also can I add so the hoe can be enchanted with unbreaking through enchantment table aswell?

 

 

 

  • Author

Name fixed but enchanting table not working.

 

In relevans to the creative tab I made a new EnumEnchantmentType that is only for hoes so I don't want to set it to Digger. I just want the tab property for my new enchantmentType. I tries using the EnumEnchantmentType.DIGGER which fixed the book and then I did this in my enchantment:

 

    public boolean canApplyAtEnchantingTable(ItemStack stack)

    {

        return stack.getItem() instanceof ItemHoe;

    }

 

and the sam for canApply. However it appears that whatever I do every tool and weapon can be enchanted with replant.

 

 

What I meant with the unbreaking was that hoes can only be enchanted with unbreaking through books. But I want the hoes to be enchanted through enchantment tables as well. But now I see that in EnchantmentDurability there it uses its super class canApplyAtEnchantingTable which narrows down to see if the item is BREAKABLE which a hoe is so now I don't see why you can't enchant the hoe with unbreaking and perhaps the hoe is unenchantable and that is why enchanting table isn't working for me.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.