If you would like to see the full particles list, click here.
Need further help or a better tutorial? Click here!
Make particles appear when a block is tapped
//In this example, we are going to tap a stone block to make lava particles appear
function useItem(x, y, z, blockId, side){
if(blockId == 1){ //Stone Block
Level.addPartcle(ParticeType.lava, x, y, z, 1, 1, 1, 5);
}
}
//This also works for custom blocks just change the blockid to the id of the custom block
#2 Adding Items To Creative Inventory - goldowl37
Short Introduction
To add Items to the Creative Inventory, we use:
Player.addItemCreativeInv(itemId, amount, data);
You can also add modded items. But for this tutorial, we will add 1 grass to the crreative inventory. (Please note set the amount to 1 or it may crash!)
//In this example, we are going to define a block called awesome thing, with the texture of dirt, then we will make it go into the creative inventory when the player opens up a world
function newLevel(){
Block.defineBlock(180, "Awesome Thing", "dirt");
Player.addItemCreativeInv(180, 1, 0);
}
//This will add that block we just made to the creative inventory! Sometimes you will have to look through all tabs, but thats alright!
var modVersion = "Your mod version here (you can also do 1.0 build 1 or something like that)";
function modTick() {
ModPE.showTipMessage(modName+" "+modVersion);
}
This will allow you to make a custom tipMessage for your mod name and version. If you want to make it only show up after joining the world, change the modTick into newLevel.
To add particles, we use Level.addParticle:
Level.addParticle(particleType, double x, double y, double z, double velX, double velY, double velZ, double size);
If you would like to see the full particles list, click here.
Need further help or a better tutorial? Click here!
//In this example, we are going to tap a stone block to make lava particles appear
function useItem(x, y, z, blockId, side){if(blockId == 1){ //Stone Block
Level.addPartcle(ParticeType.lava, x, y, z, 1, 1, 1, 5);
}
}
//This also works for custom blocks just change the blockid to the id of the custom block
#2 Adding Items To Creative Inventory - goldowl37
To add Items to the Creative Inventory, we use:
Player.addItemCreativeInv(itemId, amount, data);
You can also add modded items. But for this tutorial, we will add 1 grass to the crreative inventory. (Please note set the amount to 1 or it may crash!)
Need further help? ClICK ME
//In this example, we are going to define a block called awesome thing, with the texture of dirt, then we will make it go into the creative inventory when the player opens up a world
function newLevel(){
Block.defineBlock(180, "Awesome Thing", "dirt");
Player.addItemCreativeInv(180, 1, 0);
}
//This will add that block we just made to the creative inventory! Sometimes you will have to look through all tabs, but thats alright!
For more In-depth Tutorials,, check out THIS page
Dude make a native mod tutorial please.
ModPE is(almost)useless
Also,you should do:
function newLevel(){
if(ModPE.getMinecraftVersion()<=0.10.5){
Block.defineBlock(180, "Emerald Block", "emerald_block");
Block.defineBlock(181, "Emerald Ore", "emerald_ore");
ModPE.setItem(410, "emerald", 0, "Emerald");
clientMessage("You are on 0.8.1. Defining emerald stuff....");
{
else if(ModPE.getMinecraftVersion()>=0.10.5){
clientMessage("You already have emeralds :D");
}
}
Note:gear=armor or weapon
Sorry but i dont know native modding. Byteandahalf has an aepic tutorial though! Go chexk t out!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumEhm, the only problem is that ModPE.getMinecraftVersion() isn't available for MCPE 0.8.X and 0.9.X, it was only added in BL 1.8.X.
... Got anything to contribute? Like simple stuff for newbies
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumvar modName = "Your mod name here";
var modVersion = "Your mod version here (you can also do 1.0 build 1 or something like that)";
function modTick() {
ModPE.showTipMessage(modName+" "+modVersion);
}
This will allow you to make a custom tipMessage for your mod name and version. If you want to make it only show up after joining the world, change the modTick into newLevel.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumLevel.addParticle(int particleType, double x, double y, double z, double velX, double velY, double velZ, double size);
Example:
Level.addParticle(ParticleType.lava, Player.getX, Player.getY, Player.getZ, 1, 1, 1, 5);
I have added this to the thread
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCustom mob + spawn egg
ModPE.setItem(500,"spawn_egg",7,"Spawn Zombie Player");
Player.addItemCreativeInv(500,1,0);
function useItem(x, y, z, itemId, blockId, side){
if(itemId == 500){
var zombie = Level.spawnMob(x,y+1,z,32,"mob/zombie.png");
Entity.setRenderType(zombie,3);
}}
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThis will help to check if a ModPE function is available on the used BlockLauncher: http://www.minecraftforum.net/forums/minecraft-pocket-edition/mcpe-mods-tools/mcpe-mod-tool-discussion/1987720-designing-for-multiple-launchers-how-to-detect
Im not quite sure. It could me var block = Block.defineBlock(id, name, texture)
Level.addParticle(ParticleType.lava, block.getX, block.getY, block.getZ, 1, 1, 1, 5);
Im not sure though.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThis will allow you to spawn particles when you tap a specific block:
Block.defineBlock(254,"My block","diamond_block",0);
function useItem(x, y, z, itemId, blockId, side){
if(blockId==254){
Level.addParticle(ParticleType.lava, x, y, z, 1, 1, 1, 5);
}
}
This will allow you to spawn particles when you look at a specific block:
Block.defineBlock(254,"My block","diamond_block",0);
function modTick(){
var blockId = Player.getPointedBlock();
var x = Player.getPointedBlockX();
var y = Player.getPointedBlockY();
var z = Player.getPointedBlockZ();
if(blockId==254){
Level.addParticle(ParticleType.lava, x, y, z, 1, 1, 1, 5);
}
}
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumshut up smarty pants xD
http://www.minecraftforum.net/account/profile
How do we add that white background to a post for pasting in code?
UPDATED: Added peacestorm's template for touching a block to create lava particles and added a shoort introduction to adding particles
If you copy-paste anything, it sets the white background.
WHat do you guys want next?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumUse
in BB code.