Search in sources :

Example 1 with SlimeSize

use of net.citizensnpcs.trait.SlimeSize in project Citizens2 by CitizensDev.

the class NPCCommands method slimeSize.

@Command(aliases = { "npc" }, usage = "size [size]", desc = "Sets the NPC's size", modifiers = { "size" }, min = 1, max = 2, permission = "citizens.npc.size")
@Requirements(selected = true, ownership = true, types = { EntityType.MAGMA_CUBE, EntityType.SLIME })
public void slimeSize(CommandContext args, CommandSender sender, NPC npc) {
    SlimeSize trait = npc.getTrait(SlimeSize.class);
    if (args.argsLength() <= 1) {
        trait.describe(sender);
        return;
    }
    int size = Math.max(-2, args.getInteger(1));
    trait.setSize(size);
    Messaging.sendTr(sender, Messages.SIZE_SET, npc.getName(), size);
}
Also used : SlimeSize(net.citizensnpcs.trait.SlimeSize) Command(net.citizensnpcs.api.command.Command) Requirements(net.citizensnpcs.api.command.Requirements)

Aggregations

Command (net.citizensnpcs.api.command.Command)1 Requirements (net.citizensnpcs.api.command.Requirements)1 SlimeSize (net.citizensnpcs.trait.SlimeSize)1