In BlockLauncher 1.5.5 and below, you can't use the equality operator on entities: for example, if you wanted to see if someone punched your boss mob, doing this
var theBoss;
function attackHook(attacker, victim) {
if (victim == theBoss) {
clientMessage("You punched the boss");
}
}
function useItem(x, y, z, itemId, blockId, side) {
theBoss = spawnCow(x, y + 1, z, "mob/cow.png");
clientMessage("You spawned the boss");
}
wouldn't work, because of the bug, since victim == theBoss will always return false.
I ended up changing all code in BlockLauncher to send the entity ID to ModPE scripts instead, since the entity ID is a number, and you can compare numbers. So the above code should work in the latest BlockLauncher beta. http://tinyw.in/bl
wouldn't work, because of the bug, since victim == theBoss will always return false.
I ended up changing all code in BlockLauncher to send the entity ID to ModPE scripts instead, since the entity ID is a number, and you can compare numbers. So the above code should work in the latest BlockLauncher beta. http://tinyw.in/bl
Just a heads up. Sorry about this bug.
Sneaking
This is offtopic, but I'll answer it anyways:
#1 : Have you worked on blueberry ?? ( coding language )
#2 : Thid sounds cool.
#3: can u help me with this http://www.minecraftforum.net/topic/2158111-function-help/
1. http://www.minecraftforum.net/topic/2158867-blueberry-a-drag-and-drop-editor-for-modpe-scripts/
2. Thanks
3. Read other people's scripts to see what they do.
+1 for that!
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Sorry to disappoint, but entity IDs do not persist across world loads
Across world loads? Save X Y, Z position when world unloads, compare when world loads again