Jump to content

Recommended Posts

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?

 

 

 

Posted

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.