Minecraft Pocket Edition: program your own mods
We'll show you step by step how to program your own mods for Minecraft Pocket Edition. So you can expand the well-known game according to your preferences.
Minecraft Pocket Edititon: Programming Mods - The Preparations
To be able to program mods you need a program that can create Java scripts. We will show you all the steps again in the picture gallery at the end of the article.
- You can use Visual Studio, for example, which is a very extensive program for programming.
- Alternatively, you can also use the somewhat simpler Notepad ++.
- If you don't have a computer at hand, the DroidEdit app is recommended for programming.
Minecraft Pocket Edition Mods: Add Blocks & Items
First of all we would like to show you how you can add your own blocks and items.
- To create a new item, write »ModPE.setItem («. Then write the ID of the item in brackets. Make sure that the ID has not yet been assigned. Then write the texture of the item in quotation marks and a 0 for the damage. Finally, write the name of the item in quotation marks, add the closing bracket and a semicolon. In our case, the command is: »ModPE.setItem (467, " apple ", 0, " THE REAL APPLE ");".
- The next step is to add a new food that can also restore hearts. Instead of »ModPE.setItem («, »ModPE.setFoodItem« is written at the beginning and in brackets an additional value for the number of half hearts that are to be restored is added. In our case, the completed command is »ModPE.setFoodItem (468, "bread", 0, 15, "Yummy Food"); «.
- Finally, a new block should be added. To do this, write "Block.defineBlock (" and then again an ID and the name in quotation marks. Then a square bracket is opened and the texture and a 0 are added. Since only this texture is to be used, we add Add two more square brackets: In our case the command is: »Block.defineBlock (469, " Example ", [[" bedrock ", 0]]);«.
- However, do not forget to specify how long it should take for your block to be destroyed. For example, you can use the command "Block.setDestroyTime (469, 2);". The 2 stands for time in this example. Number 469 is the ID.
MCPE mods: set categories and edit inventory
In order for all mods to work properly, you need to set a category for your newly added things and edit the creative inventory:
- To set a category, write "Item.setCategory (", in the brackets the ID as well as "ItemCategory." And the category. You can use the category "TOOL", "FOOD", "MATERIAL", "DECORATION" or " INTERNAL. "In our case, we used the command" Item.setCategory (467, ItemCategory.TOOL); "Don't forget to repeat this step for all the things you added.
- Finally, your items and blocks should also be displayed in the creative inventory. Write "Player.addItemCreativeInv (", in brackets the ID and a 1 and a 0 in our example. In our example we wrote the command "Player.addItemCreativeInv (467, 1, 0);". Repeat this step for everyone new items and blocks.
Minecraft Pocket Edition: Own crafting and oven recipe
Finally, we will show you how to create your own crafting and oven recipe.
- To create a crafting recipe, you can use the command »Item.addShapedRecipe (468, 1, 0, [" i ", " i ", " i "], [" i ", 3, 0]);«, The 468 is the ID of the item that should come out afterwards. The 1 is the number and the 0 again stands for Damage. Between the first square brackets you will find the three rows of the crafting table. Wherever there is a space, the field is left blank. The "i" is a variable and stands for an item in Minecraft whose ID is defined between the second square brackets. In this case, this is a 3. Again, a 0 is added.
- Creating an oven recipe is a little easier. For example, you can use the command »Item.addFurnaceRecipe (468, 5, 1);«. The 468 is the ID of the item to be put in the oven and the 5 is the ID of the item that is coming out. The 1 stands for the number.
MCPE: Test your own mod
Now that you have programmed your own mods, you can test them. To do this, first save your mod as a js file, i.e. as a Java script.
- Now you need an app with which you can test the mod. MCPE Master or BlockLauncher is recommended. Just import the Java scripts as a new mod.
- Now you can easily test your mod in Minecraft Pocket Edition.
- Tip: You will find all the steps again in our picture gallery.
The 5 best Minecraft mods for the PC version
In the next practical tip we will give you an introduction to the Minecraft mod "Mystcraft".
$config[ads_text5] not found