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 19. Snowball Fight!

In this chapter you’re going to create a player-versus-player mini-game called Snowball Fight (see FIGURE 19.1). The aim of the game is to hit your opponents with snowballs as many times as possible while avoiding being hit yourself or hitting players on your own team. In the game players can form opposing teams.

Image

FIGURE 19.1 Snowball Fight

The game will be kept simple for the sake of providing example code, which you might want to adapt and extend to create your own mini-game.

The game will be started using a JavaScript function, and its duration and team structure will be passed as parameters. If no parameters are ...

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