I would like to know how modpe works. I mean what i dont get is how we are using functions that we dont even created. For example getPlayerX(); ok, Its NOT a function that is allready built in on javaScript(Js). SO Where Does those functions COME FROM. .
See my reply to the other thread.when you call a method in JS, his code runs, which calls the original MCPE code.
oh... What's the link to the thread ?. Thank you very much(everyone) for helping and supporting this topic. This was a good explanation 500 I.S.E. I was looking at mcpeLauncher SRC code and I saw ScriptManager.java and it has all the methods.
public static void useItemOnCallback(int x, int y, int z, int itemid, int blockid, int side, int itemDamage, int blockDamage) {
callScriptMethod("useItem", x, y, z, itemid, blockid, side, itemDamage, blockDamage);
}
But where is getting those objects from ? (What is the location (on MCPELauncher.apk)). Like for example blockId, where is that object at. Like where is the real object that mcpe has?(I hope I'm not confusing someone)
oh... What's the link to the thread ?. Thank you very much(everyone) for helping and supporting this topic. This was a good explanation 500 I.S.E. I was looking at mcpeLauncher SRC code and I saw ScriptManager.java and it has all the methods.
public static void useItemOnCallback(int x, int y, int z, int itemid, int blockid, int side, int itemDamage, int blockDamage) {
callScriptMethod("useItem", x, y, z, itemid, blockid, side, itemDamage, blockDamage);
}
But where is getting those objects from ? (What is the location (on MCPELauncher.apk)). Like for example blockId, where is that object at. Like where is the real object that mcpe has?(I hope I'm not confusing someone)
In the /jni directory. You need to learn native android support NDK for that because MCPE is close-source.
oh... What's the link to the thread ?. Thank you very much(everyone) for helping and supporting this topic. This was a good explanation 500 I.S.E. I was looking at mcpeLauncher SRC code and I saw ScriptManager.java and it has all the methods.
public static void useItemOnCallback(int x, int y, int z, int itemid, int blockid, int side, int itemDamage, int blockDamage) {
callScriptMethod("useItem", x, y, z, itemid, blockid, side, itemDamage, blockDamage);
}
But where is getting those objects from ? (What is the location (on MCPELauncher.apk)). Like for example blockId, where is that object at. Like where is the real object that mcpe has?(I hope I'm not confusing someone)
Check jni/modscript.c. BlockLauncher changes libminecraftpe so it points to our native library instead. From there BlockLauncher's C code (and C++ code) calls those callback methods via Java Native Interface.
Check jni/modscript.c. BlockLauncher changes libminecraftpe so it points to our native library instead. From there BlockLauncher's C code (and C++ code) calls those callback methods via Java Native Interface.
ight thank you. And if you need help on something (obviously I know yall know more then me), please let me know.
The source code of Rhino is here. It is coded in java so it is easy to understand, IF YOU CAN FIND THE STARTING POINT. (because I can't) https://github.com/m...illa/javascript
Feeling confused how can you call functions you didn't define? Then tell me, when you type
javascript:alert("Your computer will explode in ten seconds lol pratical joke");
in the web address bar in your browser why can you call the alert(); function without defining it?
the same for you. And btw nice joke!!! Hehe . and I will try looking for the main class (starting point).
Rollback Post to RevisionRollBack
10% Love
80% Life
8% Loner
1% Stupid
Equals 100%
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumSee my reply to the other thread.
when you call a method in JS, his code runs, which calls the original MCPE code.
public static void useItemOnCallback(int x, int y, int z, int itemid, int blockid, int side, int itemDamage, int blockDamage) { callScriptMethod("useItem", x, y, z, itemid, blockid, side, itemDamage, blockDamage); }But where is getting those objects from ? (What is the location (on MCPELauncher.apk)). Like for example blockId, where is that object at. Like where is the real object that mcpe has?(I hope I'm not confusing someone)In the /jni directory. You need to learn native android support NDK for that because MCPE is close-source.
BlockLauncher uses Rhino by Mozilla.
You can check the functions at https://github.com/connor4898/modpe-scripts/wiki/modpe-scripts-functions-list (Connor4898 is getting famous because of this I think lol)
The source code of Rhino is here. It is coded in java so it is easy to understand, IF YOU CAN FIND THE STARTING POINT. (because I can't)
https://github.com/mozilla/rhino/tree/master/src/org/mozilla/javascript
Feeling confused how can you call functions you didn't define? Then tell me, when you type
javascript:alert("Your computer will explode in ten seconds lol pratical joke");in the web address bar in your browser why can you call the alert(); function without defining it?2. Porting MCPC functions to MCPE by ModPE 3. PocketMine Plugin: PocketMine ModPE! 4. PocketMine Servers: Capture Nether Reactor 5. Chunk Claimers (like factions as a mini-game)
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCheck jni/modscript.c. BlockLauncher changes libminecraftpe so it points to our native library instead. From there BlockLauncher's C code (and C++ code) calls those callback methods via Java Native Interface.
the same for you. And btw nice joke!!! Hehe . and I will try looking for the main class (starting point).