Jump to content

[1.15.2] Gems, Enchanted Gems and Weights


Cryotron

Recommended Posts

Salutations!

 

I have made a big leap progress towards my mod by adding a capability to add socket slots into items. It was pretty satisfying after weeks of deciphering packet networking and capabilities. Then I was left with options: to enchant a gem and then add the enchantments into the socketed item (making "Sharpness X" possible) or to make the gem give static bonuses based on the type of item that the gem is socketed in. I've talked to my close ones for more insight and one of them explicitly expressed the importance of enchantment of my mod. While the latter sounds more feasible but removing depths from the mod, the former has left me thinking with a question: Is there such a thing as an enchantment event where the color of the gems adds the weight of the certain enchantments?

 

Like an example would be: just like adding the book to the enchanting table and selecting an enchantment stores it into the book and transforms it into the enchanted book; is it through an Enchantment Event that a gem would be turned into an enchanted gem with the given different weights of each enchantment depending the color of the gem?

 

TL;DR Is Enchantment Event a thing? Probably... Just not that what I was expecting given that each enchantment has different weights on their respective class files rather than the Event class itself.

Link to comment
Share on other sites

I'm not aware of any event that allows you to change the weights of enchantments, although you can use the following method in your Item class to restrict the types of enchants that can be applied:

public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment){}

 

It is called every time an ItemStack of that Item is enchanted, so you could in theory add some randomization elements, though you might need to do some server-client syncing.

Link to comment
Share on other sites

5 hours ago, Azaka7 said:

I'm not aware of any event that allows you to change the weights of enchantments, although you can use the following method in your Item class to restrict the types of enchants that can be applied:


public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment){}

 

It is called every time an ItemStack of that Item is enchanted, so you could in theory add some randomization elements, though you might need to do some server-client syncing.

See, one of my other close friend of mine have done this and restricted the types of enchants that can be applied on a gem. That was not our intent, our intent was the usage of gems can manipulate of what type of enchantment you can get on a gem. 

 

That's pretty much my objective for today: put the gem on the enchantment table with modified enchantment weights for only those gems and then transform those gems into Enchanted Gems (Like the Book but without the modified weights)

 

I'll probably look into server-client syncing anyway since I used capability and networking for socketing anyway. :P

Link to comment
Share on other sites

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.