Hi. I was just wondering how you would trigger a function when an arrow hits the ground. Your help would be very appreciated and I will include you in my mod's credits. Thank you
function useItem(x, y, z, itemId, blockId, side)
{
if(itemId==bowID)//change bowID to the ID of bow, Idk it sorry lol
{
//Code Here
//example:
clientMessage('§l§aThe Code Worked!! :P');
}
}
Tell me how it went.
Rollback Post to RevisionRollBack
Here to help.
Minecraft: Pocket Edition Modder, Web Developer. Plugin creator!
Simple!!There's two parts:
1:Getting UUID from arrows in the world
2:Testing their Velocity
First part:UUID of arrow
You will need an entityAddedHook(ent) to make it work,you also need an array too.
var arrow=[];
function entityAddedHook(ent){
if(Entity.getEntityTypeId(ent)==80){
arrow.push(ent);//putting that arrow to a watchlist kinda thingy XD
clientMessage("UUID:"+ent);//for checking
}
}
Second part:triggering function:simple enough,you can even copy it if you want
function modTick(){
for(var i=0;i<arrow.length;i++){
if(Entity.getVelX(arrow)==0&&Entity.getVelY(arrow)==0&&Entity.getVelZ(arrow)==0){//getting the velocity
explode(Entity.getX(arrow),Entity.getY(arrow),Entity.getZ(arrow),3);//change this to something else
Entity.remove(arrow);//here I use remove,you can either delete this line or keep it
}
}
if(arrow.length>10){//my phone sucks so I have it to 10,whenever you shoot 10 arrows,it reset this array
arrow=[];//clear array or game will lag
}
}
Now whenever you shoot an arrow,it explode!!
Works like charm!
wait a minute,what about skele?
There is a way to avoid it but you do it yourself ; )
Btw,if you mean an item arrow,then bummer,you know how to do it,its upstairs
Simple!!There's two parts:
1:Getting UUID from arrows in the world
2:Testing their Velocity
First part:UUID of arrow
You will need an entityAddedHook(ent) to make it work,you also need an array too.
var arrow=[];
function entityAddedHook(ent){
if(Entity.getEntityTypeId(ent)==80){
arrow.push(ent);//putting that arrow to a watchlist kinda thingy XD
clientMessage("UUID:"+ent);//for checking
}
}
Second part:triggering function:simple enough,you can even copy it if you want
function modTick(){
for(var i=0;i<arrow.length;i++){
if(Entity.getVelX(arrow)==0&&Entity.getVelY(arrow)==0&&Entity.getVelZ(arrow)==0){//getting the velocity
explode(Entity.getX(arrow),Entity.getY(arrow),Entity.getZ(arrow),3);//change this to something else
Entity.remove(arrow);//here I use remove,you can either delete this line or keep it
}
}
if(arrow.length>10){//my phone sucks so I have it to 10,whenever you shoot 10 arrows,it reset this array
arrow=[];//clear array or game will lag
}
}
Now whenever you shoot an arrow,it explode!!
Works like charm!
wait a minute,what about skele?
There is a way to avoid it but you do it yourself ; )
Btw,if you mean an item arrow,then bummer,you know how to do it,its upstairs
Says "cannot read property "length" from undefined"
Hi. I was just wondering how you would trigger a function when an arrow hits the ground. Your help would be very appreciated and I will include you in my mod's credits. Thank you
function useItem()
{
//Code Here
}
Good Luck!
Here to help.
Minecraft: Pocket Edition Modder, Web Developer. Plugin creator!
Cheers!
:/
What?
You can use getYaw and getPitch?
Here to help.
Minecraft: Pocket Edition Modder, Web Developer. Plugin creator!
Cheers!
You can try this maybe?:
Tell me how it went.
Here to help.
Minecraft: Pocket Edition Modder, Web Developer. Plugin creator!
Cheers!
hey im looking for help i play on my kindle and all my worlds were deleted by accident is there a way to get them back thanks
Ah, no. Unless you go into the worlds folder In the minecraft: Pe folder.
Here to help.
Minecraft: Pocket Edition Modder, Web Developer. Plugin creator!
Cheers!
Simple!!There's two parts:
1:Getting UUID from arrows in the world
2:Testing their Velocity
First part:UUID of arrow
You will need an entityAddedHook(ent) to make it work,you also need an array too.
var arrow=[];
function entityAddedHook(ent){
if(Entity.getEntityTypeId(ent)==80){
arrow.push(ent);//putting that arrow to a watchlist kinda thingy XD
clientMessage("UUID:"+ent);//for checking
}
}
Second part:triggering function:simple enough,you can even copy it if you want
function modTick(){
for(var i=0;i<arrow.length;i++){
if(Entity.getVelX(arrow)==0&&Entity.getVelY(arrow)==0&&Entity.getVelZ(arrow)==0){//getting the velocity
explode(Entity.getX(arrow),Entity.getY(arrow),Entity.getZ(arrow),3);//change this to something else
Entity.remove(arrow);//here I use remove,you can either delete this line or keep it
}
}
if(arrow.length>10){//my phone sucks so I have it to 10,whenever you shoot 10 arrows,it reset this array
arrow=[];//clear array or game will lag
}
}
Now whenever you shoot an arrow,it explode!!
Works like charm!
wait a minute,what about skele?
There is a way to avoid it but you do it yourself ; )
Btw,if you mean an item arrow,then bummer,you know how to do it,its upstairs
Great job! xD
Here to help.
Minecraft: Pocket Edition Modder, Web Developer. Plugin creator!
Cheers!
Says "cannot read property "length" from undefined"
did you copy the var arrow=[]?
It works for me