O'Reilly logo

Learn to Program with Minecraft Plugins, 2nd Edition by Andy Hunt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Plugin: CowShooter

Now we have enough parts to make a really fun plugin: the CowShooter. If you have a piece of leather in your hand in the game world, you can click to shoot a flaming cow out into the world. When the cow hits the ground, it will explode in a ball of flame, fire, and hamburger.

This plugin is a little different from what we’ve seen so far; there’s no @Command section at all. It’s driven entirely by events.

One problem with a flaming cow is that it won’t stay flaming forever, or even for very long. Normally a flaming cow will catch fire, then the cow dies and the fire goes out. That’s not quite suitable for our purposes: we need the cow to stay on fire as long as it’s flying through the air.

To make that happen, we’ll schedule ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required