1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #----------------------------------------
- #************* don´t delete *************
- #----------------------------------------
- %loadEvent player-hurt;
- %loadEvent entity-click;
- %setVar add-if-name test;
- @checkgame
- %wait;
- %if $event == player-hurt && $player-damage-cause == ENTITY_ATTACK && $sec-player-item-type == IRON_HOE goto knocksideleft;
- %if $event == entity-click && $entity-type == PLAYER && $player-item-type == IRON_HOE goto knocksideright;
- %if $event == player-hurt && $player-damage-cause == FALL goto cancel;
- %goto checkgame;
- @cancel
- %setVar cancel true;
- %goto checkgame;
- @knocksideleft
- %msg dev knocksideleft;
- #%removeItemPlayer $sec-player-name %getItemInMainHand $sec-player-name;;
- %setVar cancel true;
- %setVar tothrow $player-name;
- %setVar throwx %coords $player-loc x;;
- %setVar throwz %coords $player-loc z;;
- %setVar throwerx %coords $sec-player-loc x;;
- %setVar throwerz %coords $sec-player-loc z;;
- %setVar distancex %abs %sub $throwx $throwerx;;;
- %setVar distancez %abs %sub $throwz $throwerz;;;
- %msg dev xdistance: $distancex;
- %msg dev zdistance: $distancez;
- %setVar x %mul $distancez -1;;
- %setVar z $distancex;
- %msg dev xthrow $x;
- %msg dev zthrow $z;
- %goto throw;
- @knocksideright
- %msg dev knocksideright;
- #%removeItemPlayer $player-name %getItemInMainHand $player-name;;
- %setVar cancel true;
- %setVar tothrow $entity-name;
- %setVar throwx %coords $entity-loc x;;
- %setVar throwz %coords $entity-loc z;;
- %setVar throwerx %coords $player-loc x;;
- %setVar throwerz %coords $player-loc z;;
- %setVar distancex %abs %sub $throwx $throwerx;;;
- %setVar distancez %abs %sub $throwz $throwerz;;;
- %msg dev xdistance: $distancex;
- %msg dev zdistance: $distancez;
- %setVar x $distancez;
- %setVar z %mul $distancex -1;;
- %msg dev xthrow $x;
- %msg dev zthrow $z;
- %goto throw;
- @throw
- %throwEntity %getPlayerId $tothrow; $x 0.4 $z;
- %goto checkgame;
|