HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
In Full Color!
In just 24 sessions of one hour or less, Sams Teach Yourself Minecraft® Mod Development in 24 Hours will help you transform Minecraft® into anything you can imagine--and share your vision with millions of players worldwide! You’ll learn all the mod development skills you need as you walk through a complete step-by-step project, complete with a mob, new tools, new armor, food, ores, and much more. Every lesson builds on what you’ve already learned, giving you a rock-solid foundation for building any mod and creating any world!
Step-by-step instructions carefully walk you through the most common Minecraft® mod development tasks.
Quizzes and exercises at the end of each chapter help you test your knowledge.
Notes present interesting information related to the discussion.
Tips offer advice or show you easier ways to perform tasks.
Cautions alert you to possible problems and give you advice on how to avoid them.
Learn how to...
Minecraft Mod Development: Making Your First Item
Download the sample pages (includes Chapter 4 and Index)
Introduction¿¿¿1
Who Should Read This Book¿¿¿1
How This Book Is Organized¿¿¿2
Conventions Used¿¿¿4
Downloading the Code and Resources¿¿¿5
Part I: Introduction
HOUR 1: Setting Up the Minecraft® Development Environment¿¿¿7
Understanding How Minecraft® Is Written and What You Will Do with It¿¿¿7
Learning About Forge¿¿¿8
Setting Up the JDK¿¿¿9
Setting Up Eclipse¿¿¿16
Setting Up Forge¿¿¿16
Summary¿¿¿19
Q&A¿¿¿19
Workshop¿¿¿20
Exercises¿¿¿20
HOUR 2: Creating the Basics for Forge¿¿¿21
Understanding the Java in the ExampleMod¿¿¿21
Creating Your Own Package¿¿¿27
Creating Your Own Class File¿¿¿31
Creating the Mod File¿¿¿34
Summary¿¿¿35
Q&A¿¿¿35
Workshop¿¿¿36
Exercises¿¿¿36
HOUR 3: Working with Recipes and Other Small Modifications¿¿¿39
Learning About Recipes in Minecraft®¿¿¿39
Crafting a Recipe¿¿¿40
Creating a Shapeless Recipe¿¿¿44
Creating a Smelting Recipe¿¿¿¿45
Using Special ItemStacks¿¿¿46
Changing the Mob Spawn in a Dungeon¿¿¿48
Changing Chest Items¿¿¿49
Examining the Results in the Mod File¿¿¿49
Summary¿¿¿51
Q&A¿¿¿51
Workshop¿¿¿51
Exercises¿¿¿52
Part II: Items
HOUR 4: Making Your First Item¿¿¿53
Understanding What an Item Is¿¿¿53
Creating a Basic Item¿¿¿54
Summary¿¿¿65
Q&A¿¿¿65
Workshop¿¿¿65
Exercises¿¿¿66
HOUR 5: Creating Multiple Items in a Smart Way¿¿¿67
Adding Multiple Items Using the Same File¿¿¿67
Adding Metadata to Items¿¿¿72
Summary¿¿¿81
Q&A¿¿¿81
Workshop¿¿¿81
Exercises¿¿¿82
HOUR 6: Cooking Up a Food Item¿¿¿83
Understanding Food in Minecraft®¿¿¿83
Creating a Food Item¿¿¿84
Adding a Potion Effect¿¿¿89
Summary¿¿¿91
Q&A¿¿¿91
Workshop¿¿¿92
Exercises¿¿¿92
HOUR 7: Making Your Own Tools¿¿¿95
Creating a ToolMaterial¿¿¿95
Creating a Pickaxe¿¿¿96
Creating Special Tools for Harvesting Different Blocks¿¿¿103
Summary¿¿¿108
Q&A¿¿¿108
Workshop¿¿¿108
Exercises¿¿¿109
HOUR 8: Creating Armor¿¿¿111
Creating Your ArmorMaterial¿¿¿111
Creating the Armor¿¿¿112
Customizing Armor¿¿¿119
Summary¿¿¿119
Q&A¿¿¿120
Workshop¿¿¿120
Exercises¿¿¿121
Part III: Blocks
HOUR 9: Making Your First Block¿¿¿123
Understanding What a Block Is¿¿¿123
Creating a Basic Block¿¿¿124
Adding a Block Texture¿¿¿129
Summary¿¿¿132
Q&A¿¿¿132
Workshop¿¿¿133
Exercises¿¿¿134
HOUR 10: Creating Multiple Blocks in a Smart Way¿¿¿135
Adding Metadata to Blocks¿¿¿135
Adding Block Textures¿¿¿139
Summary¿¿¿143
Q&A¿¿¿144
Workshop¿¿¿144
Exercises¿¿¿144
HOUR 11: Making Your Blocks Unique¿¿¿145
Adding Sided Textures¿¿¿145
Making Half Blocks¿¿¿148
Creating a Plant¿¿¿152
Summary¿¿¿171
Q&A¿¿¿171
Workshop¿¿¿172
Exercises¿¿¿172
HOUR 12: Creating a Tile Entity¿¿¿175
Understanding What a Tile Entity Is¿¿¿175
Creating a Tile Entity Block¿¿¿176
Creating a Tile Entity¿¿¿180
Server Synchronization¿¿¿183
Summary¿¿¿193
Q&A¿¿¿193
Workshop¿¿¿193
Exercises¿¿¿194
Part IV: World Generation
HOUR 13: Generating Ores¿¿¿195
Using Forge and an EventHandler¿¿¿195
Creating a SamEventHandler¿¿¿195
Using OreDictionary¿¿¿202
Summary¿¿¿204
Q&A¿¿¿204
Workshop¿¿¿205
Exercises¿¿¿205
HOUR 14: Generating Plants¿¿¿207
Creating a Custom WorldGen Class¿¿¿207
Adding Code to SamEventHandler¿¿¿215
Summary¿¿¿220
Q&A¿¿¿220
Workshop¿¿¿220
Exercises¿¿¿221
HOUR 15: Using MCEdit¿¿¿223
Why Use MCEdit¿¿¿223
Getting MCEdit¿¿¿¿223
Using MCEdit¿¿¿225
Summary¿¿¿230
Q&A¿¿¿230
Workshop¿¿¿230
Exercises¿¿¿230
HOUR 16: Generating Your Structure¿¿¿231
Installing the Schematic Converter¿¿¿231
Using the Schematic Converter¿¿¿232
Adding Mobs to Your Structure¿¿¿240
Summary¿¿¿243
Q&A¿¿¿243
Workshop¿¿¿244
Exercises¿¿¿244
Part V: Entities
HOUR 17: Learning About Entities¿¿¿245
Understanding What an Entity Is¿¿¿245
Creating Proxies¿¿¿246
Creating a Basic Entity¿¿¿248
Summary¿¿¿251
Q&A¿¿¿251
Workshop¿¿¿251
Exercises¿¿¿251
HOUR 18: Creating an Entity Model Using Techne¿¿¿253
What Are Models?¿¿¿253
Downloading and Installing Techne¿¿¿254
Using Techne¿¿¿255
Summary¿¿¿263
Q&A¿¿¿263
Workshop¿¿¿263
Exercises¿¿¿264
HOUR 19: Coding a Mob¿¿¿265
Rendering the Mob¿¿¿265
Making the Mob Spawn¿¿¿272
Making EntitySamMob a Mob¿¿¿275
Summary¿¿¿281
Q&A¿¿¿281
Workshop¿¿¿282
Exercises¿¿¿282
HOUR 20: Creating a Throwable¿¿¿283
Registering a Throwable Entity¿¿¿283
Creating the Entity Class¿¿¿284
Using the Entity¿¿¿287
Rendering the Entity¿¿¿290
Summary¿¿¿293
Q&A¿¿¿293
Workshop¿¿¿294
Exercises¿¿¿294
Part VI: Final Pointers
HOUR 21: Editing Vanilla Minecraft®¿¿¿297
How to Change Minecraft® Indirectly¿¿¿297
Other Events¿¿¿303
Giving Your Armor Egg-Throwing Abilities¿¿¿303
Summary¿¿¿308
Q&A¿¿¿308
Workshop¿¿¿309
Exercises¿¿¿309
HOUR 22: Structuring Your Mod¿¿¿311
Why It Is Important to Structure Your Mod¿¿¿311
How to Structure Your Mod¿¿¿311
Summary¿¿¿322
Q&A¿¿¿322
Workshop¿¿¿322
Exercises¿¿¿323
HOUR 23: Releasing Your Mod¿¿¿325
Exporting Your Mod with Forge¿¿¿325
Making Your Mod Public¿¿¿328
Summary¿¿¿329
Q&A¿¿¿330
Workshop¿¿¿331
Exercises¿¿¿331
HOUR 24: What's Next¿¿¿333
Using IRC¿¿¿333
Using Open Source Mods¿¿¿336
Learning Java¿¿¿338
Summary¿¿¿339
Q&A¿¿¿339
Workshop¿¿¿339
Exercises¿¿¿339
APPENDIX A: Additional Code Fragments¿¿¿341
Configs¿¿¿341
Rotating Blocks¿¿¿342
Custom Block Rendering¿¿¿343
Custom Tree Generation¿¿¿350
Automatic Update Checking¿¿¿353
Custom Creative Tabs¿¿¿356
Custom TNT¿¿¿357
Changing Mob Behavior¿¿¿363
Clothes¿¿¿364
Armor Effects¿¿¿365
Creating a Custom Dimension¿¿¿367
Custom Biomes¿¿¿383
Custom AI¿¿¿384
Spawning Particles¿¿¿390
Playing Sounds¿¿¿391
Using a Model for an Item¿¿¿391
Index¿¿¿395