Hey guys, I want to make a entity that burns when it's spawned
Code:
var poop= Level.spawnMob(x,y,x,65)
Entity.setRenderType=(poop,18)
Entity.setFireTicks=(poop,15)
but the entity isn't on fire when I spawn it, how do I fix this???
Hey guys, I want to make a entity that burns when it's spawned
Code:
var poop= Level.spawnMob(x,y,x,65)
Entity.setRenderType=(poop,18)
Entity.setFireTicks=(poop,15)
but the entity isn't on fire when I spawn it, how do I fix this???
Because you have "=" signs and there is no hook, so (x,y,z) is not defined.
function useItem(x,y,z,item,block,side){ //When a block is tapped
var poop = Level.spawnMob(x,y+2,z,65);
Entity.setRenderType(poop,18);
Entity.setFireTicks(poop,15);
}
What is a firetick?
um.
Because his useItem hook, doesnt actually define any items being used. Hes just showing you to put it into a hook:
He also wrote the useItem hook's parameters wrong. (it should be itemId and blockId not item and block.)
function useItem(x,y,z, itemId, blockId, side)
{
if(itemId==280)
{
var poop = Level.spawnMob(100,100,100,65);
Entity.setRenderType(poop,18);
Entity.setFireTicks(poop,15);
clientMessage("Mob Spawned");
}
}
This code should work.
So if you use a stick it should spawn your mob.
I also set the x y z, to 100,100,100 (as you had not defined them at all)
I also added clientMessage to test to see whether or not the useItem hook is working or not when you tap the stick anywhere.
What is a firetick?
um.
Because his useItem hook, doesnt actually define any items being used. Hes just showing you to put it into a hook:
He also wrote the useItem hook's parameters wrong. (it should be itemId and blockId not item and block.)
function useItem(x,y,z, itemId, blockId, side)
{
if(itemId==280)
{
var poop = Level.spawnMob(100,100,100,65);
Entity.setRenderType(poop,18);
Entity.setFireTicks(poop,15);
clientMessage("Mob Spawned");
}
}
This code should work.
So if you use a stick it should spawn your mob.
I also set the x y z, to 100,100,100 (as you had not defined them at all)
I also added clientMessage to test to see whether or not the useItem hook is working or not when you tap the stick anywhere.
I thought if there was no defined itemId it would work regardless. Can I ask you a question? Do you know JS? The parameters don't have to be specific in anyway in functions. Also, (x,y,z) is defined in useItem; it is the block tapped. And a fireTick is the equivalent of 1 second.
I thought if there was no defined itemId it would work regardless. Can I ask you a question? Do you know JS? The parameters don't have to be specific in anyway in functions. Also, (x,y,z) is defined in useItem; it is the block tapped. And a fireTick is the equivalent of 1 second.
Yeah i'm fairly decent in javascript, made a few games with it etc. I just thought that the parameters in ModPE had to be specific. >.>
Ahh didn't know what a firetick was now I do thanks! I should really keep up with all the new functions etc. >.>
Yeah i'm fairly decent in javascript, made a few games with it etc. I just thought that the parameters in ModPE had to be specific. >.>
Ahh didn't know what a firetick was now I do thanks! I should really keep up with all the new functions etc. >.>
Entity.setFireTick() is actually old. It was the newest thing when I joined; November, 2013.
Sorry about the feedback, i didn't really understand how to convert java to JavaScript... sooo is it possible to create a invisble button the size of the screen ?
Sorry about the feedback, i didn't really understand how to convert java to JavaScript... sooo is it possible to create a invisble button the size of the screen ?
I haven't tried but I would say so.
You just need to set the visibility of the button to 4.
Sooo how do i use carried item? I want it if carried item id=502, the button will appear, how to i do that, do i have to add a new function call carried item or anything like that
Code:
var poop= Level.spawnMob(x,y,x,65)
Entity.setRenderType=(poop,18)
Entity.setFireTicks=(poop,15)
but the entity isn't on fire when I spawn it, how do I fix this???
Because you have "=" signs and there is no hook, so (x,y,z) is not defined.
function useItem(x,y,z,item,block,side){ //When a block is tapped var poop = Level.spawnMob(x,y+2,z,65); Entity.setRenderType(poop,18); Entity.setFireTicks(poop,15); }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]
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumum.
Because his useItem hook, doesnt actually define any items being used. Hes just showing you to put it into a hook:
He also wrote the useItem hook's parameters wrong. (it should be itemId and blockId not item and block.)
function useItem(x,y,z, itemId, blockId, side) { if(itemId==280) { var poop = Level.spawnMob(100,100,100,65); Entity.setRenderType(poop,18); Entity.setFireTicks(poop,15); clientMessage("Mob Spawned"); } }This code should work.
So if you use a stick it should spawn your mob.
I also set the x y z, to 100,100,100 (as you had not defined them at all)
I also added clientMessage to test to see whether or not the useItem hook is working or not when you tap the stick anywhere.
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
I thought if there was no defined itemId it would work regardless. Can I ask you a question? Do you know JS? The parameters don't have to be specific in anyway in functions. Also, (x,y,z) is defined in useItem; it is the block tapped. And a fireTick is the equivalent of 1 second.
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]
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAhh didn't know what a firetick was now I do thanks! I should really keep up with all the new functions etc. >.>
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
Entity.setFireTick() is actually old. It was the newest thing when I joined; November, 2013.
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]
function entityAddedHook(e){ Entity.setFireTick(e,5); }var playerYaw= getYaw(getPlayerEnt());
var playerPitch= getPitch(getPlayerEnt());
function useItem(x,y,z,itemId,blockId,side,attacker)
{
else if(itemId==502)
{
velY = Math.sin(("playerPitch" - 180) / 180 * Math.PI);
velX = 3.5 * (Math.sin("playerYaw" / 180 * Math.PI) * Math.cos(("playerPitch" - 180) / 180 * Math.PI));
velZ = 3.5 * (-1 * Math.cos("playerYaw" / 180 * Math.PI) * Math.cos(("playerPitch" - 180) / 180 * Math.PI));
var firecharge= Level.spawnMob( Player.getX() + Math.sin("playerYaw" / 180 * Math.PI) * Math.cos(("playerPitch" - 180) / 180 * Math.PI) ,Player.getY(),Player.getZ() + -1 * Math.cos("playerYaw" / 180 * Math.PI) * Math.cos(("playerPitch" - 180) / 180 * Math.PI) ,65);
setVelX(firecharge,velX);
setVelY(firecharge,velY);
setVelZ(firecharge,velZ);
firecharge = Entity.setRenderType(firecharge,18);
Entity.setFireTicks(firecharge, 50);
}
Trying to make item 502 shoot out firecharges, can anyone help me fix it, thx!
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]
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]
At the moment that is not possible, without a custom button.
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]
Yes, I know that, but I don't know if he knows any Android Development. I referred him to my signature, but he never gave feedback or said "it works".
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]
I haven't tried but I would say so.
You just need to set the visibility of the button to 4.
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]
function carriedItem()
{
if ( Player.getCarriedItem()==502)
aimbutton();
}