Lib's Disguises - Creating a disguise
-
Disguise Types(top)
To create a disguise, you need to fetch the type of disguise you want to use.
Code (Java):DisguiseType.OCELOT
AREA_EFFECT_CLOUD
ARMOR_STAND
ARROW
BAT
BEE
BLAZE
BOAT
CAT
CAVE_SPIDER
CHICKEN
COD
COW
CREEPER
DOLPHIN
DONKEY
DRAGON_FIREBALL
DROPPED_ITEM
DROWNED
EGG
ELDER_GUARDIAN
ENDERMAN
ENDERMITE
ENDER_CRYSTAL
ENDER_DRAGON
ENDER_PEARL
ENDER_SIGNAL
EVOKER
EVOKER_FANGS
EXPERIENCE_ORB
FALLING_BLOCK
FIREBALL
FIREWORK
FISHING_HOOK
FOX
GHAST
GIANT
GUARDIAN
HOGLIN
HORSE
HUSK
ILLUSIONER
IRON_GOLEM
ITEM_FRAME
LEASH_HITCH
LLAMA
LLAMA_SPIT
MAGMA_CUBE
MINECART
MINECART_CHEST
MINECART_COMMAND
MINECART_FURNACE
MINECART_HOPPER
MINECART_MOB_SPAWNER
MINECART_TNT
MULE
MUSHROOM_COW
OCELOT
PAINTING
PANDA
PARROT
PHANTOM
PIG
PIGLIN
PILLAGER
PLAYER
POLAR_BEAR
PRIMED_TNT
PUFFERFISH
RABBIT
RAVAGER
SALMON
SHEEP
SHULKER
SHULKER_BULLET
SILVERFISH
SKELETON
SKELETON_HORSE
SLIME
SMALL_FIREBALL
SNOWBALL
SNOWMAN
SPECTRAL_ARROW
SPIDER
SPLASH_POTION
SQUID
STRAY
STRIDER
THROWN_EXP_BOTTLE
TRADER_LLAMA
TRIDENT
TROPICAL_FISH
TURTLE
VEX
VILLAGER
VINDICATOR
WANDERING_TRADER
WITCH
WITHER
WITHER_SKELETON
WITHER_SKULL
WOLF
ZOGLIN
ZOMBIE
ZOMBIE_HORSE
ZOMBIE_VILLAGER
ZOMBIFIED_PIGLIN
You then need to construct a disguise.
The names all follow the EntityType names.
You can fetch the disguisetype from a entitytype using
Code (Java):DisguiseType.getType(EntityType.OCELOT);PlayerDisguise(top)
This is a simple disguise. You are constructing a disguise for a player.
So anyone who uses this disguise, will be turned into a player from everyone's perceptive.
This PlayerDisguise is only used for disguising something as a player
There are two constructors.
Code (Java):PlayerDisguise playerDisguise = new PlayerDisguise("libraryaddict");
MobDisguise(top)
This is a mob disguise.
Is it living? If yes. Then it uses this disguise.
Disguises such as bat, ocelot, enderdragon all use this.
There are three constructors.
Code (Java):MobDisguise mobDisguise = new MobDisguise(DisguiseType.OCELOT);
Code (Java):MobDisguise mobDisguise = new MobDisguise(DisguiseType.OCELOT, false);
true = adult
false = baby
Code (Java):MobDisguise mobDisguise = new MobDisguise(DisguiseType.OCELOT, false, true);
MiscDisguise(top)
This is for all the other disguises.
Falling blocks, dropped items and boats. etc.
They all belong here.
This time, there is a lot more disguise constructors you can use.
As there are different constructors which do mostly the same thing, I will not be listing them all.
And as mentioned earlier on. You can do 'true/false' to replace the sounds or not. By default it is true.
Code (Java):MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.PAINTING);
Code (Java):MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.PAINTING, 0);
This is only used by select disguises. This is not required.
If you attempt to use this on a disguise where its not applied. It will be reset to the default.
Fishing hook: The entity id of the entity the fishing hook is coming from.
Arrow: The entity id of the shooter
Small fireball & Fireball: The entity id of the shooter
Wither skull: The entity id of the shooter
Splash potion: The potion id for a colored potion
Painting: The painting id to select
Falling Block: The block ID
Dropped Item: The item ID
Code (Java):MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, 18, 1);
Using this constructor for any other disguise type will have no additional effect, than if you had left out the second integer parameter.
The first number is the block ID
The second number is the block durability/item data.
So I'm currently spawning in a leaves block which is spruce.
Apply a disguise to an entity (a player)(top)
Now that you instantiated your Disguise object, you need to properly apply it. Here is an example of how to apply the disguise:
Code (Java):MobDisguise mobDisguise = new MobDisguise(DisguiseType.ZOMBIE);
mobDisguise.setEntity(yourEntityObject);
mobDisguise.startDisguise();
- Loading...
- Loading...
XenCarta PRO
© Jason Axelrod from 8WAYRUN.COM