October 2014
Beginner to intermediate
285 pages
6h 24m
English
Here’s a plugin that shows spawning two entities: a bat and a creeper. We’ll make the creeper ride the bat, and then turn the bat invisible using a potion effect. The result is a nightmarish, terrifying, flying creeper.
Here are the guts of the plugin. Notice I’m not using the helper functions to spawn this time; instead I’m using the factory calls directly, as I’m using a slightly different version of spawn.
| FlyingCreeper/src/flyingcreeper/FlyingCreeper.java | |
| | Location loc = me.getLocation(); |
| | loc.setY(loc.getY() + 5); |
| | |
| | EntityFactory factory = Canary.factory().getEntityFactory(); |
| | EntityLiving bat = factory.newEntityLiving(EntityType.BAT, loc); |
| | EntityLiving creep = factory.newEntityLiving(EntityType.CREEPER, loc); ... |
Read now
Unlock full access