Conditional Effects
Apply potion effects and attribute modifiers to players based on pre-defined conditions. Give everyone speed and jump boost in your hub world, night vision below Y=0, or resistance to players holding a rank permission — all from one config file, with no commands for players to remember.
Download Conditional Effects on SpigotMC
Installation
- Add the Conditional Effects jar to your
pluginsfolder. - Restart your server.
- Edit
effects.ymlto your liking. - Type
/conditionaleffects reload.
Note: The bundled
effects.ymlships fully commented out, so a fresh install loads 0 effects and the plugin logsLoaded 0 conditional effects.— this is expected. Nothing is broken; you just haven't defined any effects yet.
Commands
The main command is /conditionaleffects (aliases: /ceffects, /ce).
/conditionaleffects help— Show the help message./conditionaleffects reload— Reload the plugin./conditionaleffects give <player> <effectId>— Apply the effect and attributes to the player immediately, ignoring the entry's conditions./conditionaleffects check <player> <effectId>— Re-evaluate the entry's conditions for the player and apply or remove the effect to match.
Permissions
conditionaleffects.reload— Allows the user to reload the plugin.conditionaleffects.give— Allows the user to give conditional effects to players.conditionaleffects.check— Allows the user to manually check conditional effects on players.
Effects
Effects are defined in effects.yml. Each entry is a named group of potion effects and/or attribute
modifiers plus the conditions that must be met for them to apply.
hub-effects:
conditions-check-interval-ticks: 20
effects:
- speed, 1
- jump, 1
attributes:
- generic-movement-speed, 0.05, add_number
- generic-max-health, 4, add_number
conditions:
worlds:
- hub
This example effect will provide speed and jump boost effects in the hub world, and increase the player's movement speed and max health via attribute modifiers while the conditions are met. When the conditions are no longer met, the attribute modifiers are removed.
Settings
conditions-check-interval-ticks— The number of ticks between each condition check. Defaults to40(2 seconds). Set to0to disable automatic scheduling for that entry (the effect can still be applied manually with/conditionaleffects give).effects— The potion effects that will be applied when the conditions are met. In the format<EffectType>, [Amplifier], [Duration], [HideParticles], [ShowIcon].attributes— The attribute modifiers that will be applied when the conditions are met and removed when they are not. In the format<Attribute>, <Amount>, [Operation]. Supported attributes includegeneric-max-health,generic-movement-speed,generic-attack-damage,generic-armor,generic-armor-toughness,generic-attack-knockback,generic-attack-speed,generic-flying-speed,generic-follow-range,generic-knockback-resistance, andgeneric-luck. Supported operations areadd-number(adds a flat amount),add-scalar(adds a percentage of the base value), andmultiply-scalar-1(multiplies by 1 + the given amount).conditions— The conditions that must be met in order for the effects to be applied. All conditions must be met. See the Conditions section below.
Conditions
Every condition listed on an effect must pass before the effects are applied. Omit a condition entirely to ignore it.
Location
worlds— Worlds that the effects will be applied in.environments— Environments that the effects will be applied in. Valid values:NORMAL(overworld),NETHER,THE_END,CUSTOM.biomes— Biomes that the effects will be applied in.min-x— Minimum X coordinate where the effects will be applied.max-x— Maximum X coordinate where the effects will be applied.min-y— Minimum Y coordinate where the effects will be applied.max-y— Maximum Y coordinate where the effects will be applied.min-z— Minimum Z coordinate where the effects will be applied.max-z— Maximum Z coordinate where the effects will be applied.
Player
players— Player names that the effects will be applied to.gamemodes— Game modes that the effects will be applied in.has-permissions— Effects will only be applied to players who have all of the listed permission nodes.missing-permissions— Effects will only be applied to players who have none of the listed permission nodes.
State
Each of these is a tri-state. Set it to true to require the state, false to require its absence, or
leave it out entirely to apply the effects regardless.
in-water— Whether the player is in water.sneaking— Whether the player is sneaking.blocking— Whether the player is blocking.climbing— Whether the player is climbing.gliding— Whether the player is gliding.glowing— Whether the player is glowing.riptiding— Whether the player is riptiding.in-vehicle— Whether the player is in a vehicle.sprinting— Whether the player is sprinting.flying— Whether the player is flying.on-fire— Whether the player is on fire.frozen— Whether the player is frozen.