Posted August 14, 20187 yr 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?
August 14, 20187 yr 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.
August 14, 20187 yr 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.
August 14, 20187 yr 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.
August 14, 20187 yr 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.
August 14, 20187 yr 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.
August 14, 20187 yr 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 August 14, 20187 yr by Nasch
August 14, 20187 yr 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.
August 14, 20187 yr 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.