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 ...

Get A Beginner’s Guide to Writing Minecraft Plugins in JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.