How it works#
Each immunity is an ability type you put in a
Palladium power. Give it conditions like any ability, or none to keep it on whenever
the power is there. While it's on, other players' stone abilities of that kind don't work on the entity. Its own abilities still
work on itself.
infinity:mental_immunity - Mind Reading ("That mind is shielded"), Pacify, and Disguise: an immune player sees others' real skin and name.
infinity:reality_immunity - Nothing built in yet, since no Reality Stone ability targets other entities. It's there for addon abilities and commands.
infinity:soul_immunity - Soul Drain ("That soul is shielded"), being taken along by Enter / Exit Soulworld, /infinity soul locateentity, and the location line of Mind Reading.
infinity:spatial_immunity - Telekinesis and Spatial Lock can't grab or lock it (it's dropped as soon as it becomes immune), and Black Hole doesn't pull it.
The Mind Stone has mental immunity built in as a hidden passive, so anyone channeling it is immune. The Time Stone's
infinity: works the same way for Slow Time and Freeze Time.
Adding one#
The Mind Stone's
"mental_immunity": {
"type": "infinity:mental_immunity",
"title": "Mental Immunity",
"hidden": true,
"hidden_in_bar": true
}On a toggle
Spatial immunity for the Test Stone, only while a key toggles it on.
"anchor": {
"type": "infinity:spatial_immunity",
"title": "Anchor",
"description": "Telekinesis, Spatial Lock and black holes can't move you.",
"bar_color": "pink",
"conditions": {
"enabling": [ { "type": "palladium:toggle" } ]
}
}Checking for them#
Conditions. infinity:, infinity:, infinity:
and infinity: check the entity the condition runs on, on either side. They have no settings.
{ "type": "palladium:not", "conditions": [ { "type": "infinity:is_soul_immune" } ] }Commands. While immune, the entity has the scoreboard tag infinity_mental_immune,
infinity_reality_immune, infinity_soul_immune or infinity_spatial_immune, so a selector can skip it.
The Mind Stone's Pacify does exactly this:
execute as @e[distance=..5,tag=!infinity_mental_immune] run team join peacefulJava. net.pugmeowla.infinity.api.InfinityImmunity has a static check for each, which works on both sides
and is false for anything that isn't a living entity. isTimeImmune checks time immunity the same way.
import net.pugmeowla.infinity.api.InfinityImmunity;
if (!InfinityImmunity.isSoulImmune(target)) {
// Your ability's effect here.
}