Strange Enchanting Table Behavior (Custom Enchantments)

Started by rmsandegs on Thu, 08/06/2020 - 03:51

Topic category: Help with modding (Java Edition)

Last seen on 19:19, 24. Sep 2020
Joined May 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Strange Enchanting Table Behavior (Custom Enchantments)
Thu, 08/06/2020 - 03:51

When I select a level 30 enchantment on my custom item, only a couple of my enchantments will have a chance to be put on the item. The link below leads to a sample workspace in which I've managed to recreate the issue. In this example, only enchantments 4 and 5 have a chance of being applied on a level 30 enchant. The rest only appear on lower-level rolls.

https://www.dropbox.com/s/f2hcs4okhq71747/sample%20workspace.zip?dl=0

Last seen on 19:20, 24. Sep 2020
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I don't think we can control…
Thu, 08/06/2020 - 06:52

I don't think we can control how this behaves, there are only basic properties exposed in enchantments, check the generated code for more info. Level 30 is quite high, though

Last seen on 19:19, 24. Sep 2020
Joined May 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It's just usually best to go…
Thu, 08/06/2020 - 07:26

It's just usually best to go for the level 30 enchantment because it has the best chance of giving you more enchantments and for them to be higher level.

I figured out editing getMinEnchantability() and getMaxEnchantability() to something like 0 min/100 max makes them show up in the enchantment table. Is there a way these two fields could be implemented into the interface? Perhaps you could set the min and max via procedures that return a number. 

It would also be nice if these fields would pass "enchantmentLevel" as a dependency, as Vanilla enchantments use this to determine the maximum level of a given enchantment the item can receive (i.e a wooden sword can only get up to sharpness 2).

This is the only solution I could find that fixed the issue for me. You were right about complete control being pretty limited, though.