Lib's Disguises - Setting up the FlagWatcher

Jan 20, 2017
Lib's Disguises - Setting up the FlagWatcher

  • This page may be outdated with methods removed and renamed.


    So you may be interested in how you can set the effects of a disguise.
    Such as making the ocelot catch on fire.


    Information

    You can fetch the flag watcher from a disguise using

    Code (Java):
    FlagWatcher watcher = disguise.getWatcher();
    You can now use the watcher and set a flag. A flag is basically turning stuff off and on.
    You can set the flagwatcher before its disguised, after its disguised.

    Some flag watcher values, when set will render some things as no longer used.
    Setting the burning flag for instance. If you do this for a player who is disguised as another player.
    He will no longer appear to sneak to other people.

    Code (Java):
    watcher.setBurning(true);
    My disguise will now look like it is burning. But in reality it isn't.

    And here is the list of flagwatchers and their usable methods.
    Some of the usable methods are only effective for selective disguises.
    Such as held item. Only zombie, player, zombie pigman and skeleton will show this.

    For the itemstacks in the flag watcher. There is a enum SlotType.
    This is used for convenience.

    BOOTS, LEGGINGS, CHESTPLATE, HELMET, HELD_ITEM

    There is also a enum AnimalColor. This is used for sheeps wool and wolfs collar.

    BLACK, BLUE, BROWN, CYAN, GRAY, GREEN, LIGHT_BLUE, LIME MAGENTA, ORANGE, PINK, PURPLE, RED, SILVER, WHITE, YELLOW

    To get a specific flagwatcher. You will need to cast it from the default (FlagWatcher) to something such as OcelotWatcher.

    Code (Java):
    OcelotWatcher ocelotWatcher = (OcelotWatcher) disguise.getWatcher();
    DisguiseTypes

    This lists what FlagWatcher each disguisetype uses.

    ARROW, BAT, BLAZE, BOAT, CAVE_SPIDER, CHICKEN, COW, CREEPER, DONKEY, DROPPED_ITEM, EGG, ENDER_CRYSTAL, ENDER_DRAGON, ENDER_PEARL, ENDER_SIGNAL, ENDERMAN, EXPERIENCE_ORB, FALLING_BLOCK, FIREBALL, FIREWORK, FISHING_HOOK, GHAST, GIANT, HORSE, IRON_GOLEM, ITEM_FRAME, LEASH_HITCH, MAGMA_CUBE, MINECART, MINECART_CHEST, MINECART_FURNACE, MINECART_HOPPER, MINECART_MOB_SPAWNER, MINECART_TNT, MULE, MUSHROOM_COW, OCELOT, PAINTING, PIG, PIG_ZOMBIE, PLAYER, PRIMED_TNT, SHEEP, SILVERFISH, SKELETON, SKELETON_HORSE, SLIME, SMALL_FIREBALL, SNOWBALL, SNOWMAN, SPIDER, SPLASH_POTION, SQUID, THROWN_EXP_BOTTLE, UNDEAD_HORSE, VILLAGER, WITCH, WITHER, WITHER_SKELETON, WITHER_SKULL, WOLF, ZOMBIE, ZOMBIE_VILLAGER


    FlagWatcher(top)

    getArmor() - This returns the armor that the disguise appears to wear
    getItemInMainHand() - This returns the item that he appears to be held in main hand.
    getItemInOffHand() - This returns the item that he appears to be held in the off hand.
    getItemStack(equipmentslot) - This returns the item in the slot.
    getEquipment() - This returns the EntityEquipment
    isBurning() - Returns if the disguise appears to be on fire
    isInvisible() - Returns if the disguise appears to be invisible
    isRightClicking() - Idk what this does.
    isSneaking() - Returns if the disguise appears to be sneaking
    isSprinting() - Returns if the disguise appears to be sprinting
    setArmor(ItemStack[] items) - This sets the items on the player. Despite the name. You can do a max stack of 5 where the 5th item will set his held item. The first slot is for the boots.
    setBurning(true) - This sets if the disguise appears to be on fire
    setItemInMainHand(itemstack) - Sets the itemstack the disguise appears to be holding in the main hand.
    setItemInOffHand(itemstack) - Sets the itemstack the disguise appears to be holding in the off hand.
    setInvisible(true) - This sets if the disguise appears to be invisible
    setItemStack(equipmentslot, itemstack) - Sets the item in the slot
    setRightClicking(true) - Idk what this does
    setSneaking(true) - Sets if the disguise appears to be sneaking
    setSprinting(true) - Sets if the disguise appears to be sprinting
    hasCustomName() - Returns if the disguise appears to have a custom name
    getCustomName() - Returns the custom name of the disguise that appears over the head
    setCustomName(String) - Sets the custom name of the disguise which appears over its head
    setCustomNameVisible(true) - Sets if the custom name is always visible without looking directly at it
    isCustomNameVisible() - Returns if the custom name is always visible without looking directly at it

    AgeableWatcher(top)

    This extends LivingWatcher, and is extended by HorseWatcher, OcelotWatcher, PigWatcher, SheepWatcher, VillagerWatcher and WolfWatcher

    isAdult() - Returns if the disguise appears to be a adult
    setAdult(true) - Sets the disguise to a adult, or baby

    ArrowWatcher(top)


    isMoving() - Returns if the arrow disguise is effected by gravity client sided.
    setMoving(true) - Sets if the arrow appears to be effected by gravity client sided

    BatWatcher(top)

    This extends LivingWatcher

    isFlying() - Returns if the disguise appears to be flapping its wings
    setFlying(true) - Sets if the disguise appears to be flapping its wings

    BlazeWatcher(top)

    This extends LivingWatcher

    isBlazing() - Sets it on fire I think
    setBlazing(true) - Think it sets it on fire

    BoatWatcher(top)

    I think this is for how wildly the boat shakes when you punch it

    getDamage() - Gets the boats damage
    getHealth() - Gets the boats health
    setDamage(float newDamage) - Sets the boat damage
    setHealth(float newHealth) - Sets the boat health

    CreeperWatcher(top)

    This extends LivingWatcher

    isFused() - Returns if the creeper is swelling as if its about to explode
    isPowered() - Returns if the creeper looks like it was struck by lightning
    setFused(true) - Sets if the creeper is swelling
    setPowered(true) - Sets if the creeper collected the lightning powerup

    DroppedItemWatcher(top)


    getItemStack() - Gets the item this is disguised as
    setItemStack(itemstack) - Sets the item it is disguised as

    EndermanWatcher(top)

    This extends LivingWatcher

    getHeldItem() - Get the held item in hand
    isAgressive() - Returns if the enderman is appearing to scream
    setAgressive(true) - Sets if the enderman is appearing to scream
    setHeldItem(itemstack) - Sets the held item in hand

    FallingBlockWatcher(top)


    setBlock(ItemStack) - Sets the block it looks like
    getBlock() - Gets the block it looks like

    GhastWatcher(top)

    This extends LivingWatcher

    isAgressive() - Returns if the ghast has red eyes
    setAgressive(true) - Sets the ghast to have red eyes

    HorseWatcher(top)

    This extends AgeableWatcher and LivingWatcher and is used by all horses. Including mules.

    getColor() - Returns the Horse.Color of the horse
    getOwnerName() - Returns the owner name. Useless I think
    getStyle() - Returns the Horse.Style of the horse
    hasChest() - Returns if the horse has a chest
    isBreedable() - Returns if the horse appears to be breedable. Useless I think
    isGrazing() - Returns if the horse appears to be kissing the ground
    isMouthOpen() - Returns if the horse is drooling
    isRearing() - Returns if the horse is flashing its genitals
    isSaddled() - Returns if there is a saddle on the horse
    isTamed() - Returns if the horse appears to be tamed. Useless I think
    setCanBreed(true) - Sets if the horse can breed
    setCarryingChest(true) - Sets if there is a chest
    setColor(Horse.Color) - Sets the coloring of the horse
    setColorId(int id) - Sets the coloring id of the horse
    setGrazing(true) - Sets if the horse is licking the dirt
    setMouthOpen(true) - Sets if the horse is catching flies in its mouth
    setOwnerName(String) - Sets the owner of the horse
    setRearing(true) - Set to make your horse a pervert
    setSaddled(true) - Set to make the horse appear to be saddled
    setStyle(Horse.Style) - Set the horse style
    setStyleId(int id) - Set the horse style id
    setTamed(true) - Sets if the horse is tamed

    ItemFrameWatcher(top)


    getItemRotation() - Returns a number from 0 to 3 on how much it has rotated
    getItemStack() - Returns the itemstack it appears to have in it
    setItemRotation(int no) - Sets the item rotation. From down to right to up to left.
    setItemStack(itemstack) - Sets the itemstack it appears to have in it

    LivingWatcher(top)

    This is extended by AgeableWatcher, BatWatcher, BlazeWatcher, CreeperWatcher, EndermanWatcher, GhastWatcher, HorseWatcher, OcelotWatcher, PigWatcher, PlayerWatcher, SheepWatcher, SlimeWatcher, VillagerWatcher, WolfWatcher, ZombieWatcher

    addPotionEffect(PotionEffectType) - Adds a potion effect that it appears to have. Never expires and will display the particles
    getHealth() - Returns the health the disguise appears to have. This never changes automatically
    getPotionParticlesRemoved() - Returns if potion particles are mostly transparent
    hasPotionEffect(PotionEffectType) - Returns if the disguise appears to have this potion on it
    removePotionEffect(PotionEffectType) - Removes the potioneffect type from the disguise
    removePotionParticles(true) - Turns the potion particles on the disguise mostly invisible
    setHealth(float health) - Sets the health the disguise appears to have, this will never change automatically

    MinecartWatcher(top)


    getDamage() - Returns the damage it has appeared to take
    setDamage(float newDamage) - Sets the damage of it

    OcelotWatcher(top)

    This extends AgeableWatcher and LivingWatcher

    getOwner() - Returns the string of its owner
    getType() - Returns the Ocelot.Type of it
    setOwner(String) - Sets the owner
    setSitting(true) - Sets if its sitting
    setTamed(true) - Sets if it is tamed
    setType(Ocelot.Type) - Sets the type of cat
    setTypeId(int id) - Sets the type of cat using a id

    PaintingWatcher(top)


    setArt(Art art) - Sets the art that the painting looks like
    getArt() - Gets the art that the painting looks like

    PigWatcher(top)

    This extends AgeableWatcher and LivingWatcher

    isSaddled() - Returns if it appears to have a saddle
    setSaddled(true) - Sets if it appears to have a saddle

    PlayerWatcher(top)

    Extends LivingWatcher. Both the methods believed to be useless

    getArrowsSticking() - Returns the arrows appearing to stick into it
    setArrowsSticking(int arrows) - Sets the arrows appearing to stick into it
    setSkin(String player name) - Sets the skin of the player

    SheepWatcher(top)

    Extends AgeableWatcher and LivingWatcher

    getColor() - Returns the AnimalColor of its wool
    isSheared() - Returns if the sheep appears to be sheared
    setColor(AnimalColor color) - Sets the color of its wool
    setSheared(true) - Sets if it appears to be shorn

    SlimeWatcher(top)

    Extends LivingWatcher

    getSize() - Returns the slime size
    setSize(int size) - Sets the size of the slime

    SplashPotionWatcher(top)


    setPotionId(int potionId) - Sets the potion id
    getPotionId() - Gets the potion id

    VillagerWatcher(top)

    This extends AgeableWatcher and LivingWatcher

    getProfession() - Returns the Villager.Profession of the villager
    getProfessionId() - Gets the profession ID of the villager
    setProfession(Villager.Profession) - Sets the profession of the villager
    setProfessionId(int profession) - Sets the profession id of the villager

    WitherSkullWatcher(top)


    isBlue() - Returns if the witherskull is blue
    setBlue(true) - Turns it blue

    WolfWatcher(top)

    This extends AgeableWatcher and LivingWatcher

    getCollarColor() - Returns the AnimalColor of the collar
    getOwner() - Returns the owner of the wolf
    isAngry() - Returns if the wolf is angry
    isSitting() - Returns if the wolf is smearing shit on the carpet
    isTamed() - Returns if the wolf has a collar
    setAngry(true) - Sets the wolf to be angry
    setCollarColor(AnimalColor) - Sets the collar color
    setOwner(String) - Sets the owner of the wolf
    setSitting(true) - Force it to smear shit on the carpet
    setTamed(true) - Creates a collar and slams the wolf into slavement

    ZombieWatcher(top)

    This extends LivingWatcher

    isAdult() - Returns if the zombie is a adult
    isVillager() - Returns if it looks like a villager
    setAdult(true) - Sets it to look like a adult
    setVillager(true) - Sets it to look like a villager

  • Loading...
  • Loading...