21. Transmute Materials in an Inventory

In This Chapter

Work with materials in Minecraft

Define command-line arguments in plugin.yml

Read arguments in a mod

Get the items in a player’s inventory

Loop through the items

Transform one material into another

Use the Spigot Javadoc documentation

This chapter moves away from mobs into materials, the inanimate stuff that takes up space in the Minecraft world. Writing a mod that manipulates the physical world in the game requires a thorough grounding in the Material class in the org.bukkit package of the Spigot class library.

The Transmuter mod you create transforms material from one type to another at the control of the player. The original material must be present in the player’s inventory ...

Get Absolute Beginner’s Guide to Minecraft® Mods Programming, Second Edition 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.