O'Reilly logo

A Beginner’s Guide to Writing Minecraft Plugins in JavaScript by Walter Higgins

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

Chapter 17. Arrows That Teleport You

In the previous chapter, you learned how to add a new crafting recipe to the game. In this chapter, you’ll expand upon the work done previously by adding event-handling code that will listen for projectile hit events and teleport the player who shot the arrow, if it was fired from an ender bow. You’ll also learn more about inheritance and how to use the CanaryMod API reference documentation.

Making the Ender Bow Work

The ender bow crafted from your new crafting recipe doesn’t do much right now. If you fire an arrow using the ender bow, it behaves just like an arrow fired from a regular bow. You’re going to change that.

What you’d like is for players to be able to use the ender bow to shoot arrows that teleport ...

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