Hi .
I'm making a PvP Factions server, and I want to use magic in it.
Now, the players can earn ingame-money by voting, or kill mobs. With
this money they can buy spells for their Wands, only, I dont wan't them to be able to spam their spells but I want a cooldown counting 40 seconds . I found on some forums how to make cooldowns, but that's not using the WandMakerAPI . Is there a way to make cooldowns using this API?
Or do I have to make codes for this cooldown using the craftbukkit? Thnx !
Here's my main.class:
package me.finefinn.Wand;
import org.bukkit.Material;
import org.bukkit.plugin.java.JavaPlugin;
import net.bigteddy98.wandapi.Wand;
import net.bigteddy98.wandapi.WandMaker;
public class Main extends JavaPlugin{
@Override
public void onEnable() {
Wand w = WandMaker.registerWand("Wand", Material.STICK);
w.registerSpell(new Healtrail());
w.registerSpell(new Flametrail());
w.registerSpell(new Poisontrail());
w.registerSpell(new Confuse());
w.registerSpell(new SOS());
w.registerSpell(new Confusionwave());
w.registerSpell(new SmallSpark());
w.registerSpell(new BigSpark());
w.registerSpell(new HealSpark());
w.registerSpell(new SpeedSpark());
w.registerSpell(new Launch());
w.registerSpell(new Flameaura());
}
}
And this is one of my spells:
package me.finefinn.Wand;
import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType;
import net.bigteddy98.wandapi.Spell;
import net.bigteddy98.wandapi.WandMaker;
public class Confuse implements Spell {
@Override
public void castSpell(Player p) {
Location loc = WandMaker.getPlayerBlock(p, 25);
WandMaker.getHelper().makeSmokeField(loc, 4);
WandMaker.getHelper().potion(loc, PotionEffectType.CONFUSION, 150, 100);
WandMaker.getHelper().potion(loc, PotionEffectType.BLINDNESS, 150, 100);
WandMaker.playFirework(loc, Type.BURST, Color.PURPLE, Color.BLACK, false, true);
}
}
Does anybody knows how to add cooldowns to this spells? Thnx!
I'm making a PvP Factions server, and I want to use magic in it.
Now, the players can earn ingame-money by voting, or kill mobs. With
this money they can buy spells for their Wands, only, I dont wan't them to be able to spam their spells but I want a cooldown counting 40 seconds . I found on some forums how to make cooldowns, but that's not using the WandMakerAPI . Is there a way to make cooldowns using this API?
Or do I have to make codes for this cooldown using the craftbukkit? Thnx !
Here's my main.class:
package me.finefinn.Wand;
import org.bukkit.Material;
import org.bukkit.plugin.java.JavaPlugin;
import net.bigteddy98.wandapi.Wand;
import net.bigteddy98.wandapi.WandMaker;
public class Main extends JavaPlugin{
@Override
public void onEnable() {
Wand w = WandMaker.registerWand("Wand", Material.STICK);
w.registerSpell(new Healtrail());
w.registerSpell(new Flametrail());
w.registerSpell(new Poisontrail());
w.registerSpell(new Confuse());
w.registerSpell(new SOS());
w.registerSpell(new Confusionwave());
w.registerSpell(new SmallSpark());
w.registerSpell(new BigSpark());
w.registerSpell(new HealSpark());
w.registerSpell(new SpeedSpark());
w.registerSpell(new Launch());
w.registerSpell(new Flameaura());
}
}
And this is one of my spells:
package me.finefinn.Wand;
import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType;
import net.bigteddy98.wandapi.Spell;
import net.bigteddy98.wandapi.WandMaker;
public class Confuse implements Spell {
@Override
public void castSpell(Player p) {
Location loc = WandMaker.getPlayerBlock(p, 25);
WandMaker.getHelper().makeSmokeField(loc, 4);
WandMaker.getHelper().potion(loc, PotionEffectType.CONFUSION, 150, 100);
WandMaker.getHelper().potion(loc, PotionEffectType.BLINDNESS, 150, 100);
WandMaker.playFirework(loc, Type.BURST, Color.PURPLE, Color.BLACK, false, true);
}
}
Does anybody knows how to add cooldowns to this spells? Thnx!
Create an account or sign in to comment.