From 1e374a60ab7d651cf07d357ce78e07fc5a95681d Mon Sep 17 00:00:00 2001 From: PavelDobCZ23 Date: Wed, 14 Jun 2023 23:24:50 +0200 Subject: [PATCH] del --- scripts/main.js | 27 --------------------------- scripts/modules/mob_list.js | 2 -- 2 files changed, 29 deletions(-) delete mode 100644 scripts/main.js delete mode 100644 scripts/modules/mob_list.js diff --git a/scripts/main.js b/scripts/main.js deleted file mode 100644 index ee5418e..0000000 --- a/scripts/main.js +++ /dev/null @@ -1,27 +0,0 @@ -import { world } from "@minecraft/server"; -import { mobList } from "./modules/mob_list.js"; - -world.events.blockBreak.subscribe(async (eventData) => { - const locX = eventData.block.location.x; - const locY = eventData.block.location.y; - const locZ = eventData.block.location.z; - await eventData.player.runCommandAsync(`summon ${randChoice(mobList)} ${locX} ${locY} ${locZ}`); -}); - -function randInt(min, max) { - max++; - return Math.floor(Math.random() * (max - min)) + min; -} - -function randChoice(array, num) { - if (num) { - const choice = []; - while (num > 0) { - num--; - choice.push(array[randInt(0, array.length - 1)]); - } - return choice; - } else { - return array[randInt(0, array.length - 1)]; - } -} \ No newline at end of file diff --git a/scripts/modules/mob_list.js b/scripts/modules/mob_list.js deleted file mode 100644 index 7899b6e..0000000 --- a/scripts/modules/mob_list.js +++ /dev/null @@ -1,2 +0,0 @@ -const mobList = ["allay","axolotl","bat","bee","blaze","cat","cave_spider","chicken","cow","creeper","dolphin","donkey","drowned","elder_guardian","enderman","endermite","evocation_illager","fox","frog","ghast","glow_squid","guardian","hoglin","horse","husk","iron_golem","llama","magma_cube","mooshroom","mule","ocelot","parrot","phantom","pig","pillager","polar_bear","rabbit","ravager","sheep","shulker","silverfish","skeleton","skeleton_horse","slime","snow_golem","spider","squid","stray","strider","tadpole","turtle","vex","villager","vindicator","wandering_trader","witch","wither_skeleton","wolf","zoglin","zombie","zombie_horse","zombie_pigman","zombie_villager"]; -export {mobList} \ No newline at end of file