iDisguise

MainCommands & PermissionsConfig & LanguagesAPI

API

The API was recoded (v2.1.3) and has now got a JavaDoc.

Have fun using the API. :)

Don't forget to add depend: iDisguise or softdepend: iDisguise to your plugin.yml.

Example

import org.bukkit.GameMode;
import org.bukkit.event.*;
import org.bukkit.event.player.*;
import org.bukkit.plugin.java.JavaPlugin;
import de.robingrether.idisguise.api.*;
import de.robingrether.idisguise.disguise.*;

public class MyPlugin extends JavaPlugin implements Listener {
    
    private DisguiseAPI api;
    
    public void onEnable() {
        api = getServer().getServicesManager().getRegistration(DisguiseAPI.class).getProvider();
        getServer().getPluginManager().registerEvents(this, this);
    }
    
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        if(api.isDisguised(event.getPlayer)) {
            api.undisguiseToAll(event.getPlayer());
            event.getPlayer().sendMessage("You were undisguised");
        }
    }

    @EventHandler
    public void onUndisguise(UndisguiseEvent event) {
        if(!event.getPlayer().getGameMode().equals(GameMode.CREATIVE)) {
            event.setCancelled(true);
            event.getPlayer().sendMessage("You mustn't undisguise in survival or adventure mode!");
        }
    }
    
}

Upcoming features

  • access to localized messages (v2.2.1)
  • maybe change the locale
  • modifying the sound system (v2.2.1)
  • disguise/undisguise events (v2.2.1)

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of xXGiusXx xXGiusXx Apr 17, 2014 at 14:05 UTC - 0 likes

    @Robingrether Could you give me an example of API api.disguiseToAll(Player, Disguise)? Thanks

  • Avatar of JEGHatton14 JEGHatton14 Apr 07, 2014 at 18:24 UTC - 0 likes

    Hi I'm using multi craft and have installed it and ran the server and its there as a plugin but it won't let me use the plugin it just says 'An internal error occurred while attempting to perform this command if its to do with other plugins or i have to get another plugin to help it plz tell me but I'm stuck and i would like it too work.

  • 2 comments

Facts

Date created
Jan 10, 2013
Last updated
Sep 22, 2013

Author