(btw I'm going off of ModPE Scripts functions b/c I am not an MCPE modder, but rather a PC modder, the languages used are basically the same, but I do not know if the functions I am using are still there)
function useItem(x, y, z, itemId, blockId, side, itemDamage, blockDamage) {
if(itemId == (id of your custom item)){
// particleId is the particle you want for when the item is used, particles are given an id based on what I can tell from the Mod PE Scripts
A double is basically a decimal point, and is ALWAYS a decimal point (ex: 0.8, 1.1), and an int is basically a whole number (ex: 1, 10). For more info look here: http://www.w3schools.com/js/js_numbers.asp
For the Mod PE Scripts functions look here although I think it is outdated:
I need help setting particles around the player when a item is used or used to tap a block
HipmanMcpe
I'm not sure but I think it is just this:
(btw I'm going off of ModPE Scripts functions b/c I am not an MCPE modder, but rather a PC modder, the languages used are basically the same, but I do not know if the functions I am using are still there)
function useItem(x, y, z, itemId, blockId, side, itemDamage, blockDamage) {
if(itemId == (id of your custom item)){
// particleId is the particle you want for when the item is used, particles are given an id based on what I can tell from the Mod PE Scripts
Level.addParticle(int particleId, double sizeX, double sizeY, double sizeZ, double velocityX, double velocityY, double velocityZ, double particleSize);
}
}
A double is basically a decimal point, and is ALWAYS a decimal point (ex: 0.8, 1.1), and an int is basically a whole number (ex: 1, 10). For more info look here: http://www.w3schools.com/js/js_numbers.asp
For the Mod PE Scripts functions look here although I think it is outdated:
https://github.com/Connor4898/ModPE-Scripts/wiki/ModPE-Scripts-Functions-List#hook-functions-1