Reputation: 15
So basically I am creating a magic wand plugin for bukkit. I was wondering how you can set a players model.
For example, if I right click it will turn me into a chicken. I have no idea on how to do this.
Upvotes: 1
Views: 1895
Reputation:
There are numerous plugins providing this functionality, both stabdalone and offering an API as well. They include:
==Edit==
Here's an example of using DisguiseCraft:
Before starting, make sure to add the latest jarfile to your IDE's external dependencies.
First, you need to add a dependency into your plugin.yml:
depend: [DisguiseCraft]
The brackets are needed since it is an array
Second, when your plugin is enabled, you need to acquire the instance of the API class.
DisguiseCraftAPI api;
@Override public void onEnable() {
this.api = DisguiseCraft.getAPI();
}
Then, to disguise, you can use
Player player = // ...
Disguise disguise = new Disguise(this.api.newEntityID(), player.getName(), DisguiseType.Player);
this.api.disguisePlayer(player, disguise);
All disguises can be found here: http://build.yu8.me:8080/job/DisguiseCraft/ws/javadocs/pgDev/bukkit/DisguiseCraft/disguise/DisguiseType.html
Make sure to check if the player is already disguised, you use the change player disguise instead of the set player disguise.
Upvotes: 4