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

Let's say that I have two custom enchantments for the same item. I made a custom ItemSword that let's you shoot fireballs when you right click, and I made two enchantments that modify that fireball. What I want is to make these two enchantments incompatible with each other. An example would be me putting one enchantment on my sword. Then, when I go on an anvil, I would not be able to apply the other enchantment unless the first enchantment was gone. I would also like this to work vice versa. My enchantments both extend Enchantment. I tried overriding Enchantment#isCompatibleWith() but it's a final method. Therefore, how would I be able to make two custom enchantments incompatible with each other?

  • Author
19 minutes ago, diesieben07 said:

canApplyTogether is the method you need to override. isCompatibleWith is what needs to be called, as it checks "both sides" (look at the code, its obvious).

Thank you so much! I don't know how but I could not find the method canApplyTogether using Eclipse (That square thing that pops up when you type something and shows you classes and methods) but I guess it does exist because I was able to override it and it worked.

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.