Not really what I meant. Let's say there's a certain coordinate you need to tap to run an action.
I'm making a mod (it's a secret) and I need it to run an action. Like if you tapped on a cole ore it would set time to day. Something like that. The function could also open the crafting tablel, funace, etc...
just use
if(blockId==coal blockId)
{
code to run here
}
I understand arjay_70. He means to for example simulate a furnace touched. Or to make a block simulate being touched, click or fingerOver (lighter color for norm blocks, black rectangle for signs). He means to use simTouch() as a DO fx, not HOOK fx.
And also, I think what most of us expect on hook fxs is all the events (non-multiplayer of course) in PocketMine, i.e.
I can be found on Freenode IRC channels #pocketmine, #ModPEScripts, #LegendOfMCPE, #pmplugins or #BeaconMine.
I am a PocketMine-MP plugin developer. I hate it when people think that I love stupid admin positions. Being an admin is nothing compared to being a plugin developer.
I am also a main developer of BlockServer, a work-in-progress MCPE server software. You are welcome to download it, but it so far onlly spawns you in the upther (above the world). You can chat, though.
I do not own this server but I just love to put this banner here:
Will the new GUI Ststem be adding Java to ModPE? Or are we gonna keep it Javacript?
Java Code:
int posX, posY;
String img;
//Set position of button to corner
posX=5
posY=5
//Button's image path
//ModPE object calls a ModPE function
img = ModPE.Level.getWorldDir() + "btn.png";
Button btn = new Button(posX, posY, img);
btn.setText("Blah");
btn.onClick(ModPE.clientMessage("Button was pressed"));
Help . . please . . i CAnt Use The Block launcher . . when i try to open it its just stock on black scrren and aa message pop up like . . "Block launcher Stops " any Help ? please . . im using jellybean 4.1.1 . . weLL
No. We will keep it in JavaScripts. The code will look like:
var posX, posY;
posX=5;
posY=5;
var btn = GUI.makeButton(x, y, sizeX, sizeY, "A");
GUI.setButtontText("Blah");
GUI.setOnClick(fnc);
function fnc(){
clientMessage("Button was pressed");
}
Ok but shouldn't it be like:
var posX, posY;
posX=5;
posY=5;
var btn = new GUI(Button); //Can be GUI(Menu) or GUI(TextView) or something like that
//The button can now be built
btn.create(posX, posY, sizeX, sizeY, "A"); //More flexible for other elements
btn.setButtontText("Blah");
btn.setOnClick(fnc);
function fnc(){
clientMessage("Button was pressed");
}
And would button/text/other images be accessible through texturepacks as well?
if(blockId==coal blockId)
{
code to run here
}
um... no
BlockID is for useItem...
-
View User Profile
-
View Posts
-
Send Message
Curse Premium"touching a coordinate to activate an action" - that's exactly what useItem does.
I mean simTouch would specify a coordinate and simulate a touch at that coordinate. The player doesn't do it but the script does.
And also, I think what most of us expect on hook fxs is all the events (non-multiplayer of course) in PocketMine, i.e.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumKing of Page 64
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
Java Code:
int posX, posY; String img; //Set position of button to corner posX=5 posY=5 //Button's image path //ModPE object calls a ModPE function img = ModPE.Level.getWorldDir() + "btn.png"; Button btn = new Button(posX, posY, img); btn.setText("Blah"); btn.onClick(ModPE.clientMessage("Button was pressed"));This doesn't seem to work:
function useItem(x, y, z, itemId, blockId, side){ if(blockId == 3){ clientMessage("/grow " + x + " " + y + " " + z); } } function procCmd(command){ var cmd = command.split(" "); if(cmd[0] == "grow"){ Level.setTile(parseInt(cmd[1]), parseInt(cmd[2]), parseInt(cmd[3]), 2); } }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNo, clientMessage only prints to the local console. In this case, you can just do
procCmd("grow " + x + " " + y + " " + z)since the command's in your own script.
There's no supported way to simulate a chat message yet - I will add one soon.
Ok thanks
Ok but shouldn't it be like:
var posX, posY; posX=5; posY=5; var btn = new GUI(Button); //Can be GUI(Menu) or GUI(TextView) or something like that //The button can now be built btn.create(posX, posY, sizeX, sizeY, "A"); //More flexible for other elements btn.setButtontText("Blah"); btn.setOnClick(fnc); function fnc(){ clientMessage("Button was pressed"); }And would button/text/other images be accessible through texturepacks as well?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumMind PMing your APK to me?
If you have multiple scripts enabled can one script call a function from the other?