Seriously, is it possible to remove items from the player's inventory through ModPE? I know you can do
addItemInventory(id,-count);
but this method leaves a "ghost" item in the inventory. If I remove a diamond sword with this method, there would be a "ghost" diamond sword. When I say "ghost" items, I mean when you hold the item all you see is your hand, and when you tap a block with the ghost item it FINALLY disappears completely. It there another method that can achieve what I want to do?
That could also work, but then you would have to use getInventorySlot for all the slots, till you found the item you were looking for. Might be more efficient but still a lot of coding.
Edit:
But I suppose you could always loop the getInventorySlot.
Make 2 vars, one for what item, and another for how much. The 1st one have it be the id # of the item(Use getInventorySlot), and the 2nd is the current amount - 1 . then call on them in place of the item id and the amount! +1 if I helped.
Rollback Post to RevisionRollBack
Please click that little green button down there to if I helped!
I think setCarriedItem() would be better. It's the player's fault if they enchant a stack of 64 diamond sword and lose all of it. Thanks for the help guys!
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
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]
That could also work, but then you would have to use getInventorySlot for all the slots, till you found the item you were looking for. Might be more efficient but still a lot of coding.
Edit:
But I suppose you could always loop the getInventorySlot.
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Please click that little green button down there to if I helped!
I think setCarriedItem() would be better. It's the player's fault if they enchant a stack of 64 diamond sword and lose all of it.
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]