Using variables in Drops:
Summary
I’d love to see scaling mob levels added to MysticMobs, where higher-level mobs have an increased chance to drop rare loot from their drop tables. Right now, trying to implement this manually causes issues—any math-based chance in the Drops: section forces the drop to become 100% guaranteed, which breaks the intended progression.
I’ve tested multiple approaches, including setting variables via skills and applying them to drop chances, but the system doesn’t interpret them correctly. Thankfully, with help from the community (shoutout to mikekevie), I found a partial workaround using ?chance{c=...} in skills. However, this doesn’t work with FancyDrop, and it’s still far from ideal since we can’t use dynamic values directly in the Drops: config.
Usage
This would allow admins to create tiered loot systems where mobs drop better rewards as they level up. For example:
Drops:
- diamond 1 0.05*<caster.level> # 5% base chance, scaling with level
Or, if variables were properly supported in skills:
Skills:
- setvariable{var=scaledDrop; value="0.05 * <caster.level>"; type=FLOAT} @self ~onSpawn
- dropitem{i=diamond 1} @self ~onDeath ?chance{c=<caster.var.scaledDrop>}
Value
Better loot progression – Players get more exciting rewards as they face stronger mobs.
Less scripting work – No need for convoluted workarounds just to scale drop rates.
Future-proofing – Works seamlessly with FancyDrop and other mechanics.
Priority
High – This is a major limitation for anyone trying to create RPG-like mob progression. Right now, we have to either accept static drop rates or use janky skill-based fixes that don’t play well with other features.
Implementation
Fix math expressions in Drops: – Ensure formulas like 0.1*<caster.level> calculate correctly instead of defaulting to 100%.
Support variables in drop chances – Allow <caster.var.x> or similar syntax in both Drops: and skill-based drops.
Maintain compatibility – Ensure it works with FancyDrop and other loot-related mechanics.
Ideally, we could use something like:
Drops:
- diamond 1 ?chance{c=0.05*<caster.level>} # Clean, dynamic chance
This would be a huge quality-of-life improvement for server owners!
This version keeps the technical details but makes it feel more natural and engaging, like a real suggestion from a user. Let me know if you'd like any tweaks!