Dampened - Ability Management Mod

About the Modification
Dampened is an extension for the Palladium platform that introduces a system for suppressing superpowers into the game. This addon provides developers with a set of tools for creating balanced interactions between various modifications related to character special abilities.
The project was originally created for the Arrzee's Enhanced SMP server. Watch the mod capabilities demonstration!
Main Features
Suppression Blocks
- Suppressor Block (Dark Matter)
- EMP Jammer (Technological)
- Magic Rune (Magical)
- Creative Suppression Block
Targeted Suppression
- Suppression Handcuffs (Dark Matter)
- Kryptonite-Gold Handcuffs
- Magic Suppression Handcuffs
- Tech Suppression Belt
- Suppression Collar (Mutants)
Integration with Other Mods
Method 1: Optional Dependency
To add compatibility with Dampened to your addon as an optional dependency, follow these steps.
Creating Custom Condition
Place the following code in the file addon/<YOUR_NAMESPACE>/kubejs_scripts/safe_player_has_effect.js:
/
@author Hertz
@version 2.0
/
var BuiltInRegistries = Java.loadClass("net.minecraft.core.registries.BuiltInRegistries")
function resolveAllegedBooleanFromObject(thing) {
if (thing.toString() == 'true') { return true; }
if (thing.toString() == 'false') { return false; }
return null
}
StartupEvents.registry('palladium:condition_serializer', (event) => {
event.create('<YOUR_NAMESPACE>:dampened_by')
.addProperty("effect", "string", "minecraft:health_boost", "Effect to search for")
.test((entity, props) => {
let targetEffect = props.get("effect")
var toReturn = false
try {
var fetchedEffect = BuiltInRegistries.MOB_EFFECT.get(targetEffect)
if (fetchedEffect == null) {
// throw new Error(Target effect ${targetEffect} not found!)
toReturn = false
} else {
toReturn = entity.hasEffect(targetEffect)
}
} catch (err) {
console.log(err)
}
return !toReturn
})
});
Implementation in JSON
Add the created condition to the ability's unlocking section, wrapping it in a palladium:not condition:
"conditions": {
"unlocking": [
{
"type": "<YOUR_NAMESPACE>:dampened_by",
"effect": "dampened:genetic"
}
]
}
Method 2: Required Dependency
If Dampened should be a required dependency, use the built-in Palladium condition:
"conditions": {
"unlocking": [
{
"type": "palladium:has_effect",
"effect": "dampened:genetic"
}
]
}
Don't forget to specify the dependency in your mod's configuration files.