Started by
StarlightIntermezzo
on
Topic category: Help with Minecraft modding (Java Edition)
I'm looking to completely disable magic while in a custom dimension of mine (pardoning armor if it's already equipped most likely), is there a way to stop players from being able to use the enchanting table or use enchanted tools?
You could pretty easily set it up to disenchant everything in the player's inventory when entering a custom dimension, but then they'd be disenchanted permanently. I'm not sure if there's a good way to straight up disable enchantments, just because there's so many of them, all of them are hard coded, and each one is a very specific case. (Disabling silk touch is very different and much more complicated than disabling mending.) It's not impossible, but I wouldn't know where to start.
A simpler method might be to just give the player special debuffs for using enchanted equipment. (Mining fatigue if they're using an enchanted tool, weakness if they're using an enchanted weapon, slowness if they're using enchanted armor, etc.) This would just require checking the main hand/off hand/armor slots of the player for enchanted items, and applying the corresponding status effects.