jantest4.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. event.load("player_toss");
  2. event.load("entity_click");
  3. event.load("living_death");
  4. randblock_x1 = -2984;
  5. randblock_x2 = -3003;
  6. randblock_z1 = -997;
  7. randblock_z2 = -1009;
  8. middleloc = -2994;
  9. @checkgame
  10. wait();
  11. if(event == "living_death"){
  12. if(entity.getType(living_entity) == "falling_block"){
  13. p = "SirTerence7";
  14. }else{
  15. goto("checkgame");
  16. }
  17. }else{
  18. p = player.getName(player);
  19. }
  20. if(p == "SirTerence7" || p == "Mareeeen" || p == "marvinius"){
  21. ignoreGoto(event);
  22. }
  23. goto("checkgame");
  24. @player_toss
  25. cancel = true;
  26. item = living.getEquip(player, "hand");
  27. item_type = item.getType(item);
  28. if(item_type == "minecraft:bedrock") {
  29. location = entity.getLocation(player);
  30. array = entity.getLook(player);
  31. array2 = entity.getMotion(player);
  32. x = array[0] + array2[0]*0.5;
  33. y = array[1] + math.abs(array2[1])*0.5;
  34. z = array[2] + array2[2]*0.5;
  35. falling_block_entity = entity.spawn("falling_block", location, "{BlockState:{Name:\"minecraft:bedrock\"},Time:1,Motion:[0.0,1.0,0.0],DropItem:0,HurtEntities:1}");
  36. entity.throw(falling_block_entity, x, y, z);
  37. sgoto(5, "loop");
  38. }
  39. goto("checkgame");
  40. @entity_click
  41. entity_type = entity.getType(entity);
  42. if(entity_type == "falling_block"){
  43. location = entity.getLocation(player);
  44. array = entity.getLook(player);
  45. array2 = entity.getMotion(player);
  46. x = array[0]*0.5 + array2[0]*0.5;
  47. y = array[1]*0.5 + math.abs(array2[1])*0.5;
  48. z = array[2]*0.5 + array2[2]*0.5;
  49. entity.throw(falling_block_entity, x, y, z);
  50. }
  51. goto("checkgame");
  52. @living_death
  53. x = loc.getX(entity.getLocation(living_entity));
  54. if(x > middleloc){
  55. msg("dev", "Team 1 - Punkt");
  56. //team = 0;
  57. //team2 = 1;
  58. }else{
  59. msg("dev", "Team 2 - Punkt");
  60. //team = 1;
  61. //team2 = 0;
  62. }
  63. //map.add(points, team, map.get(points, team) + 1);
  64. //updateDisplay();
  65. //minigame.speakAll(gamename,"§eThe ", map.get(teamcolortext2,team), "§eTeam scored a point.");
  66. //if(map.get(points, team) == maxpoints){
  67. // winning_team = team;
  68. // goto("win");
  69. //}
  70. //goto("Aufschlag");
  71. goto("checkgame");
  72. @loop
  73. ent_loc_x = loc.getX(entity.getLocation(falling_block_entity));
  74. ent_loc_z = loc.getZ(entity.getLocation(falling_block_entity));
  75. if(ent_loc_x >= randblock_x1 || ent_loc_x <= randblock_x2){
  76. motion = entity.getMotion(falling_block_entity);
  77. x = -motion[0];
  78. y = motion[1];
  79. z = motion[2];
  80. entity.throw(falling_block_entity, x, y, z);
  81. }
  82. if(ent_loc_z >= randblock_z1 || ent_loc_z <= randblock_z2){
  83. motion = entity.getMotion(falling_block_entity);
  84. x = motion[0];
  85. y = motion[1];
  86. z = -motion[2];
  87. entity.throw(falling_block_entity, x, y, z);
  88. }
  89. sgoto(5, "loop");
  90. goto("checkgame");