Repository navigation
ModPE
Mrkwtkr edited this page Apr 16, 2018
·
4 revisions
function ModPE.joinServer(serverAddress, port);
- (String)
serverAddress: The desired IP of the server - (Integer)
port: The desired port of the server - Deprecated (shows toast "Nag: update to Server.joinServer"), use Server.joinServer instead
function ModPE.langEdit(key, value);
- No information available
function ModPE.leaveGame();
- Quits to the title screen
- Will stop executing scripts one tick after this function has been called
- Accepts no parameters
function ModPE.log(str);
- (String)
str: Writes this text into the android log - Writes the desired text into the android log, named as "MCPELauncherLog"
- This log can be read by apps, such as [CatLog] (https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CDEQFjAA&url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.nolanlawson.logcat&ei=oC2EU6e-A8a0PPmXgZgL&usg=AFQjCNGZ3_dD8mrfwZ5XAJr3j5FRyrbsew&sig2=TOM4NBjsUjCK2Tt6giMBmA)
function ModPE.overrideTexture(url, textureName);
- (String)
textureName: The name of the texture to override. - (String)
url: The URL of an image.
function ModPE.readData(name);
- (String)
name: The name of the desired data to access - This returns the value saved via
ModPE.saveData - This only reads data that is saved by a script of the same name
function ModPE.removeData(name);
- (String)
name: The name of the desired data to erase - This deletes the value saved via
ModPE.saveData - This only erases data that is saved by a script of the same name
function ModPE.resetImages();
- Resets all textures to the default one, found in the current texture pack
- Accepts no parameters
function ModPE.saveData(name, value);
- (String)
name: The name of the data that will be saved - (String)
value: The data that will be saved - This can save any string
- Will keep data saved even if leaving a world or quitting BlockLauncher
function ModPE.selectLevel(levelDir, levelName, levelSeed, gamemode);
- No information available
function ModPE.setCamera(entityId);
- No information available
function ModPE.setFoodItem(id, iconName, iconSubindex, halfHearts, name, maxStack);
- (Integer)
id: The ID of the new item - (String)
iconName: The name of the desired icon - (Integer)
haldHearts: How many half hearts are restored when eaten - (Integer)
iconSubindex: ---Unknown--- - (String)
name: The name of the new item - (Integer)
maxStack: The maximum amount of new items in one stack - This creates new edible items, with custom textures, and custom names
- The
iconNameparameter is based on the names of MCPE's textures - The textures can be found in the
items_opaque.pngfound in the MCPE assets
function ModPE.setGameSpeed(ticksPerSecond);
- (Integer)
ticksPerSecond: The desired speed of the game, in ticks - This changes the speed of the current world, and all of its patched scripts
- This is 20 as default, and increasing this will speed up everything in-game
- Using this function will reduce the time taken for modTick to execute code
function ModPE.setItem(id, iconName, iconSubindex, name, maxStack);
- (Integer)
id: The ID of the new item - (String)
iconName: The name of the desired icon - (Integer)
iconSubindex: ---Unknown--- - (String)
name: The name of the new item - (Integer)
maxStack: The maximum amount of new items in one stack - This creates new items, with custom textures, and custom names
- The
iconNameparameter is based on the names of MCPE's textures - The textures can be found in the
items_opaque.pngfound in the MCPE assets
function ModPE.setItems(url);
- (String)
url: Changes the texture of items using the image at the specified URL.
function ModPE.setTerrain(url);
- (String)
url: Changes the texture of all terrain blocks with the image at the specified URL.
function ModPE.showTipMessage(text);
- (String)
text: The desired text to be shown - This displays text above the hotbar
- This text eventually fades, unless this is constantly executed
function ModPE.takeScreenshot(fileName);
- (String)
fileName: The name of the saved screenshot - This takes a screenshot using BlockLauncher's screenshot feature
function ModPE.getLanguage();
- This returns the current language of the game
ModPE.joinServer(serverAddress, port);
ModPE.langEdit(key, value);
ModPE.leaveGame();
ModPE.log(str);
ModPE.overrideTexture(url, textureName);
ModPE.readData(name);
ModPE.removeData(name);
ModPE.resetImages();
ModPE.saveData(name, value);
ModPE.selectLevel(levelDir, levelName, levelSeed, gamemode);
ModPE.setCamera(entityId);
ModPE.setFoodItem(id, iconName, iconSubindex, halfHearts, name, maxStack);
ModPE.setGameSpeed(ticksPerSecond);
ModPE.setGuiBlocks(url);
ModPE.setItem(id, iconName, iconSubindex, name, maxStack);
ModPE.setItems(url);
ModPE.setTerrain(url);
ModPE.showTipMessage(text);
ModPE.takeScreenshot(fileName);