October 2015
Beginner
400 pages
10h 9m
English
In This Chapter
• Find all living mobs in the game world
• Store the mobs in a list data structure
• Learn the type of each mob
• Use a hash map to count mob types
• Work with enum constants
• Calculate the distance between two things in (x,y,z) space
• Send a message to a player with a mod
A useful application of mods is to discover more about Minecraft in real time as the game is being played. This chapter’s mod takes a census of the mobs that are active in the world in the vicinity of the player.
Mobs are loaded and unloaded by the game as players explore the world. The world is divided into chunks that are 16 blocks long, 16 blocks wide, and 256 blocks deep. The chunks nearest the player are loaded ...
Read now
Unlock full access