BobMe

Minecraft Code Connection - Find Bloc

Jul 16th, 2021 (edited)
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.88 KB | None | 0 0
  1. //SETTINGS
  2. let mutiplayer = true // set to true if you're not the host of the server
  3. let connected_players = ["LordDragon277","DEATH 3309","SonPenicus"] // if mutiplayer is false, and are hosting a session, list the connected players here.
  4. let host = "DEATH 3309" // if mutiplayer is set to true, enter the host player's name here
  5. let delayoffset = 0.53 // set lower if seconds are too long, set higher if seconds are too fast
  6. let timefind = 60
  7.  
  8. let delay = 616 * delayoffset
  9. let items = [
  10. "honeycomb_block",
  11. "honey_block",
  12. "beehive",
  13. "bee_nest",
  14. "stickypistonarmcollision",
  15. "wither_rose",
  16. "light_block",
  17. "lit_blast_furnace",
  18. "composter",
  19. "wood",
  20. "jigsaw",
  21. "lava_cauldron",
  22. "campfire",
  23. "sweet_berry_bush",
  24. "bell",
  25. "loom",
  26. "barrel",
  27. "smithing_table",
  28. "fletching_table",
  29. "cartography_table",
  30. "lit_smoker",
  31. "smoker",
  32. "stonecutter_block",
  33. "blast_furnace",
  34. "lectern",
  35. "darkoak_wall_sign",
  36. "darkoak_standing_sign",
  37. "acacia_wall_sign",
  38. "acacia_standing_sign",
  39. "jungle_wall_sign",
  40. "jungle_standing_sign",
  41. "birch_wall_sign",
  42. "birch_standing_sign",
  43. "smooth_quartz_stairs",
  44. "red_nether_brick_stairs",
  45. "smooth_stone",
  46. "spruce_wall_sign",
  47. "spruce_standing_sign",
  48. "normal_stone_stairs",
  49. "mossy_cobblestone_stairs",
  50. "end_brick_stairs",
  51. "smooth_sandstone_stairs",
  52. "smooth_red_sandstone_stairs",
  53. "mossy_stone_brick_stairs",
  54. "polished_andesite_stairs",
  55. "polished_diorite_stairs",
  56. "polished_granite_stairs",
  57. "andesite_stairs",
  58. "diorite_stairs",
  59. "granite_stairs",
  60. "real_double_stone_slab4",
  61. "real_double_stone_slab3",
  62. "double_stone_slab4",
  63. "scaffolding",
  64. "bamboo_sapling",
  65. "bamboo",
  66. "double_stone_slab3",
  67. "barrier",
  68. "bubble_column",
  69. "turtle_egg",
  70. "conduit",
  71. "sea_pickle",
  72. "carved_pumpkin",
  73. "spruce_pressure_plate",
  74. "jungle_pressure_plate",
  75. "dark_oak_pressure_plate",
  76. "birch_pressure_plate",
  77. "acacia_pressure_plate",
  78. "spruce_trapdoor",
  79. "jungle_trapdoor",
  80. "dark_oak_trapdoor",
  81. "birch_trapdoor",
  82. "acacia_trapdoor",
  83. "spruce_button",
  84. "jungle_button",
  85. "dark_oak_button",
  86. "birch_button",
  87. "acacia_button",
  88. "dried_kelp_block",
  89. "kelp",
  90. "coral_fan_hang3",
  91. "coral_fan_hang2",
  92. "coral_fan_hang",
  93. "coral_fan_dead",
  94. "coral_fan",
  95. "coral_block",
  96. "coral",
  97. "seagrass",
  98. "blue_ice",
  99. "stripped_oak_log",
  100. "stripped_dark_oak_log",
  101. "stripped_acacia_log",
  102. "stripped_jungle_log",
  103. "stripped_birch_log",
  104. "stripped_spruce_log",
  105. "prismarine_bricks_stairs",
  106. "dark_prismarine_stairs",
  107. "prismarine_stairs",
  108. "stone",
  109. "grass",
  110. "dirt",
  111. "cobblestone",
  112. "planks",
  113. "sapling",
  114. "bedrock",
  115. "sand",
  116. "gravel",
  117. "gold_ore",
  118. "iron_ore",
  119. "coal_ore",
  120. "log",
  121. "leaves",
  122. "sponge",
  123. "glass",
  124. "lapis_ore",
  125. "lapis_block",
  126. "dispenser",
  127. "sandstone",
  128. "noteblock",
  129. "bed",
  130. "golden_rail",
  131. "detector_rail",
  132. "sticky_piston",
  133. "web",
  134. "tallgrass",
  135. "deadbush",
  136. "piston",
  137. "pistonarmcollision",
  138. "wool",
  139. "element_0",
  140. "yellow_flower",
  141. "red_flower",
  142. "brown_mushroom",
  143. "red_mushroom",
  144. "gold_block",
  145. "iron_block",
  146. "real_double_stone_slab",
  147. "double_stone_slab",
  148. "brick_block",
  149. "tnt",
  150. "bookshelf",
  151. "mossy_cobblestone",
  152. "obsidian",
  153. "torch",
  154. "fire",
  155. "mob_spawner",
  156. "oak_stairs",
  157. "chest",
  158. "redstone_wire",
  159. "diamond_ore",
  160. "diamond_block",
  161. "crafting_table",
  162. "wheat",
  163. "farmland",
  164. "furnace",
  165. "lit_furnace",
  166. "standing_sign",
  167. "wooden_door",
  168. "ladder",
  169. "rail",
  170. "stone_stairs",
  171. "wall_sign",
  172. "lever",
  173. "stone_pressure_plate",
  174. "iron_door",
  175. "wooden_pressure_plate",
  176. "redstone_ore",
  177. "lit_redstone_ore",
  178. "unlit_redstone_torch",
  179. "redstone_torch",
  180. "stone_button",
  181. "snow_layer",
  182. "ice",
  183. "snow",
  184. "cactus",
  185. "clay",
  186. "reeds",
  187. "jukebox",
  188. "fence",
  189. "pumpkin",
  190. "netherrack",
  191. "soul_sand",
  192. "glowstone",
  193. "lit_pumpkin",
  194. "cake",
  195. "unpowered_repeater",
  196. "powered_repeater",
  197. "invisiblebedrock",
  198. "trapdoor",
  199. "monster_egg",
  200. "stonebrick",
  201. "brown_mushroom_block",
  202. "red_mushroom_block",
  203. "iron_bars",
  204. "glass_pane",
  205. "melon_block",
  206. "pumpkin_stem",
  207. "melon_stem",
  208. "vine",
  209. "fence_gate",
  210. "brick_stairs",
  211. "stone_brick_stairs",
  212. "mycelium",
  213. "waterlily",
  214. "nether_brick",
  215. "nether_brick_fence",
  216. "nether_brick_stairs",
  217. "nether_wart",
  218. "enchanting_table",
  219. "brewingstandblock",
  220. "cauldron",
  221. "end_portal",
  222. "end_portal_frame",
  223. "end_stone",
  224. "dragon_egg",
  225. "redstone_lamp",
  226. "lit_redstone_lamp",
  227. "dropper",
  228. "activator_rail",
  229. "cocoa",
  230. "sandstone_stairs",
  231. "emerald_ore",
  232. "ender_chest",
  233. "tripwire_hook",
  234. "tripwire",
  235. "emerald_block",
  236. "spruce_stairs",
  237. "birch_stairs",
  238. "jungle_stairs",
  239. "command_block",
  240. "beacon",
  241. "cobblestone_wall",
  242. "flower_pot",
  243. "carrots",
  244. "potatoes",
  245. "wooden_button",
  246. "skull",
  247. "anvil",
  248. "trapped_chest",
  249. "light_weighted_pressure_plate",
  250. "heavy_weighted_pressure_plate",
  251. "unpowered_comparator",
  252. "powered_comparator",
  253. "daylight_detector",
  254. "redstone_block",
  255. "quartz_ore",
  256. "hopper",
  257. "quartz_block",
  258. "quartz_stairs",
  259. "double_wooden_slab",
  260. "wooden_slab",
  261. "stained_hardened_clay",
  262. "stained_glass_pane",
  263. "leaves2",
  264. "log2",
  265. "acacia_stairs",
  266. "dark_oak_stairs",
  267. "slime",
  268. "glow_stick",
  269. "iron_trapdoor",
  270. "prismarine",
  271. "sealantern",
  272. "hay_block",
  273. "carpet",
  274. "hardened_clay",
  275. "coal_block",
  276. "packed_ice",
  277. "double_plant",
  278. "standing_banner",
  279. "wall_banner",
  280. "daylight_detector_inverted",
  281. "red_sandstone",
  282. "red_sandstone_stairs",
  283. "real_double_stone_slab2",
  284. "double_stone_slab2",
  285. "spruce_fence_gate",
  286. "birch_fence_gate",
  287. "jungle_fence_gate",
  288. "dark_oak_fence_gate",
  289. "acacia_fence_gate",
  290. "repeating_command_block",
  291. "chain_command_block",
  292. "hard_glass_pane",
  293. "hard_stained_glass_pane",
  294. "chemical_heat",
  295. "spruce_door",
  296. "birch_door",
  297. "jungle_door",
  298. "acacia_door",
  299. "dark_oak_door",
  300. "grass_path",
  301. "frame",
  302. "chorus_flower",
  303. "purpur_block",
  304. "colored_torch_rg",
  305. "purpur_stairs",
  306. "colored_torch_bp",
  307. "undyed_shulker_box",
  308. "end_bricks",
  309. "frosted_ice",
  310. "end_rod",
  311. "end_gateway",
  312. "magma",
  313. "nether_wart_block",
  314. "red_nether_brick",
  315. "bone_block",
  316. "structure_void",
  317. "shulker_box",
  318. "purple_glazed_terracotta",
  319. "white_glazed_terracotta",
  320. "orange_glazed_terracotta",
  321. "magenta_glazed_terracotta",
  322. "light_blue_glazed_terracotta",
  323. "yellow_glazed_terracotta",
  324. "lime_glazed_terracotta",
  325. "pink_glazed_terracotta",
  326. "gray_glazed_terracotta",
  327. "silver_glazed_terracotta",
  328. "cyan_glazed_terracotta",
  329. "blue_glazed_terracotta",
  330. "brown_glazed_terracotta",
  331. "green_glazed_terracotta",
  332. "red_glazed_terracotta",
  333. "black_glazed_terracotta",
  334. "concrete",
  335. "concrete_powder",
  336. "chemistry_table",
  337. "underwater_torch",
  338. "chorus_plant",
  339. "stained_glass",
  340. "podzol",
  341. "beetroot",
  342. "stonecutter",
  343. "observer",
  344. "structure_block",
  345. "hard_glass",
  346. "hard_stained_glass",
  347. "iron_shovel",
  348. "iron_pickaxe",
  349. "iron_axe",
  350. "flint_and_steel",
  351. "apple",
  352. "bow",
  353. "arrow",
  354. "coal",
  355. "diamond",
  356. "iron_ingot",
  357. "gold_ingot",
  358. "iron_sword",
  359. "wooden_sword",
  360. "wooden_shovel",
  361. "wooden_pickaxe",
  362. "wooden_axe",
  363. "stone_sword",
  364. "stone_shovel",
  365. "stone_pickaxe",
  366. "stone_axe",
  367. "diamond_sword",
  368. "diamond_shovel",
  369. "diamond_pickaxe",
  370. "diamond_axe",
  371. "stick",
  372. "bowl",
  373. "mushroom_stew",
  374. "golden_sword",
  375. "golden_shovel",
  376. "golden_pickaxe",
  377. "golden_axe",
  378. "string",
  379. "feather",
  380. "gunpowder",
  381. "wooden_hoe",
  382. "stone_hoe",
  383. "iron_hoe",
  384. "diamond_hoe",
  385. "golden_hoe",
  386. "wheat_seeds",
  387. "wheat",
  388. "bread",
  389. "leather_helmet",
  390. "leather_chestplate",
  391. "leather_leggings",
  392. "leather_boots",
  393. "chainmail_helmet",
  394. "chainmail_chestplate",
  395. "chainmail_leggings",
  396. "chainmail_boots",
  397. "iron_helmet",
  398. "iron_chestplate",
  399. "iron_leggings",
  400. "iron_boots",
  401. "diamond_helmet",
  402. "diamond_chestplate",
  403. "diamond_leggings",
  404. "diamond_boots",
  405. "golden_helmet",
  406. "golden_chestplate",
  407. "golden_leggings",
  408. "golden_boots",
  409. "flint",
  410. "porkchop",
  411. "cooked_porkchop",
  412. "painting",
  413. "golden_apple",
  414. "sign",
  415. "wooden_door",
  416. "bucket",
  417. "minecart",
  418. "saddle",
  419. "iron_door",
  420. "redstone",
  421. "snowball",
  422. "boat",
  423. "leather",
  424. "kelp",
  425. "brick",
  426. "clay_ball",
  427. "paper",
  428. "book",
  429. "slime_ball",
  430. "chest_minecart",
  431. "egg",
  432. "compass",
  433. "fishing_rod",
  434. "clock",
  435. "glowstone_dust",
  436. "fish",
  437. "cooked_fish",
  438. "dye",
  439. "bone",
  440. "sugar",
  441. "cake",
  442. "bed",
  443. "repeater",
  444. "cookie",
  445. "map",
  446. "shears",
  447. "melon",
  448. "pumpkin_seeds",
  449. "melon_seeds",
  450. "beef",
  451. "cooked_beef",
  452. "chicken",
  453. "cooked_chicken",
  454. "rotten_flesh",
  455. "ender_pearl",
  456. "blaze_rod",
  457. "ghast_tear",
  458. "gold_nugget",
  459. "nether_wart",
  460. "potion",
  461. "glass_bottle",
  462. "spider_eye",
  463. "fermented_spider_eye",
  464. "blaze_powder",
  465. "magma_cream",
  466. "brewing_stand",
  467. "cauldron",
  468. "ender_eye",
  469. "spawn_egg",
  470. "experience_bottle",
  471. "fireball",
  472. "writable_book",
  473. "written_book",
  474. "emerald",
  475. "frame",
  476. "flower_pot",
  477. "carrot",
  478. "potato",
  479. "baked_potato",
  480. "poisonous_potato",
  481. "emptymap",
  482. "golden_carrot",
  483. "skull",
  484. "carrotonastick",
  485. "netherstar",
  486. "pumpkin_pie",
  487. "fireworks",
  488. "fireworkscharge",
  489. "enchanted_book",
  490. "comparator",
  491. "netherbrick",
  492. "quartz",
  493. "tnt_minecart",
  494. "hopper_minecart",
  495. "prismarine_shard",
  496. "hopper",
  497. "rabbit",
  498. "cooked_rabbit",
  499. "rabbit_stew",
  500. "rabbit_foot",
  501. "rabbit_hide",
  502. "horsearmorleather",
  503. "horsearmoriron",
  504. "horsearmorgold",
  505. "horsearmordiamond",
  506. "lead",
  507. "name_tag",
  508. "prismarine_crystals",
  509. "muttonraw",
  510. "muttoncooked",
  511. "armor_stand",
  512. "end_crystal",
  513. "spruce_door",
  514. "birch_door",
  515. "jungle_door",
  516. "acacia_door",
  517. "dark_oak_door",
  518. "chorus_fruit",
  519. "chorus_fruit_popped",
  520. "banner_pattern",
  521. "dragon_breath",
  522. "splash_potion",
  523. "lingering_potion",
  524. "command_block_minecart",
  525. "elytra",
  526. "shulker_shell",
  527. "banner",
  528. "totem",
  529. "iron_nugget",
  530. "trident",
  531. "beetroot",
  532. "beetroot_seeds",
  533. "beetroot_soup",
  534. "salmon",
  535. "clownfish",
  536. "pufferfish",
  537. "cooked_salmon",
  538. "dried_kelp",
  539. "nautilus_shell",
  540. "appleenchanted",
  541. "heart_of_the_sea",
  542. "turtle_shell_piece",
  543. "turtle_helmet",
  544. "phantom_membrane",
  545. "crossbow",
  546. "spruce_sign",
  547. "birch_sign",
  548. "jungle_sign",
  549. "acacia_sign",
  550. "darkoak_sign",
  551. "sweet_berries",
  552. "compound",
  553. "record_13",
  554. "record_cat",
  555. "record_blocks",
  556. "record_chirp",
  557. "record_far",
  558. "record_mall",
  559. "record_mellohi",
  560. "record_stal",
  561. "record_strad",
  562. "record_ward",
  563. "record_11",
  564. "record_wait",
  565. "shield",
  566. "campfire",
  567. "suspicious_stew",
  568. "honeycomb",
  569. "honey_bottle",
  570. ]
  571.  
  572. let potions = [
  573. "absorption",
  574. "bad_omen",
  575. "blindness",
  576. "conduit_power",
  577. "fatal_poison",
  578. "fire_resistance",
  579. "haste",
  580. "health_boost",
  581. "hunger",
  582. "instant_damage",
  583. "instant_health",
  584. "invisibility",
  585. "jump_boost",
  586. "levitation",
  587. "mining_fatigue",
  588. "nausea",
  589. "night_vision",
  590. "poison",
  591. "regeneration",
  592. "resistance",
  593. "saturation",
  594. "slow_falling",
  595. "slowness",
  596. "speed",
  597. "strength",
  598. "village_hero",
  599. "water_breathing",
  600. "weakness",
  601. "wither"
  602. ]
  603.  
  604. let blockss = [
  605. "STONE",
  606. "GRASS",
  607. "DIRT",
  608. "COBBLESTONE",
  609. "BEDROCK",
  610. "WATER",
  611. "LAVA",
  612. "SAND",
  613. "RED_SANDSTONE",
  614. "GRAVEL",
  615. "GOLD_ORE",
  616. "IRON_ORE",
  617. "COAL_ORE",
  618. "LOG",
  619. "WOODEN_DOOR",
  620. "LEAVES",
  621. "LAPIS_ORE",
  622. "LAPIS_BLOCK",
  623. "DISPENSER",
  624. "SANDSTONE",
  625. "STICKY_PISTON",
  626. "WEB",
  627. "TALLGRASS",
  628. "DEAD_BUSH",
  629. "YELLOW_FLOWER",
  630. "BROWN_MUSHROOM",
  631. "RED_MUSHROOM",
  632. "BOOKSHELF",
  633. "MOSSY_COBBLESTONE",
  634. "OBSIDIAN",
  635. "TORCH",
  636. "FIRE",
  637. "MOB_SPAWNER",
  638. "CHEST",
  639. "REDSTONE_WIRE",
  640. "DIAMOND_ORE",
  641. "CRAFTING_TABLE",
  642. "FARMLAND",
  643. "FURNACE",
  644. "ACACIA_DOOR",
  645. "BIRCH_DOOR",
  646. "DARK_OAK_DOOR",
  647. "IRON_DOOR",
  648. "JUNGLE_DOOR",
  649. "SPRUCE_DOOR",
  650. "LADDER",
  651. "RAIL",
  652. "LEVER",
  653. "REDSTONE_ORE",
  654. "ICE",
  655. "CACTUS",
  656. "CLAY",
  657. "FENCE",
  658. "NETHER_BRICK_FENCE",
  659. "JUNGLE_FENCE_GATE",
  660. "DARK_OAK_FENCE_GATE",
  661. "BIRCH_FENCE_GATE",
  662. "ACACIA_FENCE_GATE",
  663. "FENCE_GATE",
  664. "SPRUCE_FENCE_GATE",
  665. "PUMPKIN",
  666. "UNPOWERED_REPEATER",
  667. "IRON_BARS",
  668. "GOLD_BLOCK",
  669. "IRON_BLOCK",
  670. "WATER",
  671. "CAULDRON",
  672. "ENCHANTING_TABLE",
  673. "ANVIL",
  674. "WATERLILY",
  675. "TRAPPED_CHEST",
  676. "stripped_acacia_log",
  677. "stripped_birch_log",
  678. "stripped_dark_oak_log",
  679. "stripped_jungle_log",
  680. "stripped_oak_log",
  681. "stripped_spruce_log",
  682. "STONEBRICK",
  683. "stone_pressure_plate",
  684. "STONE_BUTTON",
  685. "STANDING_SIGN",
  686. "SNOW",
  687. "SNOW_LAYER",
  688. "SMOKER",
  689. "BLAST_FURNACE",
  690. "SMITHING_TABLE",
  691. "SLIME",
  692. "SEAGRASS",
  693. "SEA_PICKLE",
  694. "BAMBOO",
  695. "SCAFFOLDING",
  696. "SAPLING",
  697. "RED_FLOWER",
  698. "QUARTZ_ORE",
  699. "POTATOES",
  700. "PORTAL",
  701. "PLANKS",
  702. "OBSERVER",
  703. "NOTEBLOCK",
  704. "KELP",
  705. "JUNGLE_BUTTON",
  706. "HOPPER",
  707. "HAY_block",
  708. "WHEAT",
  709. "BEETROOT",
  710. "CARROTS",
  711. "STONE_BUTTON",
  712. "GLOWSTONE",
  713. "REDSTONE_LAMP",
  714. "sealantern",
  715. ]
  716.  
  717. function doDing() {
  718. loops.runInBackground(function() {
  719. player.execute("playsound note.pling @s ~ ~ ~ 1 2")
  720. player.execute("playsound note.pling @s ~ ~ ~ 1 2.5")
  721. })
  722. }
  723.  
  724. function toTime(sec:number) {
  725. let s:number = sec%60
  726. let m:number = Math.floor(sec/60)%60
  727. let h:number = Math.floor((sec/60)/60)
  728. let seconds:string = s.toString()
  729. let minutes:string = m.toString()
  730. let hours:string = h.toString()
  731. if (s < 10) {
  732. seconds = "0"+seconds
  733. }
  734. if (m < 10) {
  735. minutes = "0"+minutes
  736. }
  737. if (h < 10) {
  738. hours = "0"+hours
  739. }
  740. let str:string = seconds
  741. //if (minutes > 0) {
  742. str = minutes+":"+str
  743. //}
  744. if (h > 0) {
  745. str = hours+":"+str
  746. }
  747. return str
  748. }
  749. // 868
  750. //player.say(Object.keys({chonnk})[0])
  751. let i = timefind
  752. let gotit = false
  753. let hostready = false
  754. player.onTellCommand("hostready", function() {
  755. hostready = true
  756. })
  757. loops.forever(function() {
  758. i = timefind
  759. hostready = false
  760. if (mutiplayer) {
  761. while (hostready == false) {
  762. loops.pause(10)
  763. player.execute("title @s actionbar §1Waiting for host...")
  764. }
  765. } else {
  766. for (let i = 0; i < connected_players.length; i++) {
  767. player.execute('tell "'+connected_players[i]+'" hostready')
  768. }
  769. loops.pause(10)
  770. }
  771. let halfi = Math.floor(i/2)
  772. let quarteri = Math.floor(i/8)
  773. let blockname = (blockss[randint(0, blockss.length)]).toLowerCase()
  774. let block = blocks.blockByName(blockname)
  775. gotit = false
  776. player.execute('tellraw @a {"rawtext":[{"text":"§e§l'+player.name()+'§r§g must find §l'+blockname+'"}]}')
  777. player.execute("playsound note.bell @s ~ ~ ~ 1 1.5")
  778. while (i != 0) {
  779. let str = toTime(i)
  780. if (i <= quarteri && gotit == false) {
  781. player.execute("title @s actionbar §c"+blockname+" | "+str)
  782. } else if (i <= halfi && gotit == false) {
  783. player.execute("title @s actionbar §6"+blockname+" | "+str)
  784. } else {
  785. player.execute("title @s actionbar §a"+blockname+" | "+str)
  786. }
  787. let win = (blocks.testForBlock(block, pos(0, -1, 0)) || blocks.testForBlock(block, pos(0, 0, 0)))
  788. if (win && gotit == false) {
  789. gotit = true
  790. player.execute('tellraw @a {"rawtext":[{"text":"§a'+player.name()+' found §l'+blockname+'"}]}')
  791. blockname = "§o§d"+blockname
  792. player.execute("title @s actionbar §a"+blockname+" | "+str)
  793. doDing()
  794. }
  795. loops.pause(delay)
  796. i = i - 1
  797. }
  798. if (gotit) {
  799. player.execute('tellraw @s {"rawtext":[{"text":"§9§lTime for your reward..."}]}')
  800. loops.pause(3000)
  801. let d = 0
  802. let chosen = items[0]
  803. let confirm = false
  804. loops.runInBackground(function() {
  805. while (d < 1000) {
  806. d = d + 10
  807. loops.pause(90)
  808. }
  809. })
  810. loops.runInBackground(function() {
  811. while (d < 1000) {
  812. player.execute("playsound note.pling @s ~ ~ ~ 1 5")
  813. chosen = items[randint(0,items.length)]
  814. player.execute("title @s actionbar §a"+chosen)
  815. loops.pause(d)
  816. }
  817. player.execute("playsound note.pling @s ~ ~ ~ 1 5")
  818. chosen = items[randint(0,items.length)]
  819. player.execute("title @s actionbar §a"+chosen)
  820. loops.pause(d)
  821. confirm = true
  822. })
  823. while (confirm == false) {
  824. loops.pause(100)
  825. }
  826. for (let i = 0; i < 5; i++) {
  827. player.execute("title @s actionbar §a"+chosen+"!")
  828. player.execute("title @s actionbar §2"+chosen+"!")
  829. }
  830. loops.pause(500)
  831. player.execute("title @s actionbar §6How many?")
  832. loops.pause(500)
  833. let rand = randint(1, 128)
  834. for (let i = 0; i < 5; i++) {
  835. rand = randint(1, 128)
  836. player.execute("title @s actionbar §6"+rand.toString())
  837. player.execute("playsound note.pling @s ~ ~ ~ 1 4")
  838. }
  839. for (let i = 0; i < 5; i++) {
  840. player.execute("title @s actionbar §e"+rand.toString()+"!")
  841. player.execute("title @s actionbar §6"+rand.toString()+"!")
  842. }
  843. loops.pause(1000)
  844. player.execute("give @s "+chosen+" "+rand.toString())
  845. player.execute("title @s actionbar §aYou were given: §l"+chosen+" x"+rand.toString())
  846. player.execute('tellraw @a {"rawtext":[{"text":"§e'+player.name()+' was awarded: §l'+chosen+' x'+rand.toString()+'"}]}')
  847. loops.pause(3000)
  848. } else {
  849. let ran = randint(0, 4)
  850. player.execute('tellraw @a {"rawtext":[{"text":"§4§l'+player.name()+' failed!"}]}')
  851. player.execute("effect @s blindness 25 255 true")
  852. player.execute("playsound ambient.weather.lightning.impact @s ~ ~ ~ 5 0.4")
  853. player.execute("/playsound block.bell.hit @s ~ ~ ~ 5 0.2")
  854. if (ran == 0) {
  855. for(let i = 0; i < 13; i++) {
  856. let num1 = Math.randomRange(-6, 6)
  857. let num2 = Math.randomRange(-6, 6)
  858. player.execute("summon silverfish ~"+num1+" ~ ~"+num2+" minecraft:entity_spawned Smol_Boi")
  859. player.execute("effect @e[name=Smol_Boi] speed 9999 5 true")
  860. }
  861. } else if (ran == 1) {
  862. for(let i = 0; i < 6; i++) {
  863. player.execute("/summon zombie ~ ~3 ~ minecraft:as_baby BabyZombie")
  864. player.execute("effect @e[name=BabyZombie] speed 9999 3 true")
  865. player.execute("effect @e[name=BabyZombie] fire_resistance 9999 1 true")
  866. }
  867. } else if (ran == 2) {
  868. loops.runInBackground(function () {
  869. player.execute("effect @s slowness 3 255 true")
  870. let ps = player.position()
  871. blocks.fill(OBSIDIAN, ps.add(pos(-10,50,-10)), ps.add(pos(10,50,10)))
  872. blocks.fill(OBSIDIAN, ps.add(pos(2,0,1)), ps.add(pos(2,0,-1)))
  873. blocks.fill(OBSIDIAN, ps.add(pos(-2,0,1)), ps.add(pos(-2,0,-1)))
  874. blocks.fill(OBSIDIAN, ps.add(pos(1,0,2)), ps.add(pos(-1,0,2)))
  875. blocks.fill(OBSIDIAN, ps.add(pos(1,0,-2)), ps.add(pos(-1,0,-2)))
  876. blocks.fill(OBSIDIAN, ps.add(pos(-1,2,-1)), ps.add(pos(1,2,1)))
  877. blocks.fill(GLASS, ps.add(pos(2,1,1)), ps.add(pos(2,1,-1)))
  878. blocks.fill(GLASS, ps.add(pos(-2,1,1)), ps.add(pos(-2,1,-1)))
  879. blocks.fill(GLASS, ps.add(pos(1,1,2)), ps.add(pos(-1,1,2)))
  880. blocks.fill(GLASS, ps.add(pos(1,1,-2)), ps.add(pos(-1,1,-2)))
  881. for(let i = 0; i < 10; i++) {
  882. player.execute("summon cave_spider ~ ~ ~ minecraft:entity_spawned Cave")
  883. player.execute("effect @e[name=Cave] strength 9999 1 true")
  884. }
  885. loops.pause(10000*delayoffset)
  886. blocks.fill(AIR, ps.add(pos(-10,50,-10)), ps.add(pos(10,50,10)))
  887. blocks.fill(AIR, ps.add(pos(2,0,1)), ps.add(pos(2,0,-1)))
  888. blocks.fill(AIR, ps.add(pos(-2,0,1)), ps.add(pos(-2,0,-1)))
  889. blocks.fill(AIR, ps.add(pos(1,0,2)), ps.add(pos(-1,0,2)))
  890. blocks.fill(AIR, ps.add(pos(1,0,-2)), ps.add(pos(-1,0,-2)))
  891. blocks.fill(AIR, ps.add(pos(-1,2,-1)), ps.add(pos(1,2,1)))
  892. blocks.fill(AIR, ps.add(pos(2,1,1)), ps.add(pos(2,1,-1)))
  893. blocks.fill(AIR, ps.add(pos(-2,1,1)), ps.add(pos(-2,1,-1)))
  894. blocks.fill(AIR, ps.add(pos(1,1,2)), ps.add(pos(-1,1,2)))
  895. blocks.fill(AIR, ps.add(pos(1,1,-2)), ps.add(pos(-1,1,-2)))
  896. })
  897. } else if (ran == 3) {
  898. for(let i = 0; i < 10; i++) {
  899. let ranpos = positions.groundPosition(randpos(pos(-5,90,-5), pos(5,90,5)))
  900. mobs.spawn(LIGHTNING_BOLT, ranpos)
  901. }
  902. } else if (ran == 4) {
  903. player.execute("tp @s ~ 5 ~")
  904. player.execute("effect @s fire_resistance 5")
  905. }
  906. if (mutiplayer == false) {
  907. loops.pause(10000*delayoffset)
  908. }
  909. }
  910. })
  911.  
  912. //player.onChat("next", function() {
  913. // if (gotit) {
  914. // i = 1
  915. //}
  916. //})
Add Comment
Please, Sign In to add comment