So. I'm still working on my horror map inspired by EarthBound and Its counterpart the Haloween Hack by Toby Fox, and I'm trying to add A SHOP MOD to the game. Coding it myself, I'd appreciate it if someone who knows can tell me a better method. For example, the money mod has a system where it can allow you to kill mobs and has a invisible variable that increases your money, like EarthBound. However, as a knob in javascripting, I just added shop blocks and money, money dropped from mobs. So, can someone tell me how to add invisible variables like the all famous money mod? The other solution is this:
Either you don't know much about JS or you didn't post the whole code but anyway...
Block.defineBlock(201, "Shop Block 1", [["stone", 6],["stone", 6],["piston_inner", 0],["stone", 6], ["stone", 6],["stone", 6]], 1, 1, true);
Player.addItemCreativeInv(201,1,0);
ModPE.setItem(370, "sunflower_additional", 0, "Gold Coin",64);
function useItem(x, y, z, i, b, s){
if(i == 370){
//add code here
}
}
You had a lot of open curvy braces and a number in the item function, I suggest you look into taking the JavaScript course on CodeCademy it's free and online, just google it
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So. I'm still working on my horror map inspired by EarthBound and Its counterpart the Haloween Hack by Toby Fox, and I'm trying to add A SHOP MOD to the game. Coding it myself, I'd appreciate it if someone who knows can tell me a better method. For example, the money mod has a system where it can allow you to kill mobs and has a invisible variable that increases your money, like EarthBound. However, as a knob in javascripting, I just added shop blocks and money, money dropped from mobs. So, can someone tell me how to add invisible variables like the all famous money mod? The other solution is this:
Block.defineBlock(201, "Shop Block 1", [["stone", 6],["stone", 6],["piston_inner", 0],["stone", 6], ["stone", 6]]);
Player.addItemCreativeInv(201,1,0);
{
ModPE.setItem(370, "sunflower_additional", 0, "Gold Coin");
function useItem(x, y, z, 201, side, data){
if(itemId == 370){
function getCarriedItem(minecraft:strong_healing);
{
{
Can someone help me debug this, or tell me how to add invisible variables?
Either you don't know much about JS or you didn't post the whole code but anyway...
Block.defineBlock(201, "Shop Block 1", [["stone", 6],["stone", 6],["piston_inner", 0],["stone", 6], ["stone", 6],["stone", 6]], 1, 1, true); Player.addItemCreativeInv(201,1,0); ModPE.setItem(370, "sunflower_additional", 0, "Gold Coin",64); function useItem(x, y, z, i, b, s){ if(i == 370){ //add code here } }You had a lot of open curvy braces and a number in the item function, I suggest you look into taking the JavaScript course on CodeCademy it's free and online, just google it