function deathHook(murderer, victim);
This hook is called when a mob dies.
Both parameters are NativeEntity.
levelEvent and blockEvent
function levelEventHook(entity,eventType,x,y,z,data):
Called when a door is opened or closed.
The first parameter is equal to getPlayerEnt();
All other parameters are int.
function blockEventHook(x,y,z,eventType,data);
Called every three seconds for chests to announce their opened/closed state.
All parameters are int.
Note: if you are adding a BlockLauncher-specific method, please add it to one of the namespaces (Entity, Level, ModPE, Player) instead of the top-level namespace.
can you do this
function setPosition(ent,x,y,z);
{
if(blockId==1 && itemId==267)
{
getPlayerEnt();
}
Thoose functions are Hook Function, you use them like you use function useItem so for deathHook it would be
function deathHook(murderer, victim)
{
if(getCarriedItem(murderer) == 280) //If you kill something with a stick
{
Level.dropItem(getPlayerX(), getPlayerY(), getPlayerZ(), 1, 264, 64, 0); //Drops a stack of Diamonds at your cords
}
can you do this
function setPosition(ent,x,y,z);
{
if(blockId==1 && itemId==267)
{
getPlayerEnt();
}
Also to my knowledge you can't do that because setPosition is not a Hook Function. Also getPlayerEnt(); is not a function, but is a parameter.
Thoose functions are Hook Function, you use them like you use function useItem so for deathHook it would be
function deathHook(murderer, victim)
{
if(getCarriedItem(murderer) == 280) //If you kill something with a stick
{
Level.dropItem(getPlayerX(), getPlayerY(), getPlayerZ(), 1, 264, 64, 0); //Drops a stack of Diamonds at your cords
}
Also to my knowledge you can't do that because setPosition is not a Hook Function. Also getPlayerEnt(); is not a function, but is a parameter.
Yep. But in one thing I must correct you:
getPlayerEnt () IS a function but with an return-value.
And if you would use setPosition like a hook, then you would define a new function.
I added explanation about different types of functions on github.com/connor4898/modpe-scripts/wiki/modpe-scripts-functions-listAlso remove the semicolon before the {
Rollback Post to RevisionRollBack
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:
Thoose functions are Hook Function, you use them like you use function useItem so for deathHook it would be
function deathHook(murderer, victim)
{
if(getCarriedItem(murderer) == 280) //If you kill something with a stick
{
Level.dropItem(getPlayerX(), getPlayerY(), getPlayerZ(), 1, 264, 64, 0); //Drops a stack of Diamonds at your cords
}
Also to my knowledge you can't do that because setPosition is not a Hook Function. Also getPlayerEnt(); is not a function, but is a parameter.
getCarriedItem() accepts no parameters. Read the wiki orbthr siurce cide https://github.com/zhuowei/mcpelauncher/tree/master/src/net/zhuoweizhang/mcpelauncher/ScriptManager.java
Hope the link works... but nothing wouldbhappen indeed if youbgave the parameter (possibly), but you waste the bytes (wasting for about 1/4 000 000 000 of the device's external storage? Lol) and complicatize (exist such word?) the development by making the screen show less and slower your speed of making mini-mods (not minimods).
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:
To post a comment, please login or register a new account.
can you do this
function setPosition(ent,x,y,z); { if(blockId==1 && itemId==267) { getPlayerEnt(); }function deathHook(murderer, victim) { if(getCarriedItem(murderer) == 280) //If you kill something with a stick { Level.dropItem(getPlayerX(), getPlayerY(), getPlayerZ(), 1, 264, 64, 0); //Drops a stack of Diamonds at your cords }Also to my knowledge you can't do that because setPosition is not a Hook Function. Also getPlayerEnt(); is not a function, but is a parameter.
Lead developer of Dragonet!
Check out my game, Adventuria!
Dev of (IMO the best server ever) TwilightGamez!
Yep. But in one thing I must correct you:
getPlayerEnt () IS a function but with an return-value.
And if you would use setPosition like a hook, then you would define a new function.
getCarriedItem() accepts no parameters. Read the wiki orbthr siurce cide https://github.com/zhuowei/mcpelauncher/tree/master/src/net/zhuoweizhang/mcpelauncher/ScriptManager.java
Hope the link works... but nothing wouldbhappen indeed if youbgave the parameter (possibly), but you waste the bytes (wasting for about 1/4 000 000 000 of the device's external storage? Lol) and complicatize (exist such word?) the development by making the screen show less and slower your speed of making mini-mods (not minimods).