bedwars.txt 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. rankingtable = "bwranks";
  2. game_short = "bw";
  3. game_tab = "§bBW";
  4. specific_lobby_handling = true;
  5. no_core_reset = true;
  6. colorcodes = map.new();
  7. map.add(colorcodes, 0, "§9");
  8. map.add(colorcodes, 1, "§c");
  9. map.add(colorcodes, 2, "§e");
  10. map.add(colorcodes, 3, "§2");
  11. map.add(colorcodes, 4, "§6");
  12. map.add(colorcodes, 5, "§5");
  13. map.add(colorcodes, 6, "§d");
  14. map.add(colorcodes, 7, "§0");
  15. teamcolortext = map.new();
  16. map.add(teamcolortext, 0, "§9blue");
  17. map.add(teamcolortext, 1, "§cred");
  18. map.add(teamcolortext, 2, "§eyellow");
  19. map.add(teamcolortext, 3, "§2green");
  20. map.add(teamcolortext, 4, "§6orange");
  21. map.add(teamcolortext, 5, "§5magenta");
  22. map.add(teamcolortext, 6, "§dpink");
  23. map.add(teamcolortext, 7, "§0black");
  24. concrete_types = map.new(); //Liste der Bau-Blöcke
  25. map.add(concrete_types, 0, "minecraft:blue_concrete");
  26. map.add(concrete_types, 1, "minecraft:red_concrete");
  27. map.add(concrete_types, 2, "minecraft:yellow_concrete");
  28. map.add(concrete_types, 3, "minecraft:green_concrete");
  29. map.add(concrete_types, 4, "minecraft:orange_concrete");
  30. map.add(concrete_types, 5, "minecraft:magenta_concrete");
  31. map.add(concrete_types, 6, "minecraft:pink_concrete");
  32. map.add(concrete_types, 7, "minecraft:black_concrete");
  33. block_click_catcher = set.new();
  34. playersinteam = map.new(); //Anzahl der Spieler im Team
  35. teamidtolist = map.new(); //Map mit Spielerlisten für jedes Team
  36. placedblocks = list.new(); //Liste aller platzierten Blöcke
  37. allteams = list.new(); //Alle Teams, die noch im Spiel sind
  38. waiters = list.new(); //Spieler in der Lobby ohne Teamzugehörigkeit
  39. players = map.new(); //Alle Spieler (key) des Spiels und deren Teamzugehörigkeit (value)
  40. gamename = "§bBedWars";
  41. bedtruesymbol = "§2✔";
  42. bedfalsesymbol = "§4✘";
  43. air_item = read.item("minecraft:air");
  44. coin_copper = read.item("km:coin_copper", 1);
  45. coin_silver = read.item("km:coin_silver", 1);
  46. coin_gold = read.item("km:coin_gold", 1);
  47. glowstone_dust = read.item("minecraft:glowstone_dust");
  48. warp_powder = read.item("{id:\"minecraft:gunpowder\",Count:1b,tag:{display:{Lore:['{\"text\":\"Teleportiert dich zu deiner Base zurück\"}'],Name:'{\"text\":\"§rWarp Powder\"}'}}}");
  49. blaze_rod = read.item("minecraft:blaze_rod", 1, "§rRettungsplattform");
  50. bed_tag = block.getTag("minecraft:beds");
  51. bed_tag2 = item.getTag("minecraft:beds");
  52. for(team = 0; team < numberofteams; team++) {
  53. map.add(playersinteam, team, 0);
  54. map.add(teamidtolist, team, list.new());
  55. }
  56. gosub("setstart");
  57. goto("simplelobby");
  58. @specificLobbyHandling
  59. player_name = player.getName(player);
  60. if(event == "player_join") {
  61. list.add(waiters, player.getName(player));
  62. resetplayer(player);
  63. stacks.setActive(player, false);
  64. return;
  65. }
  66. if(event == "player_logout" || event == "player_giveup") {
  67. list.remove(waiters, player_name);
  68. if(map.get(players, player_name) != null) {
  69. teamlist = map.get(teamidtolist, map.get(players, player_name));
  70. list.remove(teamlist, player_name);
  71. }
  72. map.remove(players, player_name);
  73. return;
  74. }
  75. if(event == "block_click") {
  76. if(hand == "OFF_HAND") {
  77. return;
  78. }
  79. if(action == "left" && set.contains(block_click_catcher, player)) {
  80. set.remove(block_click_catcher, player);
  81. return;
  82. } else {
  83. set.add(block_click_catcher, player);
  84. }
  85. if(map.contains(join_blocks, block_loc)) {
  86. newteam = map.get(join_blocks, block_loc);
  87. newteamlist = map.get(teamidtolist, newteam);
  88. if(list.contains(newteamlist, player_name)) {
  89. msg.prefix(player, gamename, "§eYou are already in this team.");
  90. return;
  91. }
  92. if(list.getSize(newteamlist) >= teamsize) {
  93. msg.prefix(player, gamename, "§eNo space for you in this team.");
  94. return;
  95. }
  96. list.remove(waiters, player_name);
  97. yetteam = map.get(players, player_name);
  98. if(yetteam != null) {
  99. yetteamlist = map.get(teamidtolist, yetteam);
  100. list.remove(yetteamlist, player_name);
  101. }
  102. list.add(newteamlist, player_name);
  103. map.add(players, player_name, newteam);
  104. msg.prefix(player, gamename, concat("§eYou joined the ", map.get(teamcolortext, newteam), " §eteam."));;
  105. entity.setName(player, concat(map.get(colorcodes, newteam), player.getName(player)));
  106. }
  107. }
  108. return;
  109. @finalstart
  110. player_list = minigame.getPlayers(script_id);
  111. if(voidedge1 != null) {
  112. voidid = event.addMoveData(voidedge1, voidedge2, 3, -1);
  113. }
  114. trap_sound = sound.get("block.note_block.pling");
  115. newbed_sound = sound.get("block.anvil.use");
  116. bed_sound = sound.get("entity.wither.death");
  117. allkills = map.new();
  118. bedkills = map.new();
  119. deaths = map.new();
  120. brokenbeds = map.new();
  121. warpinghome_loc = map.new();
  122. warpinghome_tick = map.new();
  123. warpinghome_list = list.new();
  124. lastdamagers = map.new();
  125. bedsymbol = map.new();
  126. newbedused = map.new();
  127. teambedbroken = map.new();
  128. traps = map.new();
  129. shopmenus = map.new();
  130. bed_types = map.new(); //Liste der Betten
  131. map.add(bed_types, 0, "minecraft:blue_bed");
  132. map.add(bed_types, 1, "minecraft:red_bed");
  133. map.add(bed_types, 2, "minecraft:yellow_bed");
  134. map.add(bed_types, 3, "minecraft:green_bed");
  135. map.add(bed_types, 4, "minecraft:orange_bed");
  136. map.add(bed_types, 5, "minecraft:mangenta_bed");
  137. map.add(bed_types, 6, "minecraft:pink_bed");
  138. map.add(bed_types, 7, "minecraft:black_bed");
  139. glass_types = map.new(); //Liste für Rettungsplattformen
  140. map.add(glass_types, 0, "minecraft:blue_stained_glass");
  141. map.add(glass_types, 1, "minecraft:red_stained_glass");
  142. map.add(glass_types, 2, "minecraft:yellow_stained_glass");
  143. map.add(glass_types, 3, "minecraft:green_stained_glass");
  144. map.add(glass_types, 4, "minecraft:orange_stained_glass");
  145. map.add(glass_types, 5, "minecraft:mangenta_stained_glass");
  146. map.add(glass_types, 6, "minecraft:pink_stained_glass");
  147. map.add(glass_types, 7, "minecraft:black_stained_glass");
  148. clothescode = map.new(); //Liste der Datenwerte für gefärbte Kleidung
  149. map.add(clothescode, 0, 5592575);
  150. map.add(clothescode, 1, 16733525);
  151. map.add(clothescode, 2, 16777045);
  152. map.add(clothescode, 3, 5635925);
  153. map.add(clothescode, 4, 16755200);
  154. map.add(clothescode, 5, 43690);
  155. map.add(clothescode, 6, 5592405);
  156. map.add(clothescode, 7, 0);
  157. teamcolortext2 = map.new();
  158. map.add(teamcolortext2, 0, "§9Blue");
  159. map.add(teamcolortext2, 1, "§cRed");
  160. map.add(teamcolortext2, 2, "§eYellow");
  161. map.add(teamcolortext2, 3, "§2Green");
  162. map.add(teamcolortext2, 4, "§6Orange");
  163. map.add(teamcolortext2, 5, "§5Magenta");
  164. map.add(teamcolortext2, 6, "§dPink");
  165. map.add(teamcolortext2, 7, "§0Black");
  166. colornames = map.new();
  167. map.add(colornames, 0, "blue");
  168. map.add(colornames, 1, "red");
  169. map.add(colornames, 2, "yellow");
  170. map.add(colornames, 3, "green");
  171. map.add(colornames, 4, "orange");
  172. map.add(colornames, 5, "magenta");
  173. map.add(colornames, 6, "pink");
  174. map.add(colornames, 7, "black");
  175. while(list.getSize(waiters) != 0) {
  176. team = getTeamWithLowestPeople(teamidtolist, numberofteams);
  177. teamlist = map.get(teamidtolist, team);
  178. p_name = list.getIndex(waiters, 0);
  179. list.add(teamlist, p_name);
  180. list.remove(waiters, p_name);
  181. map.add(players, p_name, team);
  182. entity.setName(read.player(p_name), concat(map.get(colorcodes, team), p_name));
  183. }
  184. event.unload("block_click");
  185. event.load("player_post_respawn");
  186. event.load("living_death");
  187. event.load("player_pickup");
  188. event.load("player_toss");
  189. event.load("entity_click");
  190. event.load("inv_click");
  191. event.load("item_air_click");
  192. event.load("player_move");
  193. starttime = time.getMillis();
  194. for(i = 0; i < numberofteams; i++) {
  195. map.add(newbedused, i, false);
  196. map.add(teambedbroken, i, false);
  197. teamlist = map.get(teamidtolist, i);
  198. size = list.getSize(teamlist);
  199. map.add(playersinteam, i, size);
  200. if(size != 0) {
  201. list.add(allteams, i);
  202. map.add(bedsymbol, i, bedtruesymbol);
  203. for(h = 0; h < size; h++) {
  204. pname = list.getIndex(teamlist, h);
  205. p = read.player(pname);
  206. msg.prefix(p, gamename, "The game has started.");
  207. entity.teleport(p, map.get(spawn_locs, i));
  208. player.setGamemode(p, "survival");
  209. player.setFly(p, false);
  210. map.add(allkills, pname, 0);
  211. map.add(bedkills, pname, 0);
  212. map.add(deaths, pname, 0);
  213. map.add(brokenbeds, pname, 0);
  214. shopmenu = inv.new("333333333333333333333333333333333333");
  215. inv.setItem(shopmenu, 0, read.item("minecraft:nether_star", 1, "§rFavoriten"));
  216. inv.setItem(shopmenu, 1, read.item("minecraft:smooth_sandstone", 1, "§rBlöcke"));
  217. inv.setItem(shopmenu, 2, read.item("minecraft:chainmail_chestplate", 1, "§rRüstung"));
  218. inv.setItem(shopmenu, 3, read.item("minecraft:stone_pickaxe", 1, "§rSpitzhacken"));
  219. inv.setItem(shopmenu, 4, read.item("minecraft:golden_sword", 1, "§rWaffen"));
  220. inv.setItem(shopmenu, 5, read.item("minecraft:bow", 1, "§rBögen"));
  221. inv.setItem(shopmenu, 6, read.item("minecraft:apple", 1, "§rNahrung"));
  222. inv.setItem(shopmenu, 7, read.item("minecraft:potion", 1, "§rTränke"));
  223. inv.setItem(shopmenu, 8, read.item("minecraft:tnt", 1, "§rSpezial"));
  224. map.add(shopmenus, player.getId(p), shopmenu);
  225. }
  226. }
  227. setBed(i);
  228. }
  229. minigame.displayAll(0, "§bBedWars");
  230. gosub("setdisplay");
  231. drop_counter = 0;
  232. @item_dropper
  233. for(i = 0; i < list.getSize(copper_locs); i++) {
  234. loc = list.getIndex(copper_locs, i);
  235. item.drop(loc, coin_copper);
  236. }
  237. if(drop_counter == 15) {
  238. for(i = 0; i < list.getSize(silver_locs); i++) {
  239. loc = list.getIndex(silver_locs, i);
  240. item.drop(loc, coin_silver);
  241. }
  242. }
  243. if(drop_counter == 30) {
  244. for(i = 0; i < list.getSize(silver_locs); i++) {
  245. loc = list.getIndex(silver_locs, i);
  246. item.drop(loc, coin_silver);
  247. }
  248. for(i = 0; i < list.getSize(gold_locs); i++) {
  249. loc = list.getIndex(gold_locs, i);
  250. item.drop(loc, coin_gold);
  251. }
  252. drop_counter = 0;
  253. }
  254. minigame.displayAll(1, concat("§6Gold §r", text.number(30 - drop_counter)));
  255. if(drop_counter < 15) {
  256. iron_drop_counter = drop_counter + 15;
  257. } else {
  258. iron_drop_counter = drop_counter;
  259. }
  260. minigame.displayAll(2, concat("§7Silber §r", text.number(30 - iron_drop_counter)));
  261. drop_counter++;
  262. sgoto(20, "item_dropper");
  263. for(i = 0; i < list.getSize(player_list); i++) {
  264. p = player.get(list.getIndex(player_list, i));
  265. p_name = player.getName(p);
  266. tempteam = map.get(players, p_name);
  267. color = bedwars.getTeamColor(p);
  268. player.action(p, concat(color, "Team ", map.get(teamcolortext2, tempteam)));
  269. minigame.setTabName(p, game_tab, color);
  270. }
  271. @checkgame
  272. wait();
  273. if(event == "living_pre_hurt" || event == "living_death") {
  274. if(!isPlayer(living_entity)) {
  275. goto("checkgame");
  276. }
  277. player = living_entity;
  278. }
  279. if(player.hasMinigameId(player, script_id)) {
  280. player_name = player.getName(player);
  281. ignoreGoto(event);
  282. }
  283. goto("checkgame");
  284. @entity_click
  285. if(text.class(entity) == "EntityHuman") {
  286. shopmenu = map.get(shopmenus, player.getId(player));
  287. setShopmenu1(shopmenu);
  288. inv.open(shopmenu, player, "§8Shop");
  289. inv.update(player);
  290. }
  291. goto("checkgame");
  292. @inv_click
  293. item_type = item.getType(item);
  294. if(item_type == "minecraft:air") {
  295. goto("checkgame");
  296. }
  297. factor = 1;
  298. if(click_type == "QUICK_MOVE") {
  299. factor = 8;
  300. }
  301. shopmenu = map.get(shopmenus, player.getId(player));
  302. if(inv_slot < 9) {
  303. for(slot = 9; slot < 36; slot++) {
  304. inv.setItem(shopmenu, slot, air_item);
  305. }
  306. if(inv_slot == 0) {
  307. setShopmenu1(shopmenu);
  308. }
  309. if(inv_slot == 1) {
  310. setShopmenu2(shopmenu);
  311. }
  312. if(inv_slot == 2) {
  313. setShopmenu3(shopmenu);
  314. }
  315. if(inv_slot == 3) {
  316. setShopmenu4(shopmenu);
  317. }
  318. if(inv_slot == 4) {
  319. setShopmenu5(shopmenu);
  320. }
  321. if(inv_slot == 5) {
  322. setShopmenu6(shopmenu);
  323. }
  324. if(inv_slot == 6) {
  325. setShopmenu7(shopmenu);
  326. }
  327. if(inv_slot == 7) {
  328. setShopmenu8(shopmenu);
  329. }
  330. if(inv_slot == 8) {
  331. setShopmenu9(shopmenu);
  332. }
  333. inv.update(player);
  334. goto("checkgame");
  335. }
  336. //buyitem
  337. if(item_type == "km:coin_copper" || item_type == "km:coin_silver" || item_type == "km:coin_gold" || item_type == "minecraft:air") {
  338. goto("checkgame");
  339. }
  340. priceitem = item.clone(inv.getItem(shopmenu, inv_slot + 9));
  341. item.setAmount(priceitem, item.getAmount(priceitem) * factor);
  342. if(player.getItemAmount(player, false, priceitem) < item.getAmount(priceitem)) {
  343. goto("checkgame");
  344. }
  345. player.removeItemNbt(player, priceitem);
  346. if(item_type == "minecraft:red_bed") {
  347. goto("setnewbed");
  348. }
  349. if(item_type == "minecraft:leather_helmet" || item_type == "minecraft:leather_leggings" || item_type == "minecraft:leather_boots") {
  350. clothescolor = map.get(clothescode, map.get(players, player_name));
  351. item = read.item(concat("{id:\"", item_type, "\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}],display:{color:", clothescolor, "}}}"));
  352. } elseif(item_type == "minecraft:smooth_sandstone") {
  353. team = map.get(players, player_name);
  354. item_type = map.get(concrete_types, team);
  355. item_amount = item.getAmount(inv.getItem(shopmenu, inv_slot));
  356. item = read.item(item_type, item_amount);
  357. }
  358. if(click_type == "QUICK_MOVE") {
  359. item = item.clone(item);
  360. item.setAmount(item, item.getAmount(item) * factor);
  361. }
  362. player.safeGiveItem(player, item);
  363. inv.update(player);
  364. goto("checkgame");
  365. @breakbed
  366. if(list.contains(foot_bed_loc, block_loc)) {
  367. team = list.getIndexOf(foot_bed_loc, block_loc);
  368. bed_part = "foot";
  369. } elseif(list.contains(head_bed_loc, block_loc)) {
  370. team = list.getIndexOf(head_bed_loc, block_loc);
  371. bed_part = "head";
  372. } else {
  373. msg.prefix(player, gamename, "§eThis bed is not part of the game.");
  374. goto("checkgame");
  375. }
  376. teamlist = map.get(teamidtolist, team);
  377. if(list.contains(teamlist, player_name)) {
  378. facing = map.get(bed_facing, team);
  379. bed_type = map.get(bed_types, team);
  380. if(bed_part == "foot") {
  381. head_loc = list.getIndex(head_bed_loc, team);
  382. block.set(head_loc, "minecraft:stone");
  383. block.set(head_loc, concat(bed_type, "[facing= ", facing, ", part=head]"));
  384. block.set(block_loc, concat(bed_type, "[facing= ", facing, ", part=foot]"));
  385. } else {
  386. foot_loc = list.getIndex(foot_bed_loc, team);
  387. block.set(foot_loc, "minecraft:stone");
  388. block.set(foot_loc, concat(bed_type, "[facing= ", facing, ", part=foot]"));
  389. block.set(block_loc, concat(bed_type, "[facing= ", facing, ", part=head]"));
  390. }
  391. msg.prefix(player, gamename, "§eThis is your own bed.");
  392. goto("checkgame");
  393. }
  394. cancel = false;
  395. tempcolor = map.get(colornames, team);
  396. map.add(teambedbroken, team, true);
  397. map.add(bedsymbol, team, bedfalsesymbol);
  398. map.add(brokenbeds, player_name, map.get(brokenbeds, player_name) + 1);
  399. owncolor = map.get(colorcodes, map.get(players, player_name));
  400. minigame.speakAll(gamename, concat("§cThe ", map.get(teamcolortext, team), " §cbed has been destroyed by ", owncolor, player_name, "."));
  401. gosub("setdisplay");
  402. for(i = 0; i < list.getSize(player_list); i++) {
  403. p = player.get(list.getIndex(player_list, i));
  404. sound.spawnForPlayer(p, bed_sound, sound_category_ambient);
  405. }
  406. goto("checkgame");
  407. @setdisplay //Alle Teams mit Bett werden oben angezeigt, danach alle Teams ohne Bett. Ausgelöschte Teams werden gar nicht angezeigt
  408. bedtrue = list.new();
  409. bedfalse = list.new();
  410. index = 10;
  411. for(i = 0; i < list.getSize(allteams); i++) {
  412. tempteam2 = list.getIndex(allteams, i);
  413. if(!map.get(teambedbroken, tempteam2)) {
  414. list.add(bedtrue, tempteam2);
  415. } else {
  416. list.add(bedfalse, tempteam2);
  417. }
  418. }
  419. size = list.getSize(bedtrue);
  420. if(size != 0) {
  421. for(i = 0; i < size; i++) {
  422. tempteam2 = list.getIndex(bedtrue, i);
  423. minigame.displayAll(++index, concat(text.number(map.get(playersinteam, tempteam2)), " §2✔ ", map.get(teamcolortext2, tempteam2)));
  424. }
  425. }
  426. size = list.getSize(bedfalse);
  427. if(size != 0) {
  428. for(i = 0; i < size; i++) {
  429. tempteam2 = list.getIndex(bedfalse, i);
  430. minigame.displayAll(++index, concat(text.number(map.get(playersinteam, tempteam2)), " §4✘ ", map.get(teamcolortext2, tempteam2)));
  431. }
  432. }
  433. return;
  434. @setnewbed
  435. team = map.get(players, player_name);
  436. tempcolor = map.get(colornames, team);
  437. if(map.get(newbedused, team)) {
  438. msg.prefix(player, gamename, "§eYou can only us this once.");
  439. goto("checkgame");
  440. }
  441. if(!map.get(teambedbroken, team)) {
  442. msg.prefix(player, gamename, "§eYour bed is not destroyed yet.");
  443. goto("checkgame");
  444. }
  445. setBed(team);
  446. map.add(teambedbroken, team, false);
  447. map.add(bedsymbol, team, bedtruesymbol);
  448. map.add(newbedused, team, true);
  449. minigame.speakAll(gamename, concat("§eThe ", map.get(teamcolortext, team), " §ebed has been replaced."));
  450. gosub("setdisplay");
  451. for(i = 0; i < list.getSize(player_list); i++) {
  452. p = player.get(list.getIndex(player_list, i));
  453. sound.spawnForPlayer(p, newbed_sound, sound_category_ambient);
  454. }
  455. goto("checkgame");
  456. @player_toss
  457. if(item.getType(item) == "minecraft:glowstone_dust") {
  458. cancel = true;
  459. player.giveItem(player, item);
  460. inv.update(player);
  461. }
  462. goto("checkgame");
  463. @player_pickup
  464. if(item.hasTag(bed_tag2, item)) {
  465. cancel = true;
  466. entity.remove(entity);
  467. }
  468. goto("checkgame");
  469. @item_air_click
  470. item_type = item.getType(living.getEquip(player, "hand"));
  471. if(item_type == "minecraft:gunpowder") {
  472. if(!map.contains(warpinghome_tick, player)) {
  473. player_uuid = player.getUuid(player);
  474. player.removeItem(player, warp_powder);
  475. player.giveItem(player, glowstone_dust);
  476. map.add(warpinghome_loc, player_uuid, entity.getLocation(player));
  477. map.add(warpinghome_tick, player_uuid, 0);
  478. list.add(warpinghome_list, player_uuid);
  479. sgoto(20, "warp_tick");
  480. goto("checkgame");
  481. }
  482. }
  483. if(item_type == "minecraft:glowstone_dust") {
  484. player_uuid = player.getUuid(player);
  485. map.remove(warpinghome_loc, player_uuid);
  486. map.remove(warpinghome_tick, player_uuid);
  487. player.removeItem(player, glowstone_dust);
  488. player.giveItem(player, warp_powder);
  489. }
  490. if(item_type == "minecraft:blaze_rod") {
  491. player_loc = entity.getLocation(player);
  492. team = map.get(players, player_name);
  493. item_type = map.get(glass_types, team);
  494. temp_loc = loc.mod(player_loc, 0, -1, 0);
  495. if(setBlockIfNotAir(temp_loc, item_type)) {
  496. list.add(placedblocks, temp_loc);
  497. }
  498. temp_loc = loc.mod(player_loc, 1, -1, 0);
  499. if(setBlockIfNotAir(temp_loc, item_type)) {
  500. list.add(placedblocks, temp_loc);
  501. }
  502. temp_loc = loc.mod(player_loc, -1, -1, 0);
  503. if(setBlockIfNotAir(temp_loc, item_type)) {
  504. list.add(placedblocks, temp_loc);
  505. }
  506. temp_loc = loc.mod(player_loc, 0, -1, 1);
  507. if(setBlockIfNotAir(temp_loc, item_type)) {
  508. list.add(placedblocks, temp_loc);
  509. }
  510. temp_loc = loc.mod(player_loc, 0, -1, -1);
  511. if(setBlockIfNotAir(temp_loc, item_type)) {
  512. list.add(placedblocks, temp_loc);
  513. }
  514. temp_loc = loc.mod(player_loc, -1, -1, -1);
  515. if(setBlockIfNotAir(temp_loc, item_type)) {
  516. list.add(placedblocks, temp_loc);
  517. }
  518. temp_loc = loc.mod(player_loc, 1, -1, 1);
  519. if(setBlockIfNotAir(temp_loc, item_type)) {
  520. list.add(placedblocks, temp_loc);
  521. }
  522. temp_loc = loc.mod(player_loc, 1, -1, -1);
  523. if(setBlockIfNotAir(temp_loc, item_type)) {
  524. list.add(placedblocks, temp_loc);
  525. }
  526. temp_loc = loc.mod(player_loc, -1, -1, 1);
  527. if(setBlockIfNotAir(temp_loc, item_type)) {
  528. list.add(placedblocks, temp_loc);
  529. }
  530. temp_loc = loc.mod(player_loc, 2, -1, 0);
  531. if(setBlockIfNotAir(temp_loc, item_type)) {
  532. list.add(placedblocks, temp_loc);
  533. }
  534. temp_loc = loc.mod(player_loc, -2, -1, 0);
  535. if(setBlockIfNotAir(temp_loc, item_type)) {
  536. list.add(placedblocks, temp_loc);
  537. }
  538. temp_loc = loc.mod(player_loc, 0, -1, 2);
  539. if(setBlockIfNotAir(temp_loc, item_type)) {
  540. list.add(placedblocks, temp_loc);
  541. }
  542. temp_loc = loc.mod(player_loc, 0, -1, -2);
  543. if(setBlockIfNotAir(temp_loc, item_type)) {
  544. list.add(placedblocks, temp_loc);
  545. }
  546. player.removeItem(player, blaze_rod);
  547. }
  548. goto("checkgame");
  549. @warp_tick
  550. player_uuid = list.getIndex(warpinghome_list, 0);
  551. player = player.get(player_uuid);
  552. if(player == null) {
  553. goto("checkgame");
  554. }
  555. list.removeIndex(warpinghome_list, 0);
  556. player_loc = entity.getLocation(player);
  557. warp_loc = map.get(warpinghome_loc, player_uuid);
  558. if(warp_loc == null) {
  559. goto("checkgame");
  560. }
  561. if(loc.distance(player_loc, warp_loc) > 1) {
  562. map.remove(warpinghome_loc, player_uuid);
  563. map.remove(warpinghome_tick, player_uuid);
  564. player.removeItem(player, glowstone_dust);
  565. player.giveItem(player, warp_powder);
  566. goto("checkgame");
  567. }
  568. tick = map.get(warpinghome_tick, player_uuid) + 1;
  569. sound.spawnForPlayer(player, trap_sound, sound_category_ambient);
  570. if(tick == 5) {
  571. map.remove(warpinghome_loc, player_uuid);
  572. map.remove(warpinghome_tick, player_uuid);
  573. player.removeItem(player, glowstone_dust);
  574. player_name = player.getName(player);
  575. tempteam = map.get(players, player_name);
  576. location = map.get(spawn_locs, tempteam);
  577. entity.teleport(player, location);
  578. goto("checkgame");
  579. }
  580. map.add(warpinghome_tick, player_uuid, tick);
  581. list.add(warpinghome_list, player_uuid);
  582. sgoto(20, "warp_tick");
  583. goto("checkgame");
  584. @player_move
  585. if(id == voidid) {
  586. living.damage(player, 300);
  587. goto("checkgame");
  588. }
  589. temploc = entity.getLocation(player);
  590. tempx = math.roundDown(loc.getX(temploc));
  591. tempy = math.roundDown(loc.getY(temploc));
  592. tempz = math.roundDown(loc.getZ(temploc));
  593. temploc = loc.new(gamesworld, tempx, tempy, tempz);
  594. if(block.getType(temploc) != "minecraft:tripwire") { //Für den Fall, dass die Trap bereits abgebaut wurde
  595. map.remove(traps, id);
  596. event.removeMoveData(id);
  597. goto("checkgame");
  598. }
  599. tempteam = map.get(players, player_name);
  600. trapteam = map.get(traps, id);
  601. if(tempteam == trapteam) {
  602. goto("checkgame");
  603. }
  604. msg.prefix(player, gamename, "§eYou triggered in a trap!!!");
  605. sound.spawnForPlayer(p, trap_sound, sound_category_ambient);
  606. teamlist = map.get(teamidtolist, trapteam);
  607. for(i = 0; i < list.getSize(teamlist); i++) {
  608. p = read.player(list.getIndex(teamlist, i));
  609. sound.spawnForPlayer(p, trap_sound, sound_category_ambient);
  610. msg.prefix(p, gamename, "§eOne of your traps got triggered!!!");
  611. }
  612. entity.addEffect(player, "blindness", 200, 1);
  613. entity.addEffect(player, "slowness", 200, 4);
  614. map.remove(traps, id);
  615. block.set(temploc, "minecraft:air");
  616. goto("checkgame");
  617. @block_place
  618. cancel = true;
  619. if(block.hasTag(bed_tag, block.get(block_loc))) {
  620. goto("checkgame");
  621. } elseif(block_type == "minecraft:tripwire") {
  622. tempid = event.addMoveData(block_loc, loc.mod(block_loc, 1, 0.25, 1), 5, -1);
  623. map.add(traps, tempid, map.get(players, player_name));
  624. }
  625. if(min_build_high != null && loc.getY(block_loc) <= min_build_high) {
  626. goto("checkgame");
  627. }
  628. cancel = false;
  629. list.add(placedblocks, block_loc);
  630. goto("checkgame");
  631. @block_break
  632. cancel = true;
  633. if(block_type == "minecraft:cobweb") {
  634. block.set(block_loc, "minecraft:air");
  635. } elseif(block.hasTag(bed_tag, block.get(block_loc))) {
  636. goto("breakbed");
  637. } elseif(block_type == "minecraft:iron_block") {
  638. player_item_type = item.getType(living.getEquip(player, "hand"));
  639. if(player_item_type == "minecraft:stone_pickaxe" || player_item_type == "minecraft:iron_pickaxe") {
  640. cancel = false;
  641. }
  642. } elseif(block_type == "minecraft:string") {
  643. cancel = false;
  644. } elseif(list.contains(placedblocks, block_loc)) {
  645. cancel = false;
  646. }
  647. goto("checkgame");
  648. @player_post_respawn
  649. tempteam = map.get(players, player_name);
  650. entity.setName(player, concat(map.get(colorcodes, tempteam), player_name));
  651. if(map.get(teambedbroken, tempteam)) {
  652. gosub("setdisplay");
  653. if(!checkPlayability(tempteam)) {
  654. goto("colorgameover");
  655. }
  656. }
  657. location = map.get(spawn_locs, tempteam);
  658. location2 = loc.mod(location, 0, 1, 0);
  659. block_type = block.getType(location);
  660. block_type2 = block.getType(location2);
  661. while(!(block.isAir(location) && block.isAir(location2))) {
  662. loc.add(location, 0, 1, 0);
  663. loc.add(location2, 0, 1, 0);
  664. }
  665. entity.teleport(player, location);
  666. goto("checkgame");
  667. @player_giveup
  668. @player_logout
  669. minigame.speakAll(gamename, concat(map.get(colorcodes, map.get(players, player_name)), player_name, " §ehas left the game."));
  670. tempteam = map.get(players, player_name);
  671. teamlist = map.get(teamidtolist, tempteam);
  672. list.remove(teamlist, player_name);
  673. map.add(playersinteam, tempteam, map.get(playersinteam, tempteam) - 1);
  674. map.remove(players, player_name);
  675. script = script.getFromId(script_id);
  676. minigame.kickplayer(script, player);
  677. gosub("setdisplay");
  678. if(!checkPlayability(tempteam)) {
  679. goto("colorgameover");
  680. }
  681. goto("checkgame");
  682. @living_pre_hurt
  683. cancel = true;
  684. tempplayerteam = map.get(players, player_name);
  685. tempcolor = map.get(colorcodes, tempplayerteam);
  686. sec_player = player.getFromDamageSource(damage_source);
  687. if(sec_player != null) {
  688. sec_player_name = player.getName(sec_player);
  689. teamlist = map.get(teamidtolist, tempplayerteam);
  690. if(!list.contains(teamlist, sec_player_name)) {
  691. cancel = false;
  692. }
  693. map.add(lastdamagers, player, map.new());
  694. tempmap = map.get(lastdamagers, player);
  695. map.add(tempmap, "sec_player", sec_player);
  696. map.add(tempmap, "time", time.getMillis());
  697. } else {
  698. cancel = false;
  699. }
  700. goto("checkgame");
  701. @living_death
  702. map.add(deaths, player_name, map.get(deaths, player_name) + 1);
  703. player.clearInventory(player);
  704. tempmap = map.get(lastdamagers, player);
  705. if(tempmap != null) {
  706. nowtime = time.getMillis();
  707. hittime = map.get(tempmap, "time");
  708. if(nowtime - hittime < 10000) { //Wenn seit Begegnung mehr als 10 Sekunden her sind, zählt sec_player nicht mehr
  709. sec_player = map.get(tempmap, "sec_player");
  710. }
  711. } else {
  712. sec_player = player.getFromDamageSource(damage_source);
  713. }
  714. if(sec_player == null) {
  715. minigame.speakAll(gamename, concat(tempcolor, concat(player_name, " §edied.")));
  716. } else {
  717. sec_player_name = player.getName(sec_player);
  718. tempoppcolor = map.get(colorcodes, map.get(players, sec_player_name));
  719. minigame.speakAll(gamename, concat(tempcolor, player_name, " §ehas been killed by ", tempoppcolor, sec_player_name, "."));
  720. map.add(allkills, sec_player_name, map.get(allkills, sec_player_name) + 1);
  721. }
  722. if(map.get(teambedbroken, tempplayerteam)) {
  723. goto("nobed");
  724. }
  725. goto("checkgame");
  726. @nobed
  727. money.addBoost(player, 32);
  728. minigame.speakAll(gamename, concat(tempcolor, player_name, " §ewoke up from their dream."));
  729. showstats(player, false, false);
  730. script = script.getFromId(script_id);
  731. minigame.kickplayer(script, player);
  732. teamlist = map.get(teamidtolist, map.get(players, player_name));
  733. list.remove(teamlist, player_name);
  734. map.remove(players, player_name);
  735. map.add(playersinteam, tempplayerteam, map.get(playersinteam, tempplayerteam) - 1);
  736. if(sec_player != null) {
  737. map.add(bedkills, sec_player_name, map.get(bedkills, sec_player_name) + 1);
  738. }
  739. if(!checkPlayability(tempplayerteam)) {
  740. tempteam = tempplayerteam;
  741. goto("colorgameover");
  742. }
  743. goto("checkgame");
  744. function checkPlayability(tempteam) {
  745. if(map.get($playersinteam, tempteam) == 0) {
  746. return false;
  747. }
  748. return true;
  749. }
  750. @colorgameover
  751. tempcolortext = map.get(teamcolortext, tempteam);
  752. minigame.speakAll(gamename, concat("§cThe ", tempcolortext, " §cteam has been eliminated."));
  753. list.remove(allteams, tempteam);
  754. if(list.getSize(allteams) == 1) {
  755. goto("gameover");
  756. }
  757. goto("checkgame");
  758. function showstats(player, show_time, won) { //Player player, Boolean show_time, Boolean won
  759. player_name = player.getName(player);
  760. player_id = player.getId(player);
  761. last_record = ranking.getPoints($rankingtable, player_id);
  762. playedgames = minigame.getPlayed(player_id, $game_short) + 1;
  763. minigame.setPlayed(player_id, $game_short, playedgames);
  764. points = last_record + map.get($bedkills, player_name);
  765. ranking.setPoints($rankingtable, player_id, points);
  766. p_deaths = map.get($deaths, player_name);
  767. p_allkills = map.get($allkills, player_name);
  768. p_bedkills = map.get($bedkills, player_name);
  769. bw.setAllKills(player, bw.getAllKills(player) + p_allkills);
  770. minigame.statsHeader(player, $gamename, "§e");
  771. if(show_time) {
  772. time = ($endtime - $starttime) / 1000;
  773. minigame.statsLine(player, "§e", "Time", concat(text.number(math.rounddown(time / 60)), " min ", text.number(math.round(time % 60)), " s"));
  774. }
  775. minigame.statsLine(player, "§e", "All-Kills", text.number(p_allkills));
  776. minigame.statsLine(player, "§e", "Bed-Kills", text.number(p_bedkills));
  777. minigame.statsLine(player, "§e", "Deaths", text.number(p_deaths));
  778. if(p_deaths != 0) {
  779. kd = p_allkills / p_deaths;
  780. minigame.statsLine(player, "§e", "K/D", text.number(math.roundComma(kd, 2)));
  781. }
  782. minigame.statsLine(player, "§e", "Destroyed beds", text.number(map.get($brokenbeds, player_name)));
  783. minigame.statsLine(player, "§e", "Played games", text.number(playedgames));
  784. wongames = minigame.getWon(player, "bw");
  785. if(won) {
  786. wongames++;
  787. minigame.setWon(player, "knock", wongames);
  788. }
  789. minigame.statsLine(player, "§e", "Won games", text.number(wongames));
  790. if(playedgames != 0) {
  791. minigame.statsLine(player, "§e", "Win ratio", concat(text.number(math.roundComma((wongames / playedgames) * 100, 2)), "%"));
  792. }
  793. }
  794. function bw.setAllKills(player_or_id, amount) {
  795. config = playerdata.getGames(player_or_id);
  796. config.set(config, "allbwkills", amount);
  797. config.saveAsync(config);
  798. }
  799. function bw.getAllKills(player_or_id) {
  800. config = playerdata.getGames(player_or_id);
  801. return config.getDouble(config, "allbwkills", 0);
  802. }
  803. function setBed(team) {
  804. facing = map.get($bed_facing, team);
  805. bed_type = map.get($bed_types, team);
  806. block.set(list.getIndex($foot_bed_loc, team), concat(bed_type, "[facing= ", facing, ", part=foot]"));
  807. block.set(list.getIndex($head_bed_loc, team), concat(bed_type, "[facing= ", facing, ", part=head]"));
  808. }
  809. @gameover
  810. endtime = time.getMillis();
  811. if(list.getSize(placedblocks) != 0) {
  812. for(i = 0; i < list.getSize(placedblocks); i++) {
  813. block.set(list.getIndex(placedblocks, i), "minecraft:air");
  814. }
  815. }
  816. entity.removeAll("net.minecraft.entity.item.ItemEntity", middleloc, radius);
  817. waitfor(1);
  818. winningteam = map.get(teamidtolist, list.getIndex(allteams, 0));
  819. for(i = 0; i < list.getSize(winningteam); i++) {
  820. player_name = list.getIndex(winningteam, i);
  821. player = read.player(player_name);
  822. money.addBoost(player, 128);
  823. msg.prefix(player, gamename, "§eYou won this game!");
  824. showstats(player, true, true);
  825. script = script.getFromId(script_id);
  826. minigame.kickplayer(script, player);
  827. }
  828. script = script.getFromId(script_id);
  829. minigame.term(script, gamesignloc);
  830. term();
  831. function setShopmenu1(shopmenu) {
  832. inv.setItem(shopmenu, 19, read.item("{id:\"minecraft:stick\",Count:1b,tag:{HideFlags:2,Enchantments:[{lvl:1s,id:\"minecraft:knockback\"}],display:{Name:'{\"text\":\"§bKnüppel\"}'},}}"));
  833. inv.setItem(shopmenu, 20, read.item("{id:\"minecraft:wooden_pickaxe\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:efficiency\"},{lvl:1s,id:\"minecraft:unbreaking\"}],HideFlags:2}}"));
  834. inv.setItem(shopmenu, 21, read.item("minecraft:smooth_sandstone", 32));
  835. inv.setItem(shopmenu, 22, read.item("{id:\"minecraft:leather_helmet\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}]}}"));
  836. inv.setItem(shopmenu, 23, read.item("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}]}}"));
  837. inv.setItem(shopmenu, 24, read.item("{id:\"minecraft:leather_boots\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}]}}"));
  838. inv.setItem(shopmenu, 28, read.item("km:coin_copper", 8));
  839. inv.setItem(shopmenu, 29, read.item("km:coin_copper", 4));
  840. inv.setItem(shopmenu, 30, read.item("km:coin_copper", 16));
  841. inv.setItem(shopmenu, 31, read.item("km:coin_copper"));
  842. inv.setItem(shopmenu, 32, read.item("km:coin_copper"));
  843. inv.setItem(shopmenu, 33, read.item("km:coin_copper"));
  844. }
  845. function setShopmenu2(shopmenu) {
  846. inv.setItem(shopmenu, 19, read.item("minecraft:smooth_sandstone", 2));
  847. inv.setItem(shopmenu, 20, read.item("minecraft:end_stone"));
  848. inv.setItem(shopmenu, 21, read.item("minecraft:iron_block"));
  849. inv.setItem(shopmenu, 22, read.item("minecraft:chest"));
  850. inv.setItem(shopmenu, 23, read.item("minecraft:glass"));
  851. inv.setItem(shopmenu, 28, read.item("km:coin_copper"));
  852. inv.setItem(shopmenu, 29, read.item("km:coin_copper", 7));
  853. inv.setItem(shopmenu, 30, read.item("km:coin_silver", 3));
  854. inv.setItem(shopmenu, 31, read.item("km:coin_silver"));
  855. inv.setItem(shopmenu, 32, read.item("km:coin_copper", 4));
  856. }
  857. function setShopmenu3(shopmenu) {
  858. inv.setItem(shopmenu, 19, read.item("{id:\"minecraft:leather_helmet\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}]}}"));
  859. inv.setItem(shopmenu, 20, read.item("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}]}}"));
  860. inv.setItem(shopmenu, 21, read.item("{id:\"minecraft:leather_boots\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}]}}"));
  861. inv.setItem(shopmenu, 22, read.item("{id:\"minecraft:chainmail_chestplate\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}],display:{Name:'{\"text\":\"§f§bKettenbrust Lvl1\"}'}}}"));
  862. inv.setItem(shopmenu, 23, read.item("{id:\"minecraft:chainmail_chestplate\",Count:1b,tag:{Enchantments:[{lvl:2s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}],display:{Name:'{\"text\":\"§f§bKettenbrust Lvl2\"}'}}}"));
  863. inv.setItem(shopmenu, 24, read.item("{id:\"minecraft:chainmail_chestplate\",Count:1b,tag:{Enchantments:[{lvl:3s,id:\"minecraft:protection\"},{lvl:1s,id:\"minecraft:unbreaking\"}],display:{Name:'{\"text\":\"§f§bKettenbrust Lvl3\"}'}}}"));
  864. inv.setItem(shopmenu, 25, read.item("minecraft:shield"));
  865. inv.setItem(shopmenu, 28, read.item("km:coin_copper"));
  866. inv.setItem(shopmenu, 29, read.item("km:coin_copper"));
  867. inv.setItem(shopmenu, 30, read.item("km:coin_copper"));
  868. inv.setItem(shopmenu, 31, read.item("km:coin_silver"));
  869. inv.setItem(shopmenu, 32, read.item("km:coin_silver", 3));
  870. inv.setItem(shopmenu, 33, read.item("km:coin_silver", 7));
  871. inv.setItem(shopmenu, 34, read.item("km:coin_silver", 4));
  872. }
  873. function setShopmenu4(shopmenu) {
  874. inv.setItem(shopmenu, 21, read.item("{id:\"minecraft:wooden_pickaxe\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:efficiency\"},{lvl:1s,id:\"minecraft:unbreaking\"}],HideFlags:2}}"));
  875. inv.setItem(shopmenu, 22, read.item("{id:\"minecraft:stone_pickaxe\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:efficiency\"},{lvl:1s,id:\"minecraft:unbreaking\"}],HideFlags:2}}"));
  876. inv.setItem(shopmenu, 23, read.item("{id:\"minecraft:iron_pickaxe\",Count:1b,tag:{Enchantments:[{lvl:3s,id:\"minecraft:efficiency\"},{lvl:1s,id:\"minecraft:unbreaking\"}],HideFlags:2}}"));
  877. inv.setItem(shopmenu, 30, read.item("km:coin_copper", 4));
  878. inv.setItem(shopmenu, 31, read.item("km:coin_silver", 2));
  879. inv.setItem(shopmenu, 32, read.item("km:coin_gold"));
  880. }
  881. function setShopmenu5(shopmenu) {
  882. inv.setItem(shopmenu, 20, read.item("{id:\"minecraft:stick\",Count:1b,tag:{HideFlags:2,Enchantments:[{lvl:1s,id:\"minecraft:knockback\"}],display:{Name:'{\"text\":\"§bKnüppel\"}'},}}"));
  883. inv.setItem(shopmenu, 21, read.item("{id:\"minecraft:golden_sword\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:sharpness\"},{lvl:1s,id:\"minecraft:unbreaking\"}],HideFlags:2,display:{Name:'{\"text\":\"§f§bGoldschwert Lvl1\"}'}}}"));
  884. inv.setItem(shopmenu, 22, read.item("{id:\"minecraft:wooden_axe\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:sharpness\"},{lvl:1s,id:\"minecraft:unbreaking\"}],HideFlags:2}}"));
  885. inv.setItem(shopmenu, 23, read.item("{id:\"minecraft:golden_sword\",Count:1b,tag:{Enchantments:[{lvl:2s,id:\"minecraft:sharpness\"},{lvl:1s,id:\"minecraft:unbreaking\"}],HideFlags:2,display:{Name:'{\"text\":\"§f§bGoldschwert Lvl2\"}'}}}"));
  886. inv.setItem(shopmenu, 24, read.item("{id:\"minecraft:iron_sword\",Count:1b,tag:{Enchantments:[{lvl:2s,id:\"minecraft:sharpness\"},{lvl:1s,id:\"minecraft:unbreaking\"},{lvl:1s,id:\"minecraft:knockback\"}],HideFlags:2}}"));
  887. inv.setItem(shopmenu, 29, read.item("km:coin_copper", 8));
  888. inv.setItem(shopmenu, 30, read.item("km:coin_silver"));
  889. inv.setItem(shopmenu, 31, read.item("km:coin_silver", 2));
  890. inv.setItem(shopmenu, 32, read.item("km:coin_silver", 3));
  891. inv.setItem(shopmenu, 33, read.item("km:coin_gold", 5));
  892. }
  893. function setShopmenu6(shopmenu) {
  894. inv.setItem(shopmenu, 20, read.item("{id:\"minecraft:bow\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:infinity\"}],display:{Name:'{\"text\":\"§f§bBogen Lvl1\"}'}}}"));
  895. inv.setItem(shopmenu, 21, read.item("{id:\"minecraft:bow\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:infinity\"},{lvl:1s,id:\"minecraft:power\"}],display:{Name:'{\"text\":\"§f§bBogen Lvl2\"}'}}}"));
  896. inv.setItem(shopmenu, 22, read.item("{id:\"minecraft:bow\",Count:1b,tag:{Enchantments:[{lvl:1s,id:\"minecraft:infinity\"},{lvl:1s,id:\"minecraft:power\"},{lvl:1s,id:\"minecraft:punch\"}],display:{\"text\":\"§f§bBogen Lvl3\"}}}"));
  897. inv.setItem(shopmenu, 23, read.item("minecraft:arrow"));
  898. inv.setItem(shopmenu, 24, read.item("minecraft:spectral_arrow"));
  899. inv.setItem(shopmenu, 29, read.item("km:coin_gold", 3));
  900. inv.setItem(shopmenu, 30, read.item("km:coin_gold", 7));
  901. inv.setItem(shopmenu, 31, read.item("km:coin_gold", 13));
  902. inv.setItem(shopmenu, 32, read.item("km:coin_gold"));
  903. inv.setItem(shopmenu, 33, read.item("km:coin_silver", 2));
  904. }
  905. function setShopmenu7(shopmenu) {
  906. inv.setItem(shopmenu, 20, read.item("minecraft:apple"));
  907. inv.setItem(shopmenu, 21, read.item("minecraft:cooked_porkchop"));
  908. inv.setItem(shopmenu, 22, read.item("minecraft:cake"));
  909. inv.setItem(shopmenu, 23, read.item("minecraft:golden_apple"));
  910. inv.setItem(shopmenu, 29, read.item("km:coin_copper"));
  911. inv.setItem(shopmenu, 30, read.item("km:coin_copper", 2));
  912. inv.setItem(shopmenu, 31, read.item("km:coin_silver"));
  913. inv.setItem(shopmenu, 32, read.item("km:coin_gold", 2));
  914. }
  915. function setShopmenu8(shopmenu) {
  916. inv.setItem(shopmenu, 19, read.item("{id:\"minecraft:potion\",Count:1b,tag:{Potion:\"minecraft:healing\"}}"));
  917. inv.setItem(shopmenu, 20, read.item("{id:\"minecraft:potion\",Count:1b,tag:{Potion:\"minecraft:strong_healing\"}}"));
  918. inv.setItem(shopmenu, 21, read.item("{id:\"minecraft:potion\",Count:1b,tag:{Potion:\"minecraft:strong_leaping\"}}"));
  919. inv.setItem(shopmenu, 22, read.item("{id:\"minecraft:potion\",Count:1b,tag:{Potion:\"minecraft:swiftness\"}}"));
  920. inv.setItem(shopmenu, 23, read.item("{id:\"minecraft:potion\",Count:1b,tag:{Potion:\"minecraft:strength\"}}"));
  921. inv.setItem(shopmenu, 24, read.item("{id:\"minecraft:splash_potion\",Count:1b,tag:{Potion:\"minecraft:weakness\"}}"));
  922. inv.setItem(shopmenu, 28, read.item("km:coin_silver", 3));
  923. inv.setItem(shopmenu, 29, read.item("km:coin_silver", 5));
  924. inv.setItem(shopmenu, 30, read.item("km:coin_silver", 7));
  925. inv.setItem(shopmenu, 31, read.item("km:coin_silver", 16));
  926. inv.setItem(shopmenu, 32, read.item("km:coin_gold", 7));
  927. inv.setItem(shopmenu, 33, read.item("km:coin_gold", 10));
  928. }
  929. function setShopmenu9(shopmenu) {
  930. inv.setItem(shopmenu, 18, read.item("minecraft:ladder"));
  931. inv.setItem(shopmenu, 19, read.item("minecraft:cobweb"));
  932. inv.setItem(shopmenu, 20, read.item("minecraft:fishing_rod"));
  933. inv.setItem(shopmenu, 21, read.item("minecraft:flint_and_steel"));
  934. inv.setItem(shopmenu, 22, read.item("minecraft:ender_pearl"));
  935. inv.setItem(shopmenu, 23, read.item("{id:\"minecraft:string\",Count:1b,tag:{display:{Lore:['{\"text\":\"Warnt dich vor angreifenden Gegnern\"}'],Name:'{\"text\":\"§rTrap\"}'}}}"));
  936. inv.setItem(shopmenu, 24, read.item("{id:\"minecraft:red_bed\",Count:1b,tag:{display:{Lore:['{\"text\":\"Setzt dein Bett einmalig neu\"}'],Name:'{\"text\":\"§rNeues Bett\"}'}}}"));
  937. inv.setItem(shopmenu, 25, $blaze_rod);
  938. inv.setItem(shopmenu, 26, $warp_powder);
  939. inv.setItem(shopmenu, 27, read.item("km:coin_copper"));
  940. inv.setItem(shopmenu, 28, read.item("km:coin_copper", 16));
  941. inv.setItem(shopmenu, 29, read.item("km:coin_silver", 6));
  942. inv.setItem(shopmenu, 30, read.item("km:coin_silver", 7));
  943. inv.setItem(shopmenu, 31, read.item("km:coin_gold", 13));
  944. inv.setItem(shopmenu, 32, read.item("km:coin_silver", 7));
  945. inv.setItem(shopmenu, 33, read.item("km:coin_gold", 40));
  946. inv.setItem(shopmenu, 34, read.item("km:coin_gold", 3));
  947. inv.setItem(shopmenu, 35, read.item("km:coin_silver", 3));
  948. }
  949. function bedwars.getTeamColor(player) {
  950. team = map.get($players, player.getName(player));
  951. color = map.get($colorcodes, team);
  952. return color;
  953. }