@@ -0,0 +1,1441 @@
+package com.elmakers.mine.bukkit.action.builtin;%0A%0Aimport com.elmakers.mine.bukkit.action.CompoundAction;%0Aimport com.elmakers.mine.bukkit.api.action.CastContext;%0Aimport com.elmakers.mine.bukkit.api.spell.SpellResult;%0Aimport com.elmakers.mine.bukkit.spell.BaseSpell;%0Aimport org.bukkit.configuration.ConfigurationSection;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0A%0Apublic class ProbabilityAction extends CompoundAction%0A%7B%0A    private double probability;%0A%0A    @Override%0A    public void prepare(CastContext context, ConfigurationSection parameters)%0A    %7B%0A        super.prepare(context, parameters);%0A        probability = parameters.getDouble(%22probability%22, 0.5);%0A    %7D%0A%0A%09@Override%0A    public SpellResult perform(CastContext context)%0A%09%7B%0A%09%09SpellResult result = SpellResult.NO_ACTION;%0A        if (context.getRandom().nextDouble() %3C= probability) %7B%0A            result = result.min(performActions(context));%0A        %7D%0A%0A%09%09return result;%0A%09%7D%0A%0A    @Override%0A    public void getParameterNames(Collection%3CString%3E parameters) %7B%0A        super.getParameterNames(parameters);%0A        parameters.add(%22probability%22);%0A    %7D%0A%0A    @Override%0A    public void getParameterOptions(Collection%3CString%3E examples, String parameterKey) %7B%0A        if (parameterKey.equals(%22probability%22)) %7B%0A            examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_PERCENTAGES)));%0A        %7D else %7B%0A            super.getParameterOptions(examples, parameterKey);%0A        %7D%0A    %7D%0A%7D%0A

Add ProbabilityAction