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

I was wondering how I would go about adding mechanics to a currently existing enchantment. I am trying to add functionality to the curse of binding in this case, so I figure I would have to make a class that extends from this enchantment right?

That's not how extending a class works.

Depending on what, exactly, you want to do, there are a number of ways to achieve it. You just have to tell us what you want to do.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Thanks for the response. The idea was to make it so an armor piece with the curse of binding enchantment would automatically equip to the player if it is in your inventory.

27 minutes ago, Nasch said:

Thanks for the response. The idea was to make it so an armor piece with the curse of binding enchantment would automatically equip to the player if it is in your inventory.

If you want it to be forced to stay equipped you would have to use the PlayerTickEvent and iterate through there inventory and upon finding one move it to the armor slot, but only if there already isn't one. And watch out for concurrent modification exceptions. 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
7 minutes ago, Animefan8888 said:

If you want it to be forced to stay equipped you would have to use the PlayerTickEvent and iterate through there inventory and upon finding one move it to the armor slot, but only if there already isn't one. And watch out for concurrent modification exceptions. 

Greatly appreciated. Just wondering how I would establish the connection between the existing enchantment and the mechanics I want to add though. 

28 minutes ago, Nasch said:

Greatly appreciated. Just wondering how I would establish the connection between the existing enchantment and the mechanics I want to add though. 

Check if any of the Items in the players inventory as you iterate to see if they have the enchantment on them.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
5 minutes ago, Animefan8888 said:

Check if any of the Items in the players inventory as you iterate to see if they have the enchantment on them.

Oh, I got ya. I guess I was just overthinking how to do things. Thanks.

 

So, in general, I just need to make a new class that holds the functionality I want for the enchantment and register the event?

Edited by Nasch

24 minutes ago, Nasch said:

So, in general, I just need to make a new class that holds the functionality I want for the enchantment and register the event?

Yes. That should be it.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
2 minutes ago, Animefan8888 said:

Yes. That should be it.

Greatly appreciated. Thanks for the help.

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.