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

Hey all, I'm trying to make an item that basically acts like an infinite source of lapis lazuli. You can use it to dye wool/sheep without consuming the item. However, there seems to be one problem.

 

Because the vanilla enchantment table uses lapis to enchant items since 1.8, you can use this item that cannot be consumed to enchant items. The problem is, the item is consumed when you enchant, as lapis normally is.

 

I've tried to see if there's some sort of event for enchanting items in the table, and there isn't. I can't find any possible method to make it so the enchant table doesn't consume my item. I've done several searches, and I guess I'm the only one that's tried this (given, it's a pretty specific problem).

 

Do you guys have any ideas on what I could do to solve this? Thanks for your time.

  • Author

Alright, I tried this out. It looks like it had some effect on the inventory, the only problem being that the enchantment table itself ceases to function. It acts like the item in the enchanting slot is already enchanted, no options to enchant or anything, even with vanilla lapis in the table.

 

Here's the code in the inventory class for getting the stack (where lapisGem is my item):

 

    @Override
    public ItemStack getStackInSlot(int index) {
        ItemStack stack = iInventory.getStackInSlot(index);
        if (stack.getItem().equals(RegisterItems.lapisGem)){
            stack = new ItemStack(Items.dye,64,4);
        }
        return stack;
    }

 

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.