This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Code below
function attackHook(attacker, victim) { if(Player.getCarriedItem() == 555 ) { if(Player.getCarriedItemData() < 1008) Entity.setCarriedItem(attacker, 555, Player.getCarriedItemCount(), Player.getCarriedItemData() + 1 ); } else { Level.playSoundEnt(attacker, "random.break", 100, 1); Player.clearInventorySlot(Player.getSelectedSlotId()); } Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.explode",100,2) Entity.setFireTicks(victim,2000); Entity.addEffect(getPlayerEnt(), MobEffect.damageBoost, 1, 3, false, true); if(Player.getCarriedItem() == 557) { if(Player.getCarriedItemData() < 1009) Entity.setCarriedItem(attacker, 557, Player.getCarriedItemCount(), Player.getCarriedItemData() + 1 ); } setVelX(victim, 2 * Math.cos((getYaw()+90)*(Math.PI/180))); setVelY(victim, 1); setVelZ(victim, 2 * Math.sin((getYaw()+90)*(Math.PI/180))); Entity.addEffect(getPlayerEnt(), MobEffect.damageBoost, 1, 1, false, true); b = Math.floor(Math.random() * 3) + 1; if(b == 1){ Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.splash",100,1) } if(b== 2){ Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.splash",100,2) } if(b== 3){ Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.water",100,1) } else { Level.playSoundEnt(attacker, "random.break", 100, 1); Player.clearInventorySlot(Player.getSelectedSlotId()); } }
The code have no error and everything is fine, the problem is the item that didn't work, it just combined itself.
The ID 557 just disappear when attack a mob, and it also apply the 555 effects, which is wrong.
It shouldn't disappear and apply with another item effects.
Can anyone help?
This Is My Signature. <--- Here.
You didn't put setVel functions in objects, go with Entity.setVelX Y or Z
The heck is this for
Didn't work for me, it doesn't change anything.
You have kik?
If so PM me I need your help.
I have my full code.
PM me in the forums
Nevermind I got it working ^^
Thank you though ^*^
Code below
function attackHook(attacker, victim) { if(Player.getCarriedItem() == 555 ) { if(Player.getCarriedItemData() < 1008) Entity.setCarriedItem(attacker, 555, Player.getCarriedItemCount(), Player.getCarriedItemData() + 1 ); } else { Level.playSoundEnt(attacker, "random.break", 100, 1); Player.clearInventorySlot(Player.getSelectedSlotId()); } Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.explode",100,2) Entity.setFireTicks(victim,2000); Entity.addEffect(getPlayerEnt(), MobEffect.damageBoost, 1, 3, false, true); if(Player.getCarriedItem() == 557) { if(Player.getCarriedItemData() < 1009) Entity.setCarriedItem(attacker, 557, Player.getCarriedItemCount(), Player.getCarriedItemData() + 1 ); } setVelX(victim, 2 * Math.cos((getYaw()+90)*(Math.PI/180))); setVelY(victim, 1); setVelZ(victim, 2 * Math.sin((getYaw()+90)*(Math.PI/180))); Entity.addEffect(getPlayerEnt(), MobEffect.damageBoost, 1, 1, false, true); b = Math.floor(Math.random() * 3) + 1; if(b == 1){ Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.splash",100,1) } if(b== 2){ Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.splash",100,2) } if(b== 3){ Level.playSound(getPlayerX(),getPlayerY(),getPlayerZ(),"random.water",100,1) } else { Level.playSoundEnt(attacker, "random.break", 100, 1); Player.clearInventorySlot(Player.getSelectedSlotId()); } }The code have no error and everything is fine, the problem is the item that didn't work, it just combined itself.
The ID 557 just disappear when attack a mob, and it also apply the 555 effects, which is wrong.
It shouldn't disappear and apply with another item effects.
Can anyone help?
This Is My Signature. <--- Here.You didn't put setVel functions in objects, go with Entity.setVelX Y or Z
The heck is this for
Didn't work for me, it doesn't change anything.
You have kik?
If so PM me I need your help.
I have my full code.
This Is My Signature. <--- Here.PM me in the forums
The heck is this for
Nevermind I got it working ^^
Thank you though ^*^
This Is My Signature. <--- Here.