I know it's probably to late to ask this... But can some one teach me how to code modpe? I want to start somewhere simple and actually contribute to the mods section.
Entity.getEntityTypeId(entity);
Entity.spawnMob(x, y, z, typeId, texture); //identical to bl_spawnMob, but looks cleaner - any new code should use this instead
Changes:
If you omit the texture parameter or pass in null in bl_spawnMob and Entity.spawnMob, the mob will get the default texture. Previously the mob will spawn with corrupt textures.
Demo script: https://raw.github.com/zhuowei/ModPEScripts/master/500ise_clonemob.js
Tap on a mob with an egg (chicken egg).
Entity.getEntityTypeId(entity);
Entity.spawnMob(x, y, z, typeId, texture); //identical to bl_spawnMob, but looks cleaner - any new code should use this instead
Changes:
If you omit the texture parameter or pass in null in bl_spawnMob and Entity.spawnMob, the mob will get the default texture. Previously the mob will spawn with corrupt textures.
Demo script: https://raw.github.c...ise_clonemob.js
Tap on a mob with an egg (chicken egg).
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumon death of player or on death of any entity?
How about this Hook?
function shootHook(attacker,victim(or blockId),x,y,z) {
// When I shoot an arrow or throw snowball (or egg), This Hook works.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumChanges:
If you omit the texture parameter or pass in null in bl_spawnMob and Entity.spawnMob, the mob will get the default texture. Previously the mob will spawn with corrupt textures.
Demo script:
https://raw.github.com/zhuowei/ModPEScripts/master/500ise_clonemob.js
Tap on a mob with an egg (chicken egg).
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCheck out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNote that if it is possible, use spawnChicken, spawnCow, and spawnPigZombie instead of these BlockLauncher-specific methods.
Anyways:
Obviously, only call these with animals.
Updated clone script to use these.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIf you want me to help you, you'll have to describe your specific problem - just saying "help me" isn't enough information for me to assist you.
Anyways, BlockLauncher 1.4.4 Beta I-dunno-what-number-it-is-now: http://tinyw.in/bl
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI just need to update mo creatures o.o
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIf you have a reference to a mob, you can use Entity.getEntityTypeId(myentity) to figure out what type of mob it is.
e.g.
function attackHook(attacker, victim) { if (Entity.getEntityTypeId(victim) == 10) { //chicken preventDefault(); //chickens cannot be hurt by you } }Java/C/C++ dev, server owner and hacker extraordinare
function attackHook(attacker, victim)
{
if (getcarrieditem( )==280) ;
{
prevent default ( );
function Entity.ride Animal(player, victim) ;
}
}
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCapitalization matters.
function attackHook(attacker, victim) { if (getCarriedItem() == 280) { preventDefault(); Entity.rideAnimal(player, victim); } }You might want to take a JavaScript tutorial: it would be helpful for you.
function throwProj(projectile) { }And then just seperate functions like this:
These will get the coords of the last fired projectile, where it landed.
But trust me, this is not easy to make work.
Back to modding! Follow me on Twitter @byteandahalf
var itemsAdded = false; function modTick() { switch(itemsAdded){ case false: ModPE.setProjItem(368, 11, 6, "Ender Pearl"); //Also does not exist lol itemsAdded = true; //This prevents a loop of re-creating items that already exist } } function throwProj(projectile) { if(projectile == 368) { setPlayerPos(getPrevProjectileX(), getPrevProjectileY() + 1, getPrevProjectileZ()); } }**Once again though, this would be hard to make work...
Back to modding! Follow me on Twitter @byteandahalf
function proCmd( cmd ){ }
{
function ModPe.setItem(457, 9, 9, "killer") ;
{
{
function useItem(x, y, z, itemId, blockId, side)
}
if (getCarriedItem() == 457)
{
preventDefault( ) ;
explode(x, y, z, 3.1) ;
}
}
modPe.setItem(457, 9, 9, "killer") ; function useItem(x, y, z, itemId, blockId, side) { if (itemId== 457) { preventDefault( ) ; explode(x, y, z, 3.1) ; } }