Be The Mob API

A new api

BeTheMob v1.02+ contains a wonderful api

This is an example code:

Api api = BeTheMob.getApi();
//create a mob disguise
Disguise dis = api.createDisguise(player, player.getLocation(), EntityType.CREEPER, null);
//the variable null is a list of extras (flags) that can be added to the mob disguise, flags allways start with '-'
//submit the disguise
api.addDiguise(player, dis);

example code to disguise a player as a red baby sheep:

Api api = BeTheMob.getApi();
//create extras fr MetaData
List<String> extras = new ArrayList<String>();
extras.add("-baby");
extras.add("-red");
//create a mob disguise
Disguise dis = api.createDisguise(player, player.getLocation(), EntityType.SHEEP, extras);
//submit the disguise
api.addDiguise(player, dis);

example code for a player disguise:

Api api = BeTheMob.getApi();
//create disguise
Disguise dis = api.createDisguise(player, player.getLocation(), "Notch", 0);
//0 is the item the disguised player should have in his hand
//submit the disguise
api.addDisguise(player, dis);

We also got 3 events that you can put under the @EventHandler for v1.03+:

PlayerDisguiseEvent
PlayerUndisguiseEvent
PlayerInteractDisguisedEvent

their function is pretty self-explaining.


Comments

Posts Quoted:
Reply
Clear All Quotes