Skip to content

Development API: Wands

Naomi edited this page May 11, 2020 · 1 revision

Example

public class ExampleWand extends WandBase {
    public ExampleWand() {
        super();
        this.setItem(Material.BLAZE_ROD);
        //Is called when the wand is being loaded
    }

    public ExampleWand(Player player, int id) {
        super(player, id);
        this.setItem(Material.BLAZE_ROD);
        //Is called when a new wand is being registered
    }

    @Override
    public Optional<Spell> getSelectedSpell() {
        return super.getSelectedSpell(); //returns currently selected spell
    }

    @Override
    public String getWandName() {
        return "&fI'm N O T H I N G"; //wand name with color codes
    }

    @Override
    public String getPlainWandName() {
        return "ImNothing"; //Wand name without color codes and spaces
    }

    @Override
    public Optional<Integer> getId() {
        return super.getId(); //Returns the wand Id
    }

    @Override
    public void nextSpell() {
        super.nextSpell(); //Make the wand owner select the next spell
    }

    @Override
    public void previousSpell() {
        super.previousSpell(); //Make the wand owner select the previous spell
    }

    @Override
    public ArrayList<Spell> getBoundSpells() {
        return super.getBoundSpells(); //Returns currently bound spells
    }

    @Override
    public Optional<Player> boundPlayer() {
        return super.boundPlayer(); //Returns the current wand owner
    }

    @Override
    public String getSelectMessage() {
        return "Ok U selected a %spellname%"; //Returns the select message
    }

    @Override
    public String getBindMessage() {
        return "Ok U bound %spellname%"; //Returns the bind message
    }

    @Override
    public String getUnbindMessage() {
        return "Ok U unbound %spellname%"; //Returns the unbind message
    }

    @Override
    public Material getItem() {
        return super.getItem(); //Return the item set
    }

    @Override
    public String getWandType() {
        return "NOTHINGNESS"; //Return the current wand type
    }

    @Override
    public void registerNewWand(Player player, Integer id) {
        super.registerNewWand(player, id); //Register a new wand
    }

    @Override
    public List<Object> getSelectionParticles() {
        return Arrays.asList(Particle.CLOUD, new WandParticle(Effect.STEP_SOUND, Material.COBWEB)); //Particles being spawned on spell-select
    }

    @Override
    public Spell getPreviousSpell() {
        return super.getPreviousSpell(); //Get the previous spell on the bound spell list
    }

    @Override
    public Spell getNextSpell() {
        return super.getNextSpell(); //Get the next spell on the bound spell list
    }

    @Override
    public UUID getDeveloper() {
        return UUID.fromString("6fe60af2-fc0d-48a3-9c65-9069d904903b"); //Return the UUID of the developer of this wand
    }

    @Override
    public boolean isDeveloperMode() {
        return false; //Is this wand only allowed to be used by the developer? (true if so)
    }
}

Clone this wiki locally