When I use the code below and I tap with a sapling its supposed to increase var full by 0.125 and when I do this Ingame it doesn't increase at all. Whats going on here??
function useItem (x, y, z, itemId, blockId, side)
{
var data = Player.getCarriedItemData();
var item = Player.getCarriedItem();
if (blockId == 207)
{
var full = 0;
var a = [6,18]; //0.125
var b = [296,391,392,393,394,344,338]; //0.08
var c = [297,400]; //0.16
var d = [37,38,39,40,260,81,106,111,372]; //0.10
var e = [319,320,363,364,365,366]; //0.02
var f = [360]; //0.04
var g = [103,86,91]; //1
if(a.indexOf(item)>=0)
{
full + 0.125;
addItemInventory(item,-1,data);
}
if(b.indexOf(item)>=0)
{
full + 0.08;
addItemInventory(item,-1,data);
}
if(c.indexOf(item)>=0)
{
full + 0.16;
addItemInventory(item,-1,data);
}
if(d.indexOf(item)>=0)
{
full + 0.10;
addItemInventory(item,-1,data);
}
if(e.indexOf(item)>=0)
{
full + 0.02;
addItemInventory(item,-1,data);
}
if(f.indexOf(item)>=0)
{
full + 0.04;
addItemInventory(item,-1,data);
}
if(g.indexOf(item)>=0)
{
full + 1;
addItemInventory(item,-1,data);
}
if(full >= 1)
{
Level.dropItem(x, y, z,0.5,3,1,0);
full -1;
}
}}
By the way this is used in my ex nihilo pe mod. Om trying to add the compost for the barrels correctly.
function useItem (x, y, z, itemId, blockId, side) { var data = Player.getCarriedItemData(); var item = Player.getCarriedItem(); if (blockId == 207) { var full = 0; var a = [6,18]; //0.125 var b = [296,391,392,393,394,344,338]; //0.08 var c = [297,400]; //0.16 var d = [37,38,39,40,260,81,106,111,372]; //0.10 var e = [319,320,363,364,365,366]; //0.02 var f = [360]; //0.04 var g = [103,86,91]; //1 if(a.indexOf(item)>=0) { full + 0.125; addItemInventory(item,-1,data); } if(b.indexOf(item)>=0) { full + 0.08; addItemInventory(item,-1,data); } if(c.indexOf(item)>=0) { full + 0.16; addItemInventory(item,-1,data); } if(d.indexOf(item)>=0) { full + 0.10; addItemInventory(item,-1,data); } if(e.indexOf(item)>=0) { full + 0.02; addItemInventory(item,-1,data); } if(f.indexOf(item)>=0) { full + 0.04; addItemInventory(item,-1,data); } if(g.indexOf(item)>=0) { full + 1; addItemInventory(item,-1,data); } if(full >= 1) { Level.dropItem(x, y, z,0.5,3,1,0); full -1; } }}By the way this is used in my ex nihilo pe mod. Om trying to add the compost for the barrels correctly.
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Follow @Darth377Apps
Please check out my Twitter account!

I have been working on a few games!
Give me ALL THE INTERNETS!
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumfull + number here, it should be
full += number.
Same with full - number, it should be
full -= number.
Though it shouldnt really matter, you should make the variables global.
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015