Minecraft Modding: How to Add Effects to Your Spleef Game
After you have completed an iteration of the Spleef game, you can repeat the gameplay loop and make the Minecraft game more fun, challenging, and unique. Here, you will be taken through four examples in each of the parts of the gameplay loop so that you can
Add a lava platform underneath the diamond arena.
Challenge your player to destroy 200 blocks.
Add in an enemy.
Add fireworks into the game.
Start: Add a lava platform
After you have a working game, you can add to the scene to make it more interesting. In this section, you learn how to add a platform of lava below the arena so that a player who falls through the platform falls into a lava pit.
Because you’re using the ArenaBuilder library, the change to the Spleef code is minor. The image below shows you what to call to add to the arena function.
This is the scene you will see.
Goal: Destroy at least 200 blocks
Because you’re already counting the number of blocks that the player destroys as a part of the Reward phase in Iteration 1, you can easily add a bit of code to the removeBlock function to congratulate the player on becoming a Master Spleefer.
Challenge: Add an enemy
You can easily add an enemy into the arena by using the melon block as the spawning point. This shows how to spawn a creeper in a random spot in the arena. Then the player has to avoid the creeper and try not to fall before gaining at least 200 blocks.
Here is the player approaching the creeper.
Reward: Add fireworks
Finally, you can make the reward a little more interesting: Rather than congratulate players, you can give them a fireworks show! This image shows how to add the Fireworks block into the removeBlock function.
You can find the Fireworks block under the World category.