slime_boots.txt 956 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. event.load("living_pre_hurt");
  2. //event.load("player_move");
  3. @wait
  4. wait();
  5. //funktioniert leider nicht, da prehurt zu spät kommt
  6. //mgl mit area besser event.addMoveData usw
  7. /*
  8. loc = setArea(loc.mod(entity.getLoc(player)));
  9. id = event.addMoveData(loc, loc.mod(loc,0.5,1,0.5), -1, -1, player);
  10. if(event == player_move){
  11. event.removeMoveData(id);
  12. }
  13. function setArea(loc){
  14. for(a = loc.getY(loc); blocktest(loc); a--){}
  15. return loc;
  16. }
  17. function blocktest(loc){
  18. loc = loc.mod(loc, 0, -1, 0);
  19. if(block.isAir(loc) && loc.getY(loc) > -1){
  20. return true;
  21. }
  22. return false;
  23. }
  24. */
  25. if(isPlayer(living_entity)){
  26. if(player.getName(living_entity) == "SirTerence7"){
  27. damage_type = damage.getType(damage_source);
  28. if(damage_type == "fall"){
  29. cancel = true;
  30. array = entity.getMotion(living_entity);
  31. x = array[0];
  32. y = math.abs(array[1]);
  33. z = array[2];
  34. entity.throw(living_entity, x, y, z);
  35. }
  36. }
  37. }
  38. goto("wait");