😅Simple Usage

Here is a very simple example of using ModernDisguise

import dev.iiahmed.disguise.*;

import java.util.regex.Pattern;

public class ExampleClass implements Listener {

    private final DisguiseProvider provider = DisguiseManager.getProvider();

    public ExampleClass() {
        boolean allowEntities = getConfig().getBoolean("allow-entity-disguises");
        DisguiseManager.initialize(ExamplePlugin.getInstance(), allowEntities);
        provider.allowOverrideChat(false);
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        Disguise disguise = Disguise.builder()
                .setName("BillBobbyBob")
                // you could as well use Disguise.Builder#setSkin(textures, signature)
                // or even Disguise.Builder#setSkin(uuid, skinAPI)
                // it's recommended to run this async since #setSkin from an online API will block the mainthread
                .setSkin("example-name", SkinAPI.MOJANG) // You don't have to specify an API (mojang is default)
                // this will change the player into a zombie for others only
                .setEntityType(EntityType.ZOMBIE)
                .build();
        provider.disguise(player, disguise);
    }

}

Last updated