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!

  • 4 comments
  • Avatar of ColonelHedgehog ColonelHedgehog Jun 25, 2014 at 14:46 UTC - 0 likes

    @superchris05326: Go

    I think this is how you're supposed to do it:

    dc.disguiseToAll(p, new MobDisguise(DisguiseType.WITHER_SKELETON, true));

    BFAK:90941692,d46369883d43cce7260cd9d4733e12867d02be3e36a5aac8c6dfce040cb5a84d

  • Avatar of superchris05326 superchris05326 Jun 21, 2014 at 23:55 UTC - 0 likes

    @Robingrether How would I use api.disguiseToAll(Player, Disguise)? I can't seem to figure out in the javadocs.

    BFAK:90836792,85825bfb76669fcb5141a5075904904143f22e965f2f8bffbc35a3aaeb1d9739

  • 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.

  • 4 comments

Facts

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

Author