THIS GUIDE IS EXTREMELY OUTDATED. NOW, IN BLOCKLAUNCHER, YOU CAN GO TO: Settings > Nerdy Stuff > Dump ModPE Methods
However, if you really don't give half a potato for some reason, here it is:
/*
The hooks:
*/
function useItem(x, y, z, itemId, blockId, side){ }
function attackHook(attacker, victim){ }
function modTick(){ }
function procCmd(cmd){ }
function newLevel(){}
function leaveGame(){}
/*
The basic:
*/
function print(text);
function clientMessage(text);
function setNightMode(isNight); //Does not work properly...
function getPlayerX();
function getPlayerY();
function getPlayerZ();
function getPlayerEnt();
function getYaw();
function getPitch();
function setPosition(ent,x,y,z);
function setPositionRelative(ent,x,y,z);
function setRot(ent,x,y);
function getTile(x,y,z);
function getData(x, y, z);
function setVelX(ent, amount);
function setVelY(ent, amount);
function setVelZ(ent, amount);
function explode(x, y, z, radius);
function addItemInventory(id, amount, damage);
function rideAnimal(player, target);
function getCarriedItem();
function preventDefault();
function setTile(x,y,z,type, damage);
function spawnChicken(x,y,z,image);
function spawnCow(x,y,z,image);
function spawnPigZombie(x,y,z,item,image);
function setPlayerHealth(halfhearts);
function bl_spawnMob(x, y, z, mobId, image); //Can spawn any mob(peaceful or hostile)that is given
function bl_setMobSkin(mob, image);
function bl_saveData(key, value);
function bl_readData(key);
function bl_getWorldName();
function bl_getWorldDir(); //Returns location of world on system
function bl_removeEntity(ent);
/*
Object-Oriented Functions:
*Not sure if all of these work...
*/
function ModPE.setItem(id, imageX, imageY, "name"); //Finally works (Android only) Adds custom items.
function Level.setNightMode(isNight);
function Level.getTile(x,y,z);
function Level.explode(x, y, z, radius);
function Level.setTile(x,y,z,type);
function Level.spawnChicken(x,y,z,image);
function Level.spawnCow(x,y,z,image);
function Player.getX();
function Player.getY();
function Player.getZ();
function Player.getEntity();
function Player.getCarriedItem();
function Player.addItemInventory(id, amount);
function Entity.getX();
function Entity.getY();
function Entity.getZ();
function Entity.setCarriedItem(ent, id, damage);
function Entity.setVelX(ent, amount);
function Entity.setVelY(ent, amount);
function Entity.setVelZ(ent, amount);
function Entity.setRot(ent,x,y);
function Entity.rideAnimal(player, target);
function Entity.setPosition(ent,x,y,z);
function Entity.setPositionRelative(ent,x,y,z);
function Entity.getYaw(ent);
function Entity.getPitch(ent);
/*
The upcoming:
*These were confirmed on twitter during a conversation between me and zhuowei
*Not all of these may be in soon...
*/
//We may get damage parameters for more item-related functions
function Entity.getType(); //Returns the given entity's ID
function dropItem(x,y,z,id,count,damage); //For dropping any given item passed into the parameters
function setAge(); //Self explanatory
function ModPE.setTerrain(); //For changing textures in-game
function ModPE.setGuiBlocks(); //For changing block gui's in-game
function ModPE.setItems(); //For changing items.png in-game
function ModPE.resetImages();
function ModPE.bl_overrideTextures(textureName, url);
Since you can change texture of item, could you use something like what smiley guy did with mobs? Where the script recognizes the item with a certain .png on it does certain things even though the same item without the custom texture on it doesn't do those things?
You know you could make your own version of blocklauncher... and call it "BLOCKME" (;^D
At this point, I don't want people to distribute modified versions of BlockLauncher. I'll rather have one version of BlockLauncher so scripts can stay compatiable.
Maybe getLevel() finds how many blocks u r above zero
As I understand it, getLevel() is intended to return the level's location in your computer memory (which is how it is implemented in BlockLauncher). There isn't a single thing you can do with that number, at least in ModPE script, so it's completely useless.
Similarly, getMCPE() should be useless as well, which is why I didn't include it in BlockLauncher.
New experimental functions. These are not prefixed with bl_ (because that looks ugly) so just remember that they aren't available on iOS, OK?
Entity.getX(entity);
Entity.getY(entity);
Entity.getZ(entity);
Entity.setCarriedItem(entity, id, damage); //ONLY WORKS FOR ZOMBIE PIGMEN AND SKELETONS!!!!!!!!!
setTile(x, y, z, id, damage);
addItemInventory(id, amount, damage);
Finally, this was changed a few releases ago, but I haven't seen any scripts using it:
the spawn* methods return the entity spawned so you can use it in other methods. e.g:
var a = spawnChicken(1, 2, 3, "mob/chicken.png");
clientMessage(Entity.getX(a));
These are all experimental and probably won't run on iOS, and might not even run on Android. If it breaks you keep both pieces.
Settings > Nerdy Stuff > Dump ModPE Methods
However, if you really don't give half a potato for some reason, here it is:
/* The hooks: */ function useItem(x, y, z, itemId, blockId, side){ } function attackHook(attacker, victim){ } function modTick(){ } function procCmd(cmd){ } function newLevel(){} function leaveGame(){} /* The basic: */ function print(text); function clientMessage(text); function setNightMode(isNight); //Does not work properly... function getPlayerX(); function getPlayerY(); function getPlayerZ(); function getPlayerEnt(); function getYaw(); function getPitch(); function setPosition(ent,x,y,z); function setPositionRelative(ent,x,y,z); function setRot(ent,x,y); function getTile(x,y,z); function getData(x, y, z); function setVelX(ent, amount); function setVelY(ent, amount); function setVelZ(ent, amount); function explode(x, y, z, radius); function addItemInventory(id, amount, damage); function rideAnimal(player, target); function getCarriedItem(); function preventDefault(); function setTile(x,y,z,type, damage); function spawnChicken(x,y,z,image); function spawnCow(x,y,z,image); function spawnPigZombie(x,y,z,item,image); function setPlayerHealth(halfhearts); function bl_spawnMob(x, y, z, mobId, image); //Can spawn any mob(peaceful or hostile)that is given function bl_setMobSkin(mob, image); function bl_saveData(key, value); function bl_readData(key); function bl_getWorldName(); function bl_getWorldDir(); //Returns location of world on system function bl_removeEntity(ent); /* Object-Oriented Functions: *Not sure if all of these work... */ function ModPE.setItem(id, imageX, imageY, "name"); //Finally works (Android only) Adds custom items. function Level.setNightMode(isNight); function Level.getTile(x,y,z); function Level.explode(x, y, z, radius); function Level.setTile(x,y,z,type); function Level.spawnChicken(x,y,z,image); function Level.spawnCow(x,y,z,image); function Player.getX(); function Player.getY(); function Player.getZ(); function Player.getEntity(); function Player.getCarriedItem(); function Player.addItemInventory(id, amount); function Entity.getX(); function Entity.getY(); function Entity.getZ(); function Entity.setCarriedItem(ent, id, damage); function Entity.setVelX(ent, amount); function Entity.setVelY(ent, amount); function Entity.setVelZ(ent, amount); function Entity.setRot(ent,x,y); function Entity.rideAnimal(player, target); function Entity.setPosition(ent,x,y,z); function Entity.setPositionRelative(ent,x,y,z); function Entity.getYaw(ent); function Entity.getPitch(ent); /* The upcoming: *These were confirmed on twitter during a conversation between me and zhuowei *Not all of these may be in soon... */ //We may get damage parameters for more item-related functions function Entity.getType(); //Returns the given entity's ID function dropItem(x,y,z,id,count,damage); //For dropping any given item passed into the parameters function setAge(); //Self explanatory function ModPE.setTerrain(); //For changing textures in-game function ModPE.setGuiBlocks(); //For changing block gui's in-game function ModPE.setItems(); //For changing items.png in-game function ModPE.resetImages(); function ModPE.bl_overrideTextures(textureName, url);Back to modding! Follow me on Twitter @byteandahalf
Back to modding! Follow me on Twitter @byteandahalf
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI'm going to add one more upcoming one that will be implemented when I get full ModPE 0.5 support:
Which works like ModPE.setTerrain on ModPE 0.5 iOS, except it can replace different textures.
Also, there are two BlockLauncher specific hooks:
function newLevel(){ }Called when entering a new world, and
function leaveGame() { }Called when leaving a world.
setNightMode calls the Nether Reactor's set night fall methods, so it works like the reactor.
dropItem would spawn item drops. This is still unconfirmed and probably aren't coming soon.
setAge will probably be implemented as bl_setAnimalAge when it does come.
the items code of ModPE 0.6 will come later, much later.
Hope this helps. If you need a larger list of methods (including one that doesn't work but I didn't bother to remove), check https://github.com/zhuowei/MCPELauncher/blob/master/src/net/zhuoweizhang/mcpelauncher/ScriptManager.java
Lol. Ok then... :/
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIt means that you don't know how to Google.
You know you could make your own version of blocklauncher... and call it "BLOCKME" (;^D
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAt this point, I don't want people to distribute modified versions of BlockLauncher. I'll rather have one version of BlockLauncher so scripts can stay compatiable.
As I understand it, getLevel() is intended to return the level's location in your computer memory (which is how it is implemented in BlockLauncher). There isn't a single thing you can do with that number, at least in ModPE script, so it's completely useless.
Similarly, getMCPE() should be useless as well, which is why I didn't include it in BlockLauncher.
if(itemId==292&&blockId==1)
{
bl_spawnMob(x, y, z, 32);
}
}
Lead developer of Dragonet!
Check out my game, Adventuria!
Dev of (IMO the best server ever) TwilightGamez!
function useItem (itemId, blockId) { if (itemId==292&&blockId==1) { bl_spawnMob(x, y, z, 32,"mob/zombie.png"); } }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNot yet. Put that on the "methods I want" list.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThese following four were contributed by MrARM.
Also, changes to existing methods:
Finally, this was changed a few releases ago, but I haven't seen any scripts using it:
the spawn* methods return the entity spawned so you can use it in other methods. e.g:
These are all experimental and probably won't run on iOS, and might not even run on Android. If it breaks you keep both pieces.
These should hit in BlockLauncher 1.4.4.
Like for example
function attackHook { if(getCarriedItem()==1) { explode(x, y, z, 6); } }That would make it explode where the mob is at. Currently that code wouldn't do anything.