bedwarsfeature.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #----------------------------------------
  2. #************* don´t delete *************
  3. #----------------------------------------
  4. %loadEvent player-hurt;
  5. %loadEvent entity-click;
  6. %setVar add-if-name test;
  7. @checkgame
  8. %wait;
  9. %if $event == player-hurt && $player-damage-cause == ENTITY_ATTACK && $sec-player-item-type == IRON_HOE goto knocksideleft;
  10. %if $event == entity-click && $entity-type == PLAYER && $player-item-type == IRON_HOE goto knocksideright;
  11. %if $event == player-hurt && $player-damage-cause == FALL goto cancel;
  12. %goto checkgame;
  13. @cancel
  14. %setVar cancel true;
  15. %goto checkgame;
  16. @knocksideleft
  17. %msg dev knocksideleft;
  18. #%removeItemPlayer $sec-player-name %getItemInMainHand $sec-player-name;;
  19. %setVar cancel true;
  20. %setVar tothrow $player-name;
  21. %setVar throwx %coords $player-loc x;;
  22. %setVar throwz %coords $player-loc z;;
  23. %setVar throwerx %coords $sec-player-loc x;;
  24. %setVar throwerz %coords $sec-player-loc z;;
  25. %setVar distancex %abs %sub $throwx $throwerx;;;
  26. %setVar distancez %abs %sub $throwz $throwerz;;;
  27. %msg dev xdistance: $distancex;
  28. %msg dev zdistance: $distancez;
  29. %setVar x %mul $distancez -1;;
  30. %setVar z $distancex;
  31. %msg dev xthrow $x;
  32. %msg dev zthrow $z;
  33. %goto throw;
  34. @knocksideright
  35. %msg dev knocksideright;
  36. #%removeItemPlayer $player-name %getItemInMainHand $player-name;;
  37. %setVar cancel true;
  38. %setVar tothrow $entity-name;
  39. %setVar throwx %coords $entity-loc x;;
  40. %setVar throwz %coords $entity-loc z;;
  41. %setVar throwerx %coords $player-loc x;;
  42. %setVar throwerz %coords $player-loc z;;
  43. %setVar distancex %abs %sub $throwx $throwerx;;;
  44. %setVar distancez %abs %sub $throwz $throwerz;;;
  45. %msg dev xdistance: $distancex;
  46. %msg dev zdistance: $distancez;
  47. %setVar x $distancez;
  48. %setVar z %mul $distancex -1;;
  49. %msg dev xthrow $x;
  50. %msg dev zthrow $z;
  51. %goto throw;
  52. @throw
  53. %throwEntity %getPlayerId $tothrow; $x 0.4 $z;
  54. %goto checkgame;