I need some help with some gui. Here are my questions.
1. I want a gui to open up when I touch a block (if possible I want a way in the function useItem to do this)
2. I want my gui to have a interference just like mcpe gui like the gui for the chest, crafting table, etc.
3. How do I make a new gui that keeps track of stuff like a exp bar
4. What code is the opposite of Player.addItemInventory (a code that takes way a certain item.
5. Finally what is the code that detects the item you are holding (I want the gui to scan the item you are holding and trade that item for a upgraded version)
I know lots of questions....
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
I need some help with some gui. Here are my questions.
1. I want a gui to open up when I touch a block (if possible I want a way in the function useItem to do this)
2. I want my gui to have a interference just like mcpe gui like the gui for the chest, crafting table, etc.
3. How do I make a new gui that keeps track of stuff like a exp bar
4. What code is the opposite of Player.addItemInventory (a code that takes way a certain item.
5. Finally what is the code that detects the item you are holding (I want the gui to scan the item you are holding and trade that item for a upgraded version)
I know lots of questions....
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
http://minecraftnoobtest.com/test.php
-
View User Profile
-
View Posts
-
Send Message
Curse Premium1. You´ll see that GUIs should be functions so you just call these in the hook.
2. You have to make more GUIs, one for the background and one for a button... (Templates: https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates App with templates: https://play.google.com/store/apps/details?id=com.KillerBLS.modpeide&hl=de)
3. The App includes a GUI for a progress bar, or you make one GUI for each progress and change them.
4. You can use -1 as Count in the function, but that´ll leave a ghost item if you removed the last item, so I made a function for that.
function removeItem(theId, theDamage){
for(var i=0; i<45; i++) {
if(Player.getInventorySlot(i)==theId && Player.getInventorySlotData(i)==theDamage){
var theCount=Player.getInventorySlotCount(i);
Player.clearInventorySlot(i);
if(theCount>0)
addItemInventory(theId, theCount, theDamage);
break;
}
}
}
5. You have to use modTick():
function modTick(){
if(Player.getCarriedItem()==YourId){
//do something (call a GUI (over a function))
}
}
Thanks Man! +1 for you!
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
http://minecraftnoobtest.com/test.php