Continuing on with my Mod script development training, I am trying to create a simple script to add items to the inventory in creative mode. Basically, if I use the Iron sword, then 3 Diamond Swords get added to the inventory and a message is printed for the same.
I enable the script and drop into a world where I test things out. I use the Iron sword, I see the message printed about the Diamond swords being added, but when I check my inventory, I do not see 3 Diamond swords added. I think I am doing this correctly, but maybe I am not understanding the game play correctly?
/*BensDad2007 MCPE mod practice*/
function useItem(x, y, z, itemId, blockId, side, data){
/* if the item used is an iron sword, then add 3 diamond swords to inventory */
if(itemId == 267) {
You are doing it correctly, but the creative inventory works differently from the survival inventory. You will have to restart BlockLauncher to see any additions made. Also, you cannot add more than one item or block of the same type at a time.
I changed the amount of Diamond swords being added down to one; added the new script; re-started block launcher; went into the world again but the same results. I use the Iron sword, I see the message print, but no Diamond sword added to my inventory. Here is a snapshot of the weapon inventory. I also checked the other inventory sections and do not see the new sword added there either.
Ok, so I did have an example for you, but there must be something wrong with blocklauncher!
Im having the SAME problem and I made a more creative items mod!
Sorry I couldnt help. I would love to see your mod, though.
Continuing on with my Mod script development training, I am trying to create a simple script to add items to the inventory in creative mode. Basically, if I use the Iron sword, then 3 Diamond Swords get added to the inventory and a message is printed for the same.
I enable the script and drop into a world where I test things out. I use the Iron sword, I see the message printed about the Diamond swords being added, but when I check my inventory, I do not see 3 Diamond swords added. I think I am doing this correctly, but maybe I am not understanding the game play correctly?
/*BensDad2007 MCPE mod practice*/
function useItem(x, y, z, itemId, blockId, side, data){
/* if the item used is an iron sword, then add 3 diamond swords to inventory */
if(itemId == 267) {
Player.addItemCreativeInv(276, 3, 0);
clientMessage("Added 3 Diamond Swords!");
}
}
https://www.dropbox.com/l/hWAKOlGbEnnHpY1vnFdzKp
Im having the SAME problem and I made a more creative items mod!
Sorry I couldnt help. I would love to see your mod, though.