var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  return value;
};

// data/gametests/src/items/InfoBook.js
import { world as world2, system as system2 } from "@minecraft/server";

// data/gametests/src/debug.js
import { system, world } from "@minecraft/server";
var debugBuffer = 2e3;
var delimiter = "\u2013";
function info(line) {
  log_message(`\xA7bINFO\xA7r: ${line}`);
  if (!(world.getDynamicProperty("mco_nom:enable_debug_logging") ?? false))
    return;
  sendMessage(`[DEBUG] \xA7bINFO\xA7r: ${line}`);
  console.warn(`[DEBUG] INFO: ${line}`);
}
function warn(line) {
  log_message(`\xA7eWARN\xA7r: ${line}`);
  if (!(world.getDynamicProperty("mco_nom:enable_debug_logging") ?? false))
    return;
  sendMessage(`[DEBUG] \xA7eWARN\xA7r: ${line}`);
  console.warn(`[DEBUG] WARN: ${line}`);
}
function error(line) {
  log_message(`\xA7cERROR\xA7r: ${line}`);
  if (!(world.getDynamicProperty("mco_nom:enable_debug_logging") ?? false))
    return;
  sendMessage(`[DEBUG] \xA7cERROR\xA7r: ${line}`);
  console.warn(`[DEBUG] ERROR: ${line}`);
}
function sendMessage(line) {
  const debugPlayers = world.getPlayers({ tags: ["mco_nom_debug_chat"] });
  for (const debugPlayer of debugPlayers) {
    debugPlayer.sendMessage(line);
  }
}
function log_message(line) {
  const current = world.getDynamicProperty("mco_nom:debug_log") ?? "";
  world.setDynamicProperty("mco_nom:debug_log", (current + line + delimiter).substr(Math.max(0, current.length + line.length - debugBuffer), current.length + line.length + 1));
}
system.afterEvents.scriptEventReceive.subscribe((e) => {
  if (e.id == "mco_nom:toggle_debug") {
    world.setDynamicProperty("mco_nom:enable_debug_logging", !(world.getDynamicProperty("mco_nom:enable_debug_logging") ?? false));
    world.sendMessage(`Debug logging: ${world.getDynamicProperty("mco_nom:enable_debug_logging") ?? false}`);
  } else if (e.id == "mco_nom:debug_log") {
    const lines = (world.getDynamicProperty("mco_nom:debug_log") ?? "").split(delimiter);
    for (const line of lines)
      world.sendMessage(`${line}`);
  }
});

// data/gametests/src/items/InfoBook.js
system2.afterEvents.scriptEventReceive.subscribe((e) => {
  const target = e.sourceEntity;
  if (e.id == "mco_nom:reset_info_book") {
    if (target == null) {
      error(`A source entity is required to use mco_nom:reset_info_book.`);
      return;
    }
    target.setDynamicProperty("mco_nom:received_book", false);
    target.sendMessage("Reset info book state!");
  }
});
world2.afterEvents.playerSpawn.subscribe((e) => {
  try {
    const player = e.player;
    if (!(player.getDynamicProperty("mco_nom:received_book") ?? false)) {
      player.runCommand("structure load mco_nom:info_book ~ ~ ~");
      player.setDynamicProperty("mco_nom:received_book", true);
    }
  } catch (err) {
    warn(err);
  }
});

// data/gametests/src/items/food/EatStackItemsManager.ts
import { world as world8, system as system9, Player as Player4 } from "@minecraft/server";

// data/gametests/src/systems/ActionBarManager.ts
import { system as system8, TicksPerSecond, world as world7 } from "@minecraft/server";

// data/gametests/node_modules/@bedrock-oss/bedrock-boost/dist/index.mjs
import { Direction } from "@minecraft/server";
import { system as system3, world as world3 } from "@minecraft/server";
import { system as system22 } from "@minecraft/server";
import { BlockPermutation, world as world22 } from "@minecraft/server";
import { world as world32 } from "@minecraft/server";
import { Player } from "@minecraft/server";
import { system as system32 } from "@minecraft/server";
import { system as system4 } from "@minecraft/server";
import {
  system as system5,
  world as world4
} from "@minecraft/server";
import { Player as Player2, system as system6, world as world5 } from "@minecraft/server";
import {
  InputPermissionCategory
} from "@minecraft/server";
import { system as system7 } from "@minecraft/server";
import { Direction as Direction2 } from "@minecraft/server";
import { StructureSaveMode, world as world6 } from "@minecraft/server";
import { EntityEquippableComponent, EquipmentSlot, ItemDurabilityComponent, ItemEnchantableComponent } from "@minecraft/server";
var _a;
var ChatColor = (_a = class {
  /**
   * Class ChatColor Constructor.
   * @param code - The color code as a string.
   * @param color - The color code as a hexadecimal number. Can be undefined.
   */
  constructor(code, color) {
    __publicField(this, "r");
    __publicField(this, "g");
    __publicField(this, "b");
    this.code = code;
    this.color = color;
    if (color) {
      this.r = color >> 16 & 255;
      this.g = color >> 8 & 255;
      this.b = color & 255;
    }
  }
  /**
   * Returns the string representation of the ChatColor instance,
   * which includes the PREFIX followed by the color code.
   * @returns A string representing the ChatColor instance
   */
  toString() {
    return _a.PREFIX + this.code;
  }
  /**
   * Returns the color code of the ChatColor instance.
   * @returns The color code of this ChatColor instance.
   */
  toRGB() {
    return this.color;
  }
  /**
   * Returns the hexadecimal string representation of the color code
   * @returns {string | undefined} The hexadecimal representation of the color.
   */
  toHex() {
    return this.color?.toString(16);
  }
  /**
   * Retrieve the value of the red component.
   *
   * @returns {number | undefined} The value of the red component, or undefined if it is not set.
   */
  getRed() {
    return this.r;
  }
  /**
   * Retrieves the green value of the current color.
   *
   * @returns {number | undefined} The green value of the color, or undefined if it is not set.
   */
  getGreen() {
    return this.g;
  }
  /**
   * Retrieves the blue value of a color.
   *
   * @returns The blue value of the color.
   * @type {number | undefined}
   */
  getBlue() {
    return this.b;
  }
  /**
   * Retrieves the format code associated with the chat color.
   *
   * @returns {string} The format code of the chat color.
   */
  getCode() {
    return this.code;
  }
  /**
   * Removes color codes from the specified string
   * @param str - The string from which color codes will be removed.
   * @returns The string cleared from color codes.
   */
  static stripColor(str) {
    return str.replace(/§[0-9a-u]/g, "");
  }
  /**
   * Finds the closest ChatColor code for the given RGB values
   * @param r - Red part of the color.
   * @param g - Green part of the color.
   * @param b - Blue part of the color.
   * @returns The closest ChatColor for the given RGB values.
   */
  static findClosestColor(r, g, b) {
    let minDistance = Number.MAX_VALUE;
    let closestColor = _a.WHITE;
    for (const color of _a.ALL_COLORS) {
      if (color.r && color.g && color.b) {
        const distance = Math.sqrt(Math.pow(color.r - r, 2) + Math.pow(color.g - g, 2) + Math.pow(color.b - b, 2));
        if (distance < minDistance) {
          minDistance = distance;
          closestColor = color;
        }
      }
    }
    return closestColor;
  }
}, /**
 * Black color code. (0)
 */
__publicField(_a, "BLACK", new _a("0", 0)), /**
 * Dark blue color code. (1)
 */
__publicField(_a, "DARK_BLUE", new _a("1", 170)), /**
 * Dark green color code. (2)
 */
__publicField(_a, "DARK_GREEN", new _a("2", 43520)), /**
 * Dark aqua color code. (3)
 */
__publicField(_a, "DARK_AQUA", new _a("3", 43690)), /**
 * Dark red color code. (4)
 */
__publicField(_a, "DARK_RED", new _a("4", 11141120)), /**
 * Dark purple color code. (5)
 */
__publicField(_a, "DARK_PURPLE", new _a("5", 11141290)), /**
 * Gold color code. (6)
 */
__publicField(_a, "GOLD", new _a("6", 16755200)), /**
 * Gray color code. (7)
 */
__publicField(_a, "GRAY", new _a("7", 11184810)), /**
 * Dark gray color code. (8)
 */
__publicField(_a, "DARK_GRAY", new _a("8", 5592405)), /**
 * Blue color code. (9)
 */
__publicField(_a, "BLUE", new _a("9", 5592575)), /**
 * Green color code. (a)
 */
__publicField(_a, "GREEN", new _a("a", 5635925)), /**
 * Aqua color code. (b)
 */
__publicField(_a, "AQUA", new _a("b", 5636095)), /**
 * Red color code. (c)
 */
__publicField(_a, "RED", new _a("c", 16733525)), /**
 * Light purple color code. (d)
 */
__publicField(_a, "LIGHT_PURPLE", new _a("d", 16733695)), /**
 * Yellow color code. (e)
 */
__publicField(_a, "YELLOW", new _a("e", 16777045)), /**
 * White color code. (f)
 */
__publicField(_a, "WHITE", new _a("f", 16777215)), /**
 * MineCoin gold color code. (g)
 */
__publicField(_a, "MINECOIN_GOLD", new _a("g", 14603781)), /**
 * Material quartz color code. (h)
 */
__publicField(_a, "MATERIAL_QUARTZ", new _a("h", 14931153)), /**
 * Material iron color code. (i)
 */
__publicField(_a, "MATERIAL_IRON", new _a("i", 13552330)), /**
 * Material netherite color code. (j)
 */
__publicField(_a, "MATERIAL_NETHERITE", new _a("j", 4471355)), /**
 * Material redstone color code. (m)
 */
__publicField(_a, "MATERIAL_REDSTONE", new _a("m", 9901575)), /**
 * Material copper color code. (n)
 */
__publicField(_a, "MATERIAL_COPPER", new _a("n", 11823181)), /**
 * Material gold color code. (p)
 */
__publicField(_a, "MATERIAL_GOLD", new _a("p", 14594349)), /**
 * Material emerald color code. (q)
 */
__publicField(_a, "MATERIAL_EMERALD", new _a("q", 1155126)), /**
 * Material diamond color code. (s)
 */
__publicField(_a, "MATERIAL_DIAMOND", new _a("s", 2931368)), /**
 * Material lapis color code. (t)
 */
__publicField(_a, "MATERIAL_LAPIS", new _a("t", 2181499)), /**
 * Material amethyst color code. (u)
 */
__publicField(_a, "MATERIAL_AMETHYST", new _a("u", 10116294)), /**
 * Obfuscated color code. (k)
 */
__publicField(_a, "OBFUSCATED", new _a("k")), /**
 * Bold color code. (l)
 */
__publicField(_a, "BOLD", new _a("l")), /**
 * Italic color code. (o)
 */
__publicField(_a, "ITALIC", new _a("o")), /**
 * Reset color code. (r)
 */
__publicField(_a, "RESET", new _a("r")), /**
 * All available color codes.
 */
__publicField(_a, "VALUES", [
  _a.BLACK,
  _a.DARK_BLUE,
  _a.DARK_GREEN,
  _a.DARK_AQUA,
  _a.DARK_RED,
  _a.DARK_PURPLE,
  _a.GOLD,
  _a.GRAY,
  _a.DARK_GRAY,
  _a.BLUE,
  _a.GREEN,
  _a.AQUA,
  _a.RED,
  _a.LIGHT_PURPLE,
  _a.YELLOW,
  _a.WHITE,
  _a.MINECOIN_GOLD,
  _a.MATERIAL_QUARTZ,
  _a.MATERIAL_IRON,
  _a.MATERIAL_NETHERITE,
  _a.MATERIAL_REDSTONE,
  _a.MATERIAL_COPPER,
  _a.MATERIAL_GOLD,
  _a.MATERIAL_EMERALD,
  _a.MATERIAL_DIAMOND,
  _a.MATERIAL_LAPIS,
  _a.MATERIAL_AMETHYST,
  _a.OBFUSCATED,
  _a.BOLD,
  _a.ITALIC,
  _a.RESET
]), /**
 * All available color codes excluding the formatting codes.
 */
__publicField(_a, "ALL_COLORS", [
  _a.BLACK,
  _a.DARK_BLUE,
  _a.DARK_GREEN,
  _a.DARK_AQUA,
  _a.DARK_RED,
  _a.DARK_PURPLE,
  _a.GOLD,
  _a.GRAY,
  _a.DARK_GRAY,
  _a.BLUE,
  _a.GREEN,
  _a.AQUA,
  _a.RED,
  _a.LIGHT_PURPLE,
  _a.YELLOW,
  _a.WHITE,
  _a.MINECOIN_GOLD,
  _a.MATERIAL_QUARTZ,
  _a.MATERIAL_IRON,
  _a.MATERIAL_NETHERITE,
  _a.MATERIAL_REDSTONE,
  _a.MATERIAL_COPPER,
  _a.MATERIAL_GOLD,
  _a.MATERIAL_EMERALD,
  _a.MATERIAL_DIAMOND,
  _a.MATERIAL_LAPIS,
  _a.MATERIAL_AMETHYST
]), /**
 * PREFIX is the section sign (§) used in Minecraft color codes.
 */
__publicField(_a, "PREFIX", "\xA7"), _a);
var _a2;
var ColorJSON = (_a2 = class {
  constructor() {
    // Tokens
    __publicField(this, "OpenObject", "{");
    __publicField(this, "CloseObject", "}");
    __publicField(this, "OpenArray", "[");
    __publicField(this, "CloseArray", "]");
    __publicField(this, "Comma", ",");
    __publicField(this, "KeyValueSeparator", ":");
    __publicField(this, "StringDelimiter", '"');
    __publicField(this, "KeyDelimiter", "");
    __publicField(this, "Indent", "  ");
    __publicField(this, "NewLine", "\n");
    __publicField(this, "Space", " ");
    // Threshold for inline representation
    __publicField(this, "InlineThreshold", 60);
    // Maximum depth to which objects will be traversed
    __publicField(this, "MaxDepth", 1);
    // Whether to include class names
    __publicField(this, "IncludeClassNames", true);
    // Values
    __publicField(this, "FunctionValue", "\u0192");
    __publicField(this, "NullValue", "null");
    __publicField(this, "UndefinedValue", "undefined");
    __publicField(this, "TrueValue", "true");
    __publicField(this, "FalseValue", "false");
    __publicField(this, "CycleValue", "[...cycle...]");
    __publicField(this, "TruncatedObjectValue", "{...}");
    // Colors
    __publicField(this, "OpenCloseObjectColor", ChatColor.YELLOW);
    __publicField(this, "OpenCloseArrayColor", ChatColor.AQUA);
    __publicField(this, "NumberColor", ChatColor.DARK_AQUA);
    __publicField(this, "StringColor", ChatColor.DARK_GREEN);
    __publicField(this, "BooleanColor", ChatColor.GOLD);
    __publicField(this, "NullColor", ChatColor.GOLD);
    __publicField(this, "KeyColor", ChatColor.GRAY);
    __publicField(this, "EscapeColor", ChatColor.GOLD);
    __publicField(this, "FunctionColor", ChatColor.GRAY);
    __publicField(this, "ClassColor", ChatColor.GRAY);
    __publicField(this, "ClassStyle", ChatColor.BOLD);
    __publicField(this, "CycleColor", ChatColor.DARK_RED);
  }
  static createPlain() {
    const plain = new _a2();
    plain.OpenCloseObjectColor = "";
    plain.OpenCloseArrayColor = "";
    plain.NumberColor = "";
    plain.StringColor = "";
    plain.BooleanColor = "";
    plain.NullColor = "";
    plain.KeyColor = "";
    plain.EscapeColor = "";
    plain.FunctionColor = "";
    plain.ClassColor = "";
    plain.ClassStyle = "";
    plain.CycleColor = "";
    return plain;
  }
  /**
   * Transforms a value into a chat-friendly, colored JSON representation.
   * @param value - The value to transform.
   */
  stringify(value) {
    return this.stringifyValue(value, {
      indentLevel: 0,
      visited: /* @__PURE__ */ new WeakSet()
    });
  }
  /**
   * Transforms a string into a JSON representation.
   * @param value - The string to transform.
   */
  stringifyString(value) {
    return this.StringColor + this.StringDelimiter + this.escapeString(value) + this.StringDelimiter + ChatColor.RESET;
  }
  /**
   * Transforms a number into a JSON representation.
   * @param value - The number to transform.
   */
  stringifyNumber(value) {
    return this.NumberColor + value.toString() + ChatColor.RESET;
  }
  /**
   * Transforms a boolean into a JSON representation.
   * @param value - The boolean to transform.
   */
  stringifyBoolean(value) {
    return this.BooleanColor + (value ? this.TrueValue : this.FalseValue) + ChatColor.RESET;
  }
  /**
   * Transforms a function into a JSON representation.
   * @param value - The function to transform.
   */
  // eslint-disable-next-line @typescript-eslint/ban-types
  stringifyFunction(value) {
    return this.FunctionColor + this.FunctionValue + ChatColor.RESET;
  }
  /**
   * Returns a null JSON representation.
   */
  stringifyNull() {
    return this.NullColor + this.NullValue + ChatColor.RESET;
  }
  /**
   * Returns an undefined JSON representation.
   */
  stringifyUndefined() {
    return this.NullColor + this.UndefinedValue + ChatColor.RESET;
  }
  /**
   * Returns a cycle JSON representation.
   */
  stringifyCycle() {
    return this.CycleColor + this.CycleValue + ChatColor.RESET;
  }
  /**
   * Transforms an array into a JSON representation.
   * @param value - The array to transform.
   * @param indentLevel - The indentation level for pretty-printing.
   */
  stringifyArray(value, ctx) {
    const indentSpace = this.Indent.repeat(ctx.indentLevel);
    if (value.length === 0) {
      return this.OpenCloseArrayColor + this.OpenArray + this.CloseArray + ChatColor.RESET;
    }
    let result = this.OpenCloseArrayColor + this.OpenArray + ChatColor.RESET + this.NewLine;
    let compactResult = this.OpenCloseArrayColor + this.OpenArray + ChatColor.RESET;
    value.forEach((item, index) => {
      result += indentSpace + this.Indent + this.stringifyValue(item, this.indent(ctx));
      result += index < value.length - 1 ? this.Comma + this.NewLine : this.NewLine;
      compactResult += this.stringifyValue(item, this.indent(ctx));
      compactResult += index < value.length - 1 ? this.Comma + this.Space : "";
    });
    result += indentSpace + this.OpenCloseArrayColor + this.CloseArray + ChatColor.RESET;
    compactResult += this.OpenCloseArrayColor + this.CloseArray + ChatColor.RESET;
    if (compactResult.length < this.InlineThreshold) {
      return compactResult;
    }
    return result;
  }
  /**
   * Transforms an object into a truncated JSON representation.
   * @param value - The object to transform.
   * @param className - Class Name of the object.
   * @param indentLevel - The indentation level for pretty-printing.
   */
  stringifyTruncatedObject(value, className, ctx) {
    return (this.IncludeClassNames ? this.ClassColor + "" + this.ClassStyle + className + ChatColor.RESET + this.Space : "") + this.TruncatedObjectValue;
  }
  /**
   * Transforms an object into a JSON representation.
   * @param value - The object to transform.
   * @param className - Class Name of the object.
   * @param entries - Entries of the object to transform.
   * @param indentLevel - The indentation level for pretty-printing.
   */
  stringifyObject(value, className, entries, ctx) {
    const indentSpace = this.Indent.repeat(ctx.indentLevel);
    const prefix = this.IncludeClassNames && className !== "Object" ? this.ClassColor + "" + this.ClassStyle + className + ChatColor.RESET + this.Space : "";
    if (entries.length === 0) {
      return prefix + this.OpenCloseObjectColor + this.OpenObject + this.CloseObject + ChatColor.RESET;
    }
    let result = prefix + this.OpenCloseObjectColor + this.OpenObject + ChatColor.RESET + this.NewLine;
    let compactResult = prefix + this.OpenCloseObjectColor + this.OpenObject + ChatColor.RESET;
    entries.forEach(([key, val], index) => {
      const compactVal = this.stringifyValue(val, this.indent(ctx));
      result += indentSpace + this.Indent + this.KeyColor + this.KeyDelimiter + key + this.KeyDelimiter + ChatColor.RESET + this.KeyValueSeparator + this.Space + compactVal;
      result += index < entries.length - 1 ? this.Comma + this.NewLine : this.NewLine;
      compactResult += this.KeyColor + key + ChatColor.RESET + this.KeyValueSeparator + this.Space + compactVal;
      compactResult += index < entries.length - 1 ? this.Comma + this.Space : "";
    });
    result += indentSpace + this.OpenCloseObjectColor + this.CloseObject + ChatColor.RESET;
    compactResult += this.OpenCloseObjectColor + this.CloseObject + ChatColor.RESET;
    if (compactResult.length < this.InlineThreshold) {
      return compactResult;
    }
    return result;
  }
  shouldTruncateObject(value, className, ctx) {
    return !(className === "Object" || ctx.indentLevel <= this.MaxDepth || this.MaxDepth <= 0);
  }
  /**
   * Transforms a value of any type into a JSON representation. This function is not meant to be overridden.
   * @param value - The value to transform.
   * @param indentLevel - The indentation level for pretty-printing.
   */
  stringifyValue(value, ctx) {
    if (value === null)
      return this.stringifyNull();
    if (value === void 0)
      return this.stringifyUndefined();
    if (typeof value === "number")
      return this.stringifyNumber(value);
    if (typeof value === "string")
      return this.stringifyString(value);
    if (typeof value === "boolean")
      return this.stringifyBoolean(value);
    if (typeof value === "function")
      return this.stringifyFunction(value);
    if (this.isCycle(value, ctx)) {
      return this.stringifyCycle();
    }
    this.markCycle(value, ctx);
    if (Array.isArray(value)) {
      const result = this.stringifyArray(value, ctx.indentLevel ? this.indent(ctx) : ctx);
      this.clearCycle(value, ctx);
      return result;
    }
    if (typeof value === "object") {
      const name = value.constructor.name;
      if (!this.shouldTruncateObject(value, name, ctx)) {
        const keySet = /* @__PURE__ */ new Set();
        let prototype = Object.getPrototypeOf(value);
        let keys = Object.keys(prototype);
        while (keys.length > 0) {
          keys.forEach((key) => keySet.add(key));
          prototype = Object.getPrototypeOf(prototype);
          keys = Object.keys(prototype);
        }
        Object.keys(value).forEach((key) => keySet.add(key));
        keySet.delete("__cycleDetection__");
        const allKeys = [...keySet].sort();
        const entries = allKeys.map((key) => {
          try {
            return [key, value[key] ?? void 0];
          } catch (e) {
            return [key, void 0];
          }
        }).filter(([, val]) => typeof val !== "function" && val !== void 0);
        const result = this.stringifyObject(value, name, entries, ctx);
        this.clearCycle(value, ctx);
        return result;
      } else {
        const result = this.stringifyTruncatedObject(value, name, ctx);
        this.clearCycle(value, ctx);
        return result;
      }
    }
    this.clearCycle(value, ctx);
    return ChatColor.RESET + value.toString();
  }
  /**
   * Escapes a string for JSON.
   * @param str - The string to escape.
   */
  escapeString(str) {
    return str.replace(/\\/g, this.EscapeColor + "\\\\" + this.StringColor).replace(/"/g, this.EscapeColor + '\\"' + this.StringColor).replace(/\n/g, this.EscapeColor + "\\n" + this.StringColor).replace(/\r/g, this.EscapeColor + "\\r" + this.StringColor).replace(/\t/g, this.EscapeColor + "\\t" + this.StringColor);
  }
  markCycle(value, ctx) {
    ctx.visited.add(value);
  }
  isCycle(value, ctx) {
    return ctx.visited.has(value);
  }
  clearCycle(value, ctx) {
    ctx.visited.delete(value);
  }
  indent(ctx) {
    return { ...ctx, indentLevel: ctx.indentLevel + 1 };
  }
}, /**
 * The default ColorJSON instance
 */
__publicField(_a2, "DEFAULT", new _a2()), /**
 * A ColorJSON instance that does not colorize anything.
 */
__publicField(_a2, "PLAIN", _a2.createPlain()), _a2);
var sourceMapping = void 0;
try {
  sourceMapping = globalSourceMapping;
} catch (e) {
}
var _a3;
var LogLevel = (_a3 = class {
  /**
   * The constructor for each log level.
   *
   * @param {number} level - The numerical level for this logger.
   * @param {string} name - The string name for this logger.
   * @param {ChatColor} color - The color to use for this logger. Defaults to `ChatColor.RESET`.
   */
  constructor(level, name, color = ChatColor.RESET) {
    this.level = level;
    this.name = name;
    this.color = color;
  }
  /**
   * Return the logging level as a string.
   *
   * @returns {string} The string representation of the logging level.
   */
  toString() {
    return this.color + this.name.toUpperCase() + ChatColor.RESET;
  }
  /**
   * Parse a string to get the corresponding `LogLevel`.
   *
   * @param {string} str - The string to parse.
   * @returns {LogLevel} The corresponding `LogLevel`, or `undefined` if none was found.
   */
  static parse(str) {
    str = str.toLowerCase();
    for (const level of _a3.values) {
      if (level.name === str)
        return level;
    }
    const num = parseInt(str);
    if (!isNaN(num)) {
      for (const level of _a3.values) {
        if (level.level === num)
          return level;
      }
    }
    return void 0;
  }
}, __publicField(_a3, "All", new _a3(-2, "all")), __publicField(_a3, "Trace", new _a3(-2, "trace", ChatColor.DARK_AQUA)), __publicField(_a3, "Debug", new _a3(-1, "debug", ChatColor.AQUA)), __publicField(_a3, "Info", new _a3(0, "info", ChatColor.GREEN)), __publicField(_a3, "Warn", new _a3(1, "warn", ChatColor.GOLD)), __publicField(_a3, "Error", new _a3(2, "error", ChatColor.RED)), __publicField(_a3, "Fatal", new _a3(3, "fatal", ChatColor.DARK_RED)), __publicField(_a3, "Off", new _a3(100, "off")), /**
 * The list of all available log levels.
 */
__publicField(_a3, "values", [
  _a3.All,
  _a3.Trace,
  _a3.Debug,
  _a3.Info,
  _a3.Warn,
  _a3.Error,
  _a3.Fatal,
  _a3.Off
]), _a3);
function starMatch(pattern, str) {
  if (pattern === "*")
    return true;
  if (pattern.includes("*")) {
    if (pattern.startsWith("*")) {
      return str.endsWith(pattern.substring(1));
    }
    if (pattern.endsWith("*")) {
      return str.startsWith(pattern.substring(0, pattern.length - 1));
    }
    const regex = new RegExp(pattern.replace(/\*/g, ".*"));
    return regex.test(str);
  }
  return pattern === str;
}
var loggingSettings = {
  level: LogLevel.Info,
  filter: ["*"],
  outputTags: false,
  formatFunction: (level, logger4, message, tags = void 0) => {
    const _tags = tags !== void 0 ? `\xA77${tags.map((tag) => `[${tag}]`).join("")}\xA7r` : "";
    return `[${level}][${ChatColor.MATERIAL_EMERALD}${logger4.name}${ChatColor.RESET}]${_tags} ${message}`;
  },
  messagesJoinFunction: (messages) => {
    return messages.join(" ");
  },
  jsonFormatter: ColorJSON.DEFAULT,
  outputConfig: {
    [LogLevel.Trace.level]: [
      0,
      1
      /* ConsoleInfo */
    ],
    [LogLevel.Debug.level]: [
      0,
      1
      /* ConsoleInfo */
    ],
    [LogLevel.Info.level]: [
      0,
      1
      /* ConsoleInfo */
    ],
    [LogLevel.Warn.level]: [
      0,
      1,
      2
      /* ConsoleWarn */
    ],
    [LogLevel.Error.level]: [
      0,
      1,
      3
      /* ConsoleError */
    ],
    [LogLevel.Fatal.level]: [
      0,
      1,
      3
      /* ConsoleError */
    ]
  }
};
var _a4;
var Logger = (_a4 = class {
  /**
   * Construct a new Logger
   *
   * @param {string} name - The name of the Logger.
   * @param {string[]} tags - The tags for the logger as strings.
   */
  constructor(name, tags = []) {
    this.name = name;
    this.tags = tags;
  }
  /**
   *  Initialize logger class
   */
  static init() {
    LOGGING: {
      if (_a4.initialized)
        return;
      _a4.initialized = true;
      system3.afterEvents.scriptEventReceive.subscribe((ev) => {
        if (ev.id === "logging:level" || ev.id === "log:level") {
          if (!ev.message) {
            loggingSettings.level = LogLevel.Info;
            world3.sendMessage(
              `${ChatColor.AQUA}Logging level set to ${ChatColor.BOLD}${loggingSettings.level}`
            );
          } else {
            const level = LogLevel.parse(ev.message);
            if (level) {
              loggingSettings.level = level;
              world3.sendMessage(
                `${ChatColor.AQUA}Logging level set to ${ChatColor.BOLD}${loggingSettings.level}`
              );
            } else {
              world3.sendMessage(
                `${ChatColor.DARK_RED}Invalid logging level: ${ev.message}`
              );
            }
          }
        } else if (ev.id === "logging:filter" || ev.id === "log:filter") {
          if (!ev.message) {
            loggingSettings.filter = ["*"];
          } else {
            loggingSettings.filter = ev.message.split(",");
          }
          world3.sendMessage(
            `${ChatColor.AQUA}Logging filter set to ${ChatColor.BOLD}${loggingSettings.filter.join(", ")}`
          );
        }
      });
    }
  }
  /**
   * @param {LogLevel} level - The level to set.
   */
  static setLevel(level) {
    loggingSettings.level = level;
  }
  /**
   * Filter the loggers by the given tags. Tags can use the `*` wildcard.
   * @param {'*' | string[]} filter - The filter to set.
   */
  static setFilter(filter) {
    loggingSettings.filter = filter;
  }
  /**
   * Set the format function for the logger.
   * @param {function} func - The function to set.
   */
  static setFormatFunction(func) {
    loggingSettings.formatFunction = func;
  }
  /**
   * Set the function, that joins multiple messages into one for the logger.
   * @param {function} func - The function to set.
   */
  static setMessagesJoinFunction(func) {
    loggingSettings.messagesJoinFunction = func;
  }
  /**
   * Set the tag visibility for the logger. When true, tags will be printed in the log. Disabled by default.
   * @param visible
   */
  static setTagsOutputVisibility(visible) {
    loggingSettings.outputTags = visible;
  }
  /**
   * Set the JSON formatter for the logger.
   * @param {ColorJSON} formatter - The json formatter to set.
   */
  static setJsonFormatter(formatter) {
    loggingSettings.jsonFormatter = formatter;
  }
  /**
   * Get the output configuration for the logger.
   * @returns {OutputConfig} The output configuration.
   */
  static getOutputConfig() {
    return loggingSettings.outputConfig;
  }
  /**
   * Returns a new Logger.
   *
   * @param {string} name - The name of the Logger.
   * @param {string[]} tags - The tags for the Logger as strings.
   *
   * @returns {Logger} A new Logger.
   */
  static getLogger(name, ...tags) {
    LOGGING: {
      if (!_a4.initialized) {
        _a4.init();
      }
    }
    return new _a4(name, tags);
  }
  /**
   * Log messages with the level set.
   *
   * @param {LogLevel} level - The LogLevel to log the messages at.
   * @param {array} message - An array of the messages to log.
   */
  log(level, ...message) {
    LOGGING: {
      if (level.level < loggingSettings.level.level)
        return;
      if (loggingSettings.filter.length === 0 || this.tags.length === 0) {
        this.logRaw(level, ...message);
        return;
      }
      for (const filter of loggingSettings.filter) {
        if (filter.startsWith("!")) {
          if (starMatch(filter.substring(1), this.name) || this.tags.some((tag) => starMatch(filter.substring(1), tag))) {
            return;
          }
        }
        if (starMatch(filter, this.name) || this.tags.some((tag) => starMatch(filter, tag))) {
          this.logRaw(level, ...message);
          return;
        }
      }
    }
  }
  stringifyError(x) {
    let stack = x.stack ?? "";
    if (sourceMapping) {
      const stackLineRegex = /\(([^)]+\.js):(\d+)(?::(\d+))?\)/;
      stack = stack.split("\n").map((line) => {
        const match = stackLineRegex.exec(line);
        if (match) {
          const filePath = match[1];
          const lineNumber = parseInt(match[2], 10) - sourceMapping.metadata.offset;
          if (filePath.includes(sourceMapping.metadata.filePath)) {
            const mappingEntry = globalSourceMapping[lineNumber];
            if (mappingEntry) {
              const replacement = `(${mappingEntry.source}:${mappingEntry.originalLine})`;
              return line.replace(stackLineRegex, replacement);
            }
          }
        }
        return line;
      }).join("\n");
    }
    return `${ChatColor.DARK_RED}${ChatColor.BOLD}${x.message}
${ChatColor.RESET}${ChatColor.GRAY}${ChatColor.ITALIC}${stack}${ChatColor.RESET}`;
  }
  /**
   * Internal function to log messages with the level set, that bypasses the filters.
   *
   * @param {LogLevel} level - The LogLevel to log the messages at.
   * @param {array} message - An array of the messages to log.
   */
  logRaw(level, ...message) {
    LOGGING: {
      const msgs = message.map((x) => {
        if (x === void 0) {
          return ChatColor.GOLD + "undefined" + ChatColor.RESET;
        }
        if (x === null) {
          return ChatColor.GOLD + "null" + ChatColor.RESET;
        }
        if (x && x instanceof Error) {
          return this.stringifyError(x);
        }
        if (typeof x === "object" || Array.isArray(x)) {
          return loggingSettings.jsonFormatter.stringify(x) + ChatColor.RESET;
        }
        return x.toString() + ChatColor.RESET;
      });
      const formatted = loggingSettings.formatFunction(
        level,
        this,
        loggingSettings.messagesJoinFunction(msgs),
        loggingSettings.outputTags ? this.tags : void 0
      );
      const outputs = loggingSettings.outputConfig[level.level] || [
        0,
        1
        /* ConsoleInfo */
      ];
      if (outputs.includes(
        0
        /* Chat */
      )) {
        try {
          world3.sendMessage(formatted);
        } catch (_) {
          system3.run(() => {
            world3.sendMessage(formatted);
          });
        }
      }
      if (outputs.includes(
        1
        /* ConsoleInfo */
      )) {
        if (console.originalLog) {
          console.originalLog(ChatColor.stripColor(formatted));
        } else {
          console.log(ChatColor.stripColor(formatted));
        }
      }
      if (outputs.includes(
        2
        /* ConsoleWarn */
      )) {
        console.warn(formatted);
      }
      if (outputs.includes(
        3
        /* ConsoleError */
      )) {
        console.error(formatted);
      }
    }
  }
  /**
   * Logs a trace message.
   *
   * @param {...unknown} message - The message(s) to be logged.
   */
  trace(...message) {
    LOGGING:
      this.log(LogLevel.Trace, ...message);
  }
  /**
   * Logs debug message.
   *
   * @param {...unknown[]} message - The message(s) to be logged.
   */
  debug(...message) {
    LOGGING:
      this.log(LogLevel.Debug, ...message);
  }
  /**
   * Logs an informational message.
   *
   * @param {...unknown[]} message - The message(s) to be logged.
   */
  info(...message) {
    LOGGING:
      this.log(LogLevel.Info, ...message);
  }
  /**
   * Logs a warning message.
   *
   * @param {...unknown[]} message - The warning message or messages to be logged.
   */
  warn(...message) {
    LOGGING:
      this.log(LogLevel.Warn, ...message);
  }
  /**
   * Logs an error message.
   *
   * @param {...unknown[]} message - The error message(s) to log.
   */
  error(...message) {
    LOGGING:
      this.log(LogLevel.Error, ...message);
  }
  /**
   * Logs a fatal error.
   *
   * @param {unknown[]} message - The error message to log.
   */
  fatal(...message) {
    LOGGING:
      this.log(LogLevel.Fatal, ...message);
  }
}, __publicField(_a4, "initialized", false), _a4);
var _a5;
var Vec3 = (_a5 = class {
  constructor(x, y, z) {
    __publicField(this, "x");
    __publicField(this, "y");
    __publicField(this, "z");
    if (x === Direction.Down) {
      this.x = 0;
      this.y = -1;
      this.z = 0;
    } else if (x === Direction.Up) {
      this.x = 0;
      this.y = 1;
      this.z = 0;
    } else if (x === Direction.North) {
      this.x = 0;
      this.y = 0;
      this.z = -1;
    } else if (x === Direction.South) {
      this.x = 0;
      this.y = 0;
      this.z = 1;
    } else if (x === Direction.East) {
      this.x = 1;
      this.y = 0;
      this.z = 0;
    } else if (x === Direction.West) {
      this.x = -1;
      this.y = 0;
      this.z = 0;
    } else if (typeof x === "number") {
      this.x = x;
      this.y = y;
      this.z = z;
    } else if (Array.isArray(x)) {
      this.x = x[0];
      this.y = x[1];
      this.z = x[2];
    } else if (x instanceof _a5) {
      this.x = x.x;
      this.y = x.y;
      this.z = x.z;
    } else {
      if (!x || !x.x && x.x !== 0 || !x.y && x.y !== 0 || !x.z && x.z !== 0) {
        _a5.log.error(new Error("Invalid vector"), x);
        throw new Error("Invalid vector");
      }
      this.x = x.x;
      this.y = x.y;
      this.z = x.z;
    }
  }
  static from(x, y, z) {
    if (x instanceof _a5)
      return x;
    if (typeof x === "number" && y !== void 0 && z !== void 0) {
      return new _a5(x, y, z);
    }
    if (Array.isArray(x)) {
      return new _a5(x);
    }
    if (x === Direction.Down)
      return _a5.Down;
    if (x === Direction.Up)
      return _a5.Up;
    if (x === Direction.North)
      return _a5.North;
    if (x === Direction.South)
      return _a5.South;
    if (x === Direction.East)
      return _a5.East;
    if (x === Direction.West)
      return _a5.West;
    if (!x || !x.x && x.x !== 0 || !x.y && x.y !== 0 || !x.z && x.z !== 0) {
      _a5.log.error(new Error("Invalid arguments"), x, y, z);
      throw new Error("Invalid arguments");
    }
    return new _a5(
      x.x,
      x.y,
      x.z
    );
  }
  static _from(x, y, z) {
    if (x instanceof _a5)
      return x;
    if (typeof x === "number" && y !== void 0 && z !== void 0) {
      return new _a5(x, y, z);
    }
    if (Array.isArray(x)) {
      return new _a5(x);
    }
    if (x === Direction.Down)
      return _a5.Down;
    if (x === Direction.Up)
      return _a5.Up;
    if (x === Direction.North)
      return _a5.North;
    if (x === Direction.South)
      return _a5.South;
    if (x === Direction.East)
      return _a5.East;
    if (x === Direction.West)
      return _a5.West;
    if (!x || !x.x && x.x !== 0 || !x.y && x.y !== 0 || !x.z && x.z !== 0) {
      _a5.log.error(new Error("Invalid arguments"), x, y, z);
      throw new Error("Invalid arguments");
    }
    return new _a5(
      x.x,
      x.y,
      x.z
    );
  }
  /**
   * Creates a copy of the current vector.
   *
   * @returns A new vector with the same values as the current vector.
   */
  copy() {
    return new _a5(this.x, this.y, this.z);
  }
  static fromYawPitch(yawOrRotation, pitch) {
    let yaw;
    if (typeof yawOrRotation === "number") {
      yaw = yawOrRotation;
      pitch = pitch;
    } else {
      yaw = yawOrRotation.y;
      pitch = yawOrRotation.x;
    }
    const psi = yaw * (Math.PI / 180);
    const theta = pitch * (Math.PI / 180);
    const x = Math.cos(theta) * Math.sin(psi);
    const y = Math.sin(theta);
    const z = Math.cos(theta) * Math.cos(psi);
    return new _a5(x, y, z);
  }
  static fromRotation(yawOrRotation, pitch) {
    let yaw;
    if (typeof yawOrRotation === "number") {
      yaw = yawOrRotation;
      pitch = pitch;
    } else {
      yaw = yawOrRotation.y;
      pitch = yawOrRotation.x;
    }
    const psi = yaw * (Math.PI / 180);
    const theta = pitch * (Math.PI / 180);
    const x = -Math.cos(theta) * Math.sin(psi);
    const y = -Math.sin(theta);
    const z = Math.cos(theta) * Math.cos(psi);
    return new _a5(x, y, z);
  }
  /**
   * Converts the normal vector to yaw and pitch values.
   *
   * @returns A Vector2 containing the yaw and pitch values.
   * @deprecated Use toRotation() instead. This method returns inverted values and will be removed in the future.
   */
  toYawPitch() {
    if (this.isZero()) {
      _a5.log.error(
        new Error("Cannot convert zero-length vector to direction")
      );
      throw new Error("Cannot convert zero-length vector to direction");
    }
    const direction = this.normalize();
    const yaw = Math.atan2(direction.x, direction.z) * (180 / Math.PI);
    const pitch = Math.asin(direction.y) * (180 / Math.PI);
    return {
      x: pitch,
      y: yaw
    };
  }
  /**
   * Converts the normal vector to yaw and pitch values.
   *
   * @returns A Vector2 containing the yaw and pitch values.
   */
  toRotation() {
    if (this.isZero()) {
      _a5.log.error(
        new Error("Cannot convert zero-length vector to direction")
      );
      throw new Error("Cannot convert zero-length vector to direction");
    }
    const direction = this.normalize();
    const yaw = -Math.atan2(direction.x, direction.z) * (180 / Math.PI);
    const pitch = Math.asin(-direction.y) * (180 / Math.PI);
    return {
      x: pitch,
      y: yaw
    };
  }
  add(x, y, z) {
    const v = _a5._from(x, y, z);
    return _a5.from(v.x + this.x, v.y + this.y, v.z + this.z);
  }
  subtract(x, y, z) {
    const v = _a5._from(x, y, z);
    return _a5.from(this.x - v.x, this.y - v.y, this.z - v.z);
  }
  multiply(x, y, z) {
    if (typeof x === "number" && y === void 0 && z === void 0) {
      return _a5.from(this.x * x, this.y * x, this.z * x);
    }
    const v = _a5._from(x, y, z);
    return _a5.from(v.x * this.x, v.y * this.y, v.z * this.z);
  }
  /**
   * Scales the current vector by a scalar.
   *
   * @param scalar - The scalar to scale the vector by.
   * @returns The updated vector after scaling.
   */
  scale(scalar) {
    return _a5.from(this.x * scalar, this.y * scalar, this.z * scalar);
  }
  divide(x, y, z) {
    if (typeof x === "number" && y === void 0 && z === void 0) {
      if (x === 0)
        throw new Error("Cannot divide by zero");
      return _a5.from(this.x / x, this.y / x, this.z / x);
    }
    const v = _a5._from(x, y, z);
    if (v.x === 0 || v.y === 0 || v.z === 0)
      throw new Error("Cannot divide by zero");
    return _a5.from(this.x / v.x, this.y / v.y, this.z / v.z);
  }
  /**
   * Normalizes the vector to have a length (magnitude) of 1.
   * Normalized vectors are often used as a direction vectors.
   *
   * @returns The normalized vector.
   */
  normalize() {
    if (this.isZero()) {
      _a5.log.error(new Error("Cannot normalize zero-length vector"));
      throw new Error("Cannot normalize zero-length vector");
    }
    const len = this.length();
    return _a5.from(this.x / len, this.y / len, this.z / len);
  }
  /**
   * Computes the length (magnitude) of the vector.
   *
   * @returns The length of the vector.
   */
  length() {
    return Math.hypot(this.x, this.y, this.z);
  }
  /**
   * Computes the squared length of the vector.
   * This is faster than computing the actual length and can be useful for comparison purposes.
   *
   * @returns The squared length of the vector.
   */
  lengthSquared() {
    return this.x * this.x + this.y * this.y + this.z * this.z;
  }
  cross(x, y, z) {
    const v = _a5._from(x, y, z);
    return _a5.from(
      this.y * v.z - this.z * v.y,
      this.z * v.x - this.x * v.z,
      this.x * v.y - this.y * v.x
    );
  }
  distance(x, y, z) {
    const v = _a5._from(x, y, z);
    return this.subtract(v).length();
  }
  distanceSquared(x, y, z) {
    const v = _a5._from(x, y, z);
    return this.subtract(v).lengthSquared();
  }
  /**
   * Computes the linear interpolation between the current vector and another vector, when t is in the range [0, 1].
   * Computes the extrapolation when t is outside this range.
   *
   * @param v - The other vector.
   * @param t - The interpolation factor.
   * @returns A new vector after performing the lerp operation.
   */
  lerp(v, t) {
    if (!v || !t)
      return _a5.from(this);
    if (t === 1)
      return _a5.from(v);
    if (t === 0)
      return _a5.from(this);
    return _a5.from(
      this.x + (v.x - this.x) * t,
      this.y + (v.y - this.y) * t,
      this.z + (v.z - this.z) * t
    );
  }
  /**
   * Computes the spherical linear interpolation between the current vector and another vector, when t is in the range [0, 1].
   * Computes the extrapolation when t is outside this range.
   *
   * @param v - The other vector.
   * @param t - The interpolation factor.
   * @returns A new vector after performing the slerp operation.
   */
  slerp(v, t) {
    if (!v || !t)
      return _a5.from(this);
    if (t === 1)
      return _a5.from(v);
    if (t === 0)
      return _a5.from(this);
    const dot = this.dot(v);
    const theta = Math.acos(dot) * t;
    const relative = _a5.from(v).subtract(this.multiply(dot)).normalize();
    return this.multiply(Math.cos(theta)).add(
      relative.multiply(Math.sin(theta))
    );
  }
  dot(x, y, z) {
    const v = _a5._from(x, y, z);
    return this.x * v.x + this.y * v.y + this.z * v.z;
  }
  angleBetween(x, y, z) {
    const v = _a5._from(x, y, z);
    const dotProduct = this.dot(v);
    const lenSq1 = this.lengthSquared();
    if (lenSq1 === 0) {
      return 0;
    }
    const lenSq2 = v.lengthSquared();
    if (lenSq2 === 0) {
      return 0;
    }
    const denom = Math.sqrt(lenSq1 * lenSq2);
    const cosAngle = Math.min(1, Math.max(-1, dotProduct / denom));
    return Math.acos(cosAngle);
  }
  projectOnto(x, y, z) {
    const v = _a5._from(x, y, z);
    if (v.isZero()) {
      return _a5.Zero;
    }
    const denom = v.dot(v);
    if (denom === 0) {
      return _a5.Zero;
    }
    const scale = this.dot(v) / denom;
    return _a5.from(v.x * scale, v.y * scale, v.z * scale);
  }
  reflect(x, y, z) {
    const normal = _a5._from(x, y, z);
    const proj = this.projectOnto(normal);
    return this.subtract(proj.multiply(2));
  }
  /**
   * Rotates the current normalized vector by a given angle around a given axis.
   *
   * @param axis - The axis of rotation.
   * @param angle - The angle of rotation in degrees.
   * @returns The rotated vector.
   */
  rotate(axis, angle) {
    const halfAngle = angle * Math.PI / 180 / 2;
    const w = Math.cos(halfAngle);
    const x = axis.x * Math.sin(halfAngle);
    const y = axis.y * Math.sin(halfAngle);
    const z = axis.z * Math.sin(halfAngle);
    const v = this;
    const qv_x = w * w * v.x + 2 * y * w * v.z - 2 * z * w * v.y + x * x * v.x + 2 * y * x * v.y + 2 * z * x * v.z - z * z * v.x - y * y * v.x;
    const qv_y = 2 * x * y * v.x + y * y * v.y + 2 * z * y * v.z + 2 * w * z * v.x - z * z * v.y + w * w * v.y - 2 * x * w * v.z - x * x * v.y;
    const qv_z = 2 * x * z * v.x + 2 * y * z * v.y + z * z * v.z - 2 * w * y * v.x - y * y * v.z + 2 * w * x * v.y - x * x * v.z + w * w * v.z;
    return new _a5(qv_x, qv_y, qv_z);
  }
  /**
   * Updates the X, Y, and Z components of the vector.
   *
   * @param x - The function to use to update the X value.
   * @param y - The function to use to update the Y value.
   * @param z - The function to use to update the Z value.
   * @returns The updated vector with the new values.
   */
  update(x, y, z) {
    if (!x) {
      x = (value) => value;
    }
    if (!y) {
      y = (value) => value;
    }
    if (!z) {
      z = (value) => value;
    }
    return new _a5(x(this.x), y(this.y), z(this.z));
  }
  setX(value) {
    if (typeof value === "number") {
      return new _a5(value, this.y, this.z);
    }
    return new _a5(value(this.x), this.y, this.z);
  }
  setY(value) {
    if (typeof value === "number") {
      return new _a5(this.x, value, this.z);
    }
    return new _a5(this.x, value(this.y), this.z);
  }
  setZ(value) {
    if (typeof value === "number") {
      return new _a5(this.x, this.y, value);
    }
    return new _a5(this.x, this.y, value(this.z));
  }
  /**
   * Calculates the shortest distance between a point (represented by this Vector3 instance) and a line segment.
   *
   * This method finds the perpendicular projection of the point onto the line defined by the segment. If this
   * projection lies outside the line segment, then the method calculates the distance from the point to the
   * nearest segment endpoint.
   *
   * @param start - The starting point of the line segment.
   * @param end - The ending point of the line segment.
   * @returns The shortest distance between the point and the line segment.
   */
  distanceToLineSegment(start, end) {
    const lineDirection = _a5.from(end).subtract(start);
    if (lineDirection.lengthSquared() === 0) {
      return this.subtract(start).length();
    }
    const t = Math.max(
      0,
      Math.min(
        1,
        this.subtract(start).dot(lineDirection) / lineDirection.dot(lineDirection)
      )
    );
    const projection = _a5.from(start).add(lineDirection.multiply(t));
    return this.subtract(projection).length();
  }
  /**
   * Floors the X, Y, and Z components of the vector.
   * @returns A new vector with the floored components.
   */
  floor() {
    return this.update(Math.floor, Math.floor, Math.floor);
  }
  /**
   * Floors the X component of the vector.
   * @returns A new vector with the floored X component.
   */
  floorX() {
    return this.setX(Math.floor);
  }
  /**
   * Floors the Y component of the vector.
   * @returns A new vector with the floored Y component.
   */
  floorY() {
    return this.setY(Math.floor);
  }
  /**
   * Floors the Z component of the vector.
   * @returns A new vector with the floored Z component.
   */
  floorZ() {
    return this.setZ(Math.floor);
  }
  /**
   * Ceils the X, Y, and Z components of the vector.
   * @returns A new vector with the ceiled components.
   */
  ceil() {
    return new _a5(Math.ceil(this.x), Math.ceil(this.y), Math.ceil(this.z));
  }
  /**
   * Ceils the X component of the vector.
   * @returns A new vector with the ceiled X component.
   */
  ceilX() {
    return this.setX(Math.ceil);
  }
  /**
   * Ceils the Y component of the vector.
   * @returns A new vector with the ceiled Y component.
   */
  ceilY() {
    return this.setY(Math.ceil);
  }
  /**
   * Ceils the Z component of the vector.
   * @returns A new vector with the ceiled Z component.
   */
  ceilZ() {
    return this.setZ(Math.ceil);
  }
  /**
   * Rounds the X, Y, and Z components of the vector.
   * @returns A new vector with the rounded components.
   */
  round() {
    return this.update(Math.round, Math.round, Math.round);
  }
  /**
   * Rounds the X component of the vector.
   * @returns A new vector with the rounded X component.
   */
  roundX() {
    return this.setX(Math.round);
  }
  /**
   * Rounds the Y component of the vector.
   * @returns A new vector with the rounded Y component.
   */
  roundY() {
    return this.setY(Math.round);
  }
  /**
   * Rounds the Z component of the vector.
   * @returns A new vector with the rounded Z component.
   */
  roundZ() {
    return this.setZ(Math.round);
  }
  /**
   * Returns a new vector offset from the current vector up by 1 block.
   * @returns A new vector offset from the current vector up by 1 block.
   */
  up() {
    return this.add(_a5.Up);
  }
  /**
   * Returns a new vector offset from the current vector down by 1 block.
   * @returns A new vector offset from the current vector down by 1 block.
   */
  down() {
    return this.add(_a5.Down);
  }
  /**
   * Returns a new vector offset from the current vector north by 1 block.
   * @returns A new vector offset from the current vector north by 1 block.
   */
  north() {
    return this.add(_a5.North);
  }
  /**
   * Returns a new vector offset from the current vector south by 1 block.
   * @returns A new vector offset from the current vector south by 1 block.
   */
  south() {
    return this.add(_a5.South);
  }
  /**
   * Returns a new vector offset from the current vector east by 1 block.
   * @returns A new vector offset from the current vector east by 1 block.
   */
  east() {
    return this.add(_a5.East);
  }
  /**
   * Returns a new vector offset from the current vector west by 1 block.
   * @returns A new vector offset from the current vector west by 1 block.
   */
  west() {
    return this.add(_a5.West);
  }
  /**
   * Checks if the current vector is equal to the zero vector.
   * @returns true if the vector is equal to the zero vector, else returns false.
   */
  isZero() {
    return this.x === 0 && this.y === 0 && this.z === 0;
  }
  /**
   * Converts the vector to an array containing the X, Y, and Z components of the vector.
   * @returns An array containing the X, Y, and Z components of the vector.
   */
  toArray() {
    return [this.x, this.y, this.z];
  }
  /**
   * Converts the vector to a direction.
   * If the vector is not a unit vector, then it will be normalized and rounded to the nearest direction.
   */
  toDirection() {
    if (this.isZero()) {
      _a5.log.error(
        new Error("Cannot convert zero-length vector to direction")
      );
      throw new Error("Cannot convert zero-length vector to direction");
    }
    const normalized = this.normalize();
    const maxValue = Math.max(
      Math.abs(normalized.x),
      Math.abs(normalized.y),
      Math.abs(normalized.z)
    );
    if (maxValue === normalized.x)
      return Direction.East;
    if (maxValue === -normalized.x)
      return Direction.West;
    if (maxValue === normalized.y)
      return Direction.Up;
    if (maxValue === -normalized.y)
      return Direction.Down;
    if (maxValue === normalized.z)
      return Direction.South;
    if (maxValue === -normalized.z)
      return Direction.North;
    _a5.log.error(new Error("Cannot convert vector to direction"), this);
    throw new Error("Cannot convert vector to direction");
  }
  /**
   * Returns a new vector with the X, Y, and Z components rounded to the nearest block location.
   */
  toBlockLocation() {
    return _a5.from(
      (this.x << 0) - (this.x < 0 && this.x !== this.x << 0 ? 1 : 0),
      (this.y << 0) - (this.y < 0 && this.y !== this.y << 0 ? 1 : 0),
      (this.z << 0) - (this.z < 0 && this.z !== this.z << 0 ? 1 : 0)
    );
  }
  almostEqual(x, y, z, delta) {
    try {
      let other;
      if (typeof x !== "number" && z === void 0) {
        other = _a5._from(x, void 0, void 0);
        delta = y;
      } else {
        other = _a5._from(x, y, z);
      }
      return Math.abs(this.x - other.x) <= delta && Math.abs(this.y - other.y) <= delta && Math.abs(this.z - other.z) <= delta;
    } catch (e) {
      return false;
    }
  }
  equals(x, y, z) {
    try {
      const other = _a5._from(x, y, z);
      return this.x === other.x && this.y === other.y && this.z === other.z;
    } catch (e) {
      return false;
    }
  }
  /**
   * Converts the vector to a string representation.
   *
   * @param format - The format of the string representation. Defaults to "long".
   * @param separator - The separator to use between components. Defaults to ", ".
   * @returns The string representation of the vector.
   * @remarks
   * The "long" format is "Vec3(x, y, z)".
   * The "short" format is "x, y, z".
   */
  toString(format = "long", separator = ", ") {
    const result = `${this.x + separator + this.y + separator + this.z}`;
    return format === "long" ? `Vec3(${result})` : result;
  }
  /**
   * Parses a string representation of a vector.
   *
   * @param str - The string representation of the vector.
   * @param format - The format of the string representation. Defaults to "long".
   * @param separator - The separator to use between components. Defaults to ", ".
   * @returns The vector parsed from the string.
   * @throws {Error} If the string format is invalid.
   */
  static fromString(str, format = "long", separator = ", ") {
    if (format === "long") {
      const match = str.match(/^Vec3\((.*)\)$/);
      if (!match) {
        throw new Error("Invalid string format");
      }
      const components = match[1].split(separator);
      if (components.length !== 3) {
        throw new Error("Invalid string format");
      }
      return _a5.from(Number(components[0]), Number(components[1]), Number(components[2]));
    } else {
      const components = str.split(separator);
      if (components.length !== 3) {
        throw new Error("Invalid string format");
      }
      return _a5.from(Number(components[0]), Number(components[1]), Number(components[2]));
    }
  }
}, __publicField(_a5, "log", Logger.getLogger(
  "vec3",
  "vec3",
  "bedrock-boost"
)), /**
 * Zero vector
 */
__publicField(_a5, "Zero", new _a5(0, 0, 0)), /**
 * Down vector, negative towards Y
 */
__publicField(_a5, "Down", new _a5(Direction.Down)), /**
 * Up vector, positive towards Y
 */
__publicField(_a5, "Up", new _a5(Direction.Up)), /**
 * North vector, negative towards Z
 */
__publicField(_a5, "North", new _a5(Direction.North)), /**
 * South vector, positive towards Z
 */
__publicField(_a5, "South", new _a5(Direction.South)), /**
 * East vector, positive towards X
 */
__publicField(_a5, "East", new _a5(Direction.East)), /**
 * West vector, negative towards X
 */
__publicField(_a5, "West", new _a5(Direction.West)), _a5);
var _a6;
var Timings = (_a6 = class {
  /**
   * Begin measuring the time it takes to perform an operation.
   * @remarks
   * If another operation is already being measured, the measurement will be ended.
   * 
   * @param operation The name of the operation.
   */
  static begin(operation) {
    this.end();
    this.lastTime = (/* @__PURE__ */ new Date()).getTime();
    this.lastOperation = operation;
  }
  /**
   * End measuring the time it takes to perform an operation and log the result.
   * @remarks
   * If no operation is being measured, this method will do nothing.
   */
  static end() {
    const time = (/* @__PURE__ */ new Date()).getTime();
    if (this.lastTime > 0) {
      _a6.log.debug(`Operation ${this.lastOperation} took ${time - this.lastTime}ms`);
    }
    this.lastTime = -1;
  }
}, __publicField(_a6, "log", Logger.getLogger("Timings", "timings")), __publicField(_a6, "lastTime", -1), __publicField(_a6, "lastOperation", ""), _a6);
function isVersion2(entity) {
  return typeof Object.getPrototypeOf(entity).isValid !== "function";
}
function isValid(entity) {
  const f = Object.getPrototypeOf(entity).isValid;
  if (typeof f === "function") {
    return f.call(entity);
  }
  return entity.isValid;
}
function applyImpulseNew(entity, vector) {
  const { x, y, z } = vector;
  const previousVelocity = entity.getVelocity();
  const horizontalNorm = Math.sqrt(x * x + z * z);
  let directionX = 0;
  let directionZ = 0;
  if (horizontalNorm !== 0) {
    directionX = x / horizontalNorm;
    directionZ = z / horizontalNorm;
  }
  const horizontalStrength = horizontalNorm * 2.5;
  const verticalStrength = y + previousVelocity.y * 0.9;
  if (isVersion2(entity)) {
    entity.applyKnockback(
      {
        x: horizontalStrength * directionX,
        z: horizontalStrength * directionZ
      },
      verticalStrength
    );
  } else {
    entity.applyKnockback(directionX, directionZ, horizontalStrength, verticalStrength);
  }
}
function clearVelocity(entity) {
  const { x, z } = entity.getVelocity();
  const horizontalNorm = Math.sqrt(x * x + z * z);
  let directionX = 0;
  let directionZ = 0;
  if (horizontalNorm !== 0) {
    directionX = -x / horizontalNorm;
    directionZ = -z / horizontalNorm;
  }
  if (isVersion2(entity)) {
    entity.applyKnockback(
      {
        x: horizontalNorm * directionX,
        z: horizontalNorm * directionZ
      },
      0
    );
  } else {
    entity.applyKnockback(directionX, directionZ, horizontalNorm, 0);
  }
}
function install() {
  Player.prototype.applyImpulse = function(vector) {
    applyImpulseNew(this, vector);
  };
  Player.prototype.clearVelocity = function() {
    clearVelocity(this);
  };
}
var _a7;
var Polyfill = (_a7 = class {
  /**
   * Installs the polyfill for the console.
   * 
   * This polyfill makes `console.log` send a message to the world chat.
   */
  static installConsole() {
    if (this._installed.get("console"))
      return;
    this._installed.set("console", true);
    console.originalLog = console.log;
    console.log = (...args) => {
      console.originalLog(...args);
      const message = args.join(" ");
      world32.sendMessage(message);
    };
  }
  /**
   * Installs the polyfill for the player.
   * 
   * This polyfill adds the following methods to the player:
   * - applyImpulse
   * - clearVelocity
   */
  static installPlayer() {
    if (this._installed.get("player"))
      return;
    this._installed.set("player", true);
    install();
  }
}, __publicField(_a7, "_installed", /* @__PURE__ */ new Map()), _a7);
var log = Logger.getLogger("jobUtils", "bedrock-boost", "jobUtils");
var _a8;
var PulseScheduler = (_a8 = class {
  /**
   * Creates a new PulseScheduler instance.
   * @param period The period of the scheduler.
   */
  constructor(processor, period) {
    __publicField(this, "items", []);
    __publicField(this, "period");
    __publicField(this, "currentTick", 0);
    __publicField(this, "runId");
    __publicField(this, "nextIndex", 0);
    __publicField(this, "executionSchedule", []);
    __publicField(this, "processor");
    if (period <= 0) {
      throw new Error("Period must be a positive integer.");
    }
    if (!processor || typeof processor !== "function") {
      throw new Error("Processor function must be defined.");
    }
    this.period = period;
    this.processor = processor;
  }
  /**
   * Adds an item to the schedule.
   * @param item The item to be added.
   * @deprecated Use `push` instead.
   */
  add(item) {
    this.push(item);
  }
  /**
    * Adds multiple items to the schedule.
    * 
    * @param items - The items to be added.
    * @deprecated Use `push` instead.
    */
  addAll(items) {
    this.push(...items);
  }
  /**
   * Removes an item from the schedule at the specified index.
   * @param index - The index of the item to remove.
   */
  remove(index) {
    if (index >= 0 && index < this.items.length) {
      this.items.splice(index, 1);
      if (index < this.nextIndex) {
        this.nextIndex--;
      }
      this.recalculateExecutionSchedule();
    }
  }
  /**
   * Removes items from the schedule that satisfy the given predicate.
   * 
   * @param predicate - The predicate function used to determine if an item should be removed.
   */
  removeIf(predicate) {
    for (let i = this.items.length - 1; i >= 0; i--) {
      if (predicate(this.items[i])) {
        this.remove(i);
      }
    }
  }
  /**
   * Returns a list of the items in the schedule.
   */
  getItems() {
    return this.items;
  }
  /**
   * Starts the schedule.
   */
  start() {
    this.stop();
    this.currentTick = 0;
    this.nextIndex = 0;
    this.runId = system4.runInterval(() => this.tick(), 1);
  }
  /**
   * Stops the schedule.
   */
  stop() {
    if (this.runId !== void 0) {
      system4.clearRun(this.runId);
      this.runId = void 0;
    }
  }
  recalculateExecutionSchedule() {
    const totalExecutions = this.items.length;
    this.executionSchedule = new Array(this.period).fill(0);
    if (totalExecutions === 0) {
      return;
    }
    const interval = this.period / totalExecutions;
    for (let i = 0; i < totalExecutions; i++) {
      this.executionSchedule[Math.round(interval * i) % this.period]++;
    }
  }
  tick() {
    if (this.items.length === 0) {
      _a8.log.trace("No items to process.");
      return;
    }
    const scheduledExecutions = this.executionSchedule[this.currentTick];
    if (scheduledExecutions === 0) {
      _a8.log.trace("No items to process this tick.");
      this.currentTick = (this.currentTick + 1) % this.period;
      if (this.currentTick === 0) {
        this.nextIndex = 0;
      }
      return;
    }
    let executed = 0;
    for (; this.nextIndex < this.items.length && executed < scheduledExecutions; this.nextIndex++) {
      try {
        this.processor(this.items[this.nextIndex]);
      } catch (e) {
        _a8.log.error("Error processing item", e);
      }
      executed++;
    }
    this.currentTick = (this.currentTick + 1) % this.period;
    if (this.currentTick === 0) {
      this.nextIndex = 0;
    }
  }
  push(...items) {
    this.items.push(...items);
    this.recalculateExecutionSchedule();
    return this.items.length;
  }
  pop() {
    const item = this.items.pop();
    this.recalculateExecutionSchedule();
    return item;
  }
  shift() {
    const item = this.items.shift();
    this.recalculateExecutionSchedule();
    return item;
  }
  unshift(...items) {
    this.items.unshift(...items);
    this.recalculateExecutionSchedule();
    return this.items.length;
  }
  splice(start, deleteCount = 0, ...items) {
    const removed = this.items.splice(start, deleteCount, ...items);
    this.recalculateExecutionSchedule();
    return removed;
  }
}, __publicField(_a8, "log", Logger.getLogger("PulseScheduler", "bedrock-boost", "pulse-scheduler")), _a8);
var _a9;
var EntityPulseScheduler = (_a9 = class extends PulseScheduler {
  /**
   * Creates a new EntityPulseScheduler instance.
   * @param period The period of the scheduler.
   * @param queryOptions The query options to use when querying for entities.
   */
  constructor(processor, period, queryOptions) {
    super((t) => {
      if (isValid(t)) {
        processor(t);
      } else {
        this.removeIf((entity) => !isValid(entity));
      }
    }, period);
    this.queryOptions = queryOptions;
    this.push(
      ...world4.getDimension("minecraft:overworld").getEntities(this.queryOptions)
    );
    this.push(
      ...world4.getDimension("minecraft:nether").getEntities(this.queryOptions)
    );
    this.push(
      ...world4.getDimension("minecraft:the_end").getEntities(this.queryOptions)
    );
  }
  compareEntities(a, b) {
    return a.id === b.id;
  }
  start() {
    world4.afterEvents.entityLoad.subscribe((event) => {
      this.addIfMatchesWithRetry(event.entity);
    });
    world4.afterEvents.entitySpawn.subscribe((event) => {
      this.addIfMatchesWithRetry(event.entity);
    });
    world4.afterEvents.entityRemove.subscribe((event) => {
      this.removeIf(
        (entity) => !isValid(entity) || entity.id === event.removedEntityId
      );
    });
    super.start();
  }
  /**
   * Adds an entity to the scheduler if it matches the query options. In case the entity is not valid, it will retry a tick later.
   * @param entity The entity to add.
   */
  addIfMatchesWithRetry(entity) {
    try {
      if (!entity) {
        return;
      }
      if (!isValid(entity)) {
        system5.runInterval(() => {
          if (isValid(entity) && entity.matches(this.queryOptions)) {
            this.push(entity);
          }
        }, 1);
      } else if (entity.matches(this.queryOptions)) {
        this.push(entity);
      }
    } catch (e) {
      _a9.logger.debug(
        "Failed to push entity to scheduler.",
        e
      );
    }
  }
  push(...items) {
    const filtered = items.filter(
      (item) => isValid(item) && !this.items.some(
        (existingItem) => this.compareEntities(existingItem, item)
      )
    );
    return super.push(...filtered);
  }
  unshift(...items) {
    const filtered = items.filter(
      (item) => isValid(item) && !this.items.some(
        (existingItem) => this.compareEntities(existingItem, item)
      )
    );
    return super.unshift(...filtered);
  }
  splice(start, deleteCount, ...items) {
    if (deleteCount === void 0) {
      return super.splice(start);
    }
    const filtered = items.filter(
      (item) => !this.items.some(
        (existingItem) => this.compareEntities(existingItem, item)
      )
    );
    return super.splice(start, deleteCount, ...filtered);
  }
}, __publicField(_a9, "logger", Logger.getLogger(
  "EntityPulseScheduler",
  "bedrock-boost",
  "entity-pulse-scheduler"
)), _a9);
var _a10;
var PlayerPulseScheduler = (_a10 = class extends PulseScheduler {
  /**
   * Creates a new PlayerPulseScheduler instance.
   * @param period The period of the scheduler.
   */
  constructor(processor, period) {
    super((t) => {
      if (isValid(t)) {
        processor(t);
      } else {
        this.removeIf((entity) => !isValid(entity));
      }
    }, period);
    this.push(...world5.getAllPlayers());
  }
  compareEntities(a, b) {
    return a.id === b.id;
  }
  start() {
    world5.afterEvents.playerJoin.subscribe((event) => {
      let attempts = 0;
      const pushPlayer = () => {
        attempts++;
        if (attempts > 10) {
          _a10.logger.debug("Failed to push player to scheduler after 10 attempts.");
          return;
        }
        try {
          const player = world5.getEntity(event.playerId);
          if (player === void 0) {
            system6.runTimeout(pushPlayer, 1);
          }
          if (player instanceof Player2) {
            this.push(player);
          }
        } catch (e) {
          _a10.logger.debug("Failed to push player to scheduler.", e);
          system6.runTimeout(pushPlayer, 1);
        }
      };
      pushPlayer();
    });
    world5.afterEvents.playerLeave.subscribe((event) => {
      this.removeIf((entity) => !isValid(entity) || entity.id === event.playerId);
    });
    super.start();
  }
  push(...items) {
    const filtered = items.filter((item) => isValid(item) && !this.items.some((existingItem) => this.compareEntities(existingItem, item)));
    return super.push(...filtered);
  }
  unshift(...items) {
    const filtered = items.filter((item) => isValid(item) && !this.items.some((existingItem) => this.compareEntities(existingItem, item)));
    return super.unshift(...filtered);
  }
  splice(start, deleteCount, ...items) {
    if (deleteCount === void 0) {
      return super.splice(start);
    }
    const filtered = items.filter((item) => !this.items.some((existingItem) => this.compareEntities(existingItem, item)));
    return super.splice(start, deleteCount, ...filtered);
  }
}, __publicField(_a10, "logger", Logger.getLogger("PlayerPulseScheduler", "bedrock-boost", "player-pulse-scheduler")), _a10);
var _a11;
var DirectionUtils = (_a11 = class {
}, /**
 * The opposite directions of the given directions.
 */
__publicField(_a11, "Opposites", {
  [Direction2.Down]: Direction2.Up,
  [Direction2.Up]: Direction2.Down,
  [Direction2.North]: Direction2.South,
  [Direction2.South]: Direction2.North,
  [Direction2.East]: Direction2.West,
  [Direction2.West]: Direction2.East
}), /**
 * The positive perpendicular directions of the given directions.
 */
__publicField(_a11, "PositivePerpendiculars", {
  [Direction2.Down]: [Direction2.East, Direction2.North],
  [Direction2.Up]: [Direction2.East, Direction2.North],
  [Direction2.North]: [Direction2.East, Direction2.Up],
  [Direction2.South]: [Direction2.East, Direction2.Up],
  [Direction2.East]: [Direction2.North, Direction2.Up],
  [Direction2.West]: [Direction2.North, Direction2.Up]
}), /**
 * The negative perpendicular directions of the given directions.
 */
__publicField(_a11, "NegativePerpendiculars", {
  [Direction2.Down]: [Direction2.West, Direction2.South],
  [Direction2.Up]: [Direction2.West, Direction2.South],
  [Direction2.North]: [Direction2.West, Direction2.Down],
  [Direction2.South]: [Direction2.West, Direction2.Down],
  [Direction2.East]: [Direction2.South, Direction2.Down],
  [Direction2.West]: [Direction2.South, Direction2.Down]
}), /**
 * All directions.
 */
__publicField(_a11, "Values", [
  Direction2.Down,
  Direction2.Up,
  Direction2.North,
  Direction2.South,
  Direction2.East,
  Direction2.West
]), _a11);
var log2 = Logger.getLogger("itemUtils", "bedrock-boost", "itemUtils");

// data/gametests/src/systems/ActionBarManager.ts
var log3 = Logger.getLogger("ActionBarManager");
var _ActionBarManager = class _ActionBarManager {
  constructor() {
    this.messageQueue = /* @__PURE__ */ new Map();
    this.startMessageDisplayLoop();
    this.startSuperPowerRefreshLoop();
  }
  static getInstance() {
    if (!_ActionBarManager._instance) {
      _ActionBarManager._instance = new _ActionBarManager();
    }
    return _ActionBarManager._instance;
  }
  /**
   * Clears all action bar messages for the given player and immediately clears the display.
   */
  clearAllMessages(player) {
    this.messageQueue.delete(player.id);
    player.onScreenDisplay.setActionBar("");
  }
  startMessageDisplayLoop() {
    system8.runInterval(() => {
      this.processMessageQueue();
    }, 4);
  }
  /**
   * Periodically refresh super-power display values for all players.
   * This ensures countdowns and progress bars update even if nothing else
   * triggers the action bar.
   */
  startSuperPowerRefreshLoop() {
    system8.runInterval(() => {
      for (const player of world7.getAllPlayers()) {
        try {
          const message = this.getSuperPowerMessage(player);
          if (message) {
            const existing = this.messageQueue.get(player.id);
            if (!existing || existing.priority >= 3 /* SUPER_POWER */) {
              this.messageQueue.set(player.id, {
                priority: 3 /* SUPER_POWER */,
                message,
                playerId: player.id,
                timestamp: system8.currentTick
              });
            }
          } else {
            const existing = this.messageQueue.get(player.id);
            if (existing && existing.priority === 3 /* SUPER_POWER */) {
              this.messageQueue.delete(player.id);
              player.onScreenDisplay.setActionBar("");
            }
          }
        } catch {
        }
      }
    }, 4);
  }
  /**
   * Builds the combined super-power message for the player (or returns empty string if none).
   * This does not mutate the message queue; it only returns the formatted string.
   */
  getSuperPowerMessage(player) {
    const activeSuperPowers = [];
    const currentTime = system8.currentTick;
    const candyBreakMode = player.getDynamicProperty("mco_nom:candy_break_mode");
    if (candyBreakMode) {
      const candyStartTime = player.getDynamicProperty("mco_nom:candy_break_mode_start_time") || 0;
      const candyElapsedTime = currentTime - candyStartTime;
      const candyTotalDuration = 18 * 20;
      const candyRemainingTime = Math.max(0, candyTotalDuration - candyElapsedTime);
      const candyRemainingSeconds = Math.ceil(candyRemainingTime / 20);
      if (candyRemainingSeconds > 0) {
        const candyColor = this.getCountdownColor(candyRemainingSeconds, 18);
        const candyProgressBar = this.createCandyProgressBar(candyRemainingSeconds, 18);
        const candyTimeDisplay = this.formatTime(candyRemainingSeconds, 18);
        activeSuperPowers.push(
          `\xA76\xA7l[Sugar Rush] ${candyProgressBar} ${candyColor}${candyTimeDisplay}`
        );
      }
    }
    const donutSweetToothMode = player.getDynamicProperty(
      "mco_nom:donut_sweet_tooth_mode"
    );
    if (donutSweetToothMode) {
      const donutStartTime = player.getDynamicProperty("mco_nom:donut_sweet_tooth_start_time") || 0;
      const donutElapsedTime = currentTime - donutStartTime;
      const donutTotalDuration = 90 * 20;
      const donutRemainingTime = Math.max(0, donutTotalDuration - donutElapsedTime);
      const donutRemainingSeconds = Math.ceil(donutRemainingTime / 20);
      if (donutRemainingSeconds > 0) {
        const donutColor = this.getCountdownColor(donutRemainingSeconds, 90);
        const donutThemeColor = "\xA7d";
        const donutProgressBar = this.createCountdownBarForDuration(
          donutRemainingSeconds,
          90,
          donutThemeColor
        );
        const donutTimeDisplay = this.formatTime(donutRemainingSeconds, 90);
        activeSuperPowers.push(
          `${donutThemeColor}\xA7l[Sweet Tooth] ${donutProgressBar} ${donutColor}${donutTimeDisplay}`
        );
      }
    }
    if (activeSuperPowers.length > 0)
      return activeSuperPowers.join(" \xA78| ");
    return "";
  }
  processMessageQueue() {
    for (const [playerId, queuedMessage] of this.messageQueue.entries()) {
      const player = world7.getEntity(playerId);
      if (!player)
        continue;
      try {
        player.onScreenDisplay.setActionBar(queuedMessage.message);
      } catch (e) {
        error(e);
      }
    }
  }
  queueMessage(player, message, priority) {
    const playerId = player.id;
    const existingMessage = this.messageQueue.get(playerId);
    if (!existingMessage || priority <= existingMessage.priority || existingMessage.priority === 2 /* STACK */) {
      this.messageQueue.set(playerId, {
        priority,
        message,
        playerId,
        timestamp: system8.currentTick
      });
    }
  }
  queueTimedMessage(player, message, priority, durationSec) {
    this.queueMessage(player, message, priority);
    const delayTicks = Math.max(1, Math.floor(durationSec * TicksPerSecond));
    system8.runTimeout(() => {
      const current = this.messageQueue.get(player.id);
      if (current && current.priority === priority && current.message === message) {
        this.messageQueue.delete(player.id);
      }
    }, delayTicks);
  }
  queueRewardUnlockMessage(player, rewardType, rewardName, durationSec = 5) {
    const message = `New ${rewardType} Unlocked: \xA7l${rewardName}\xA7r`;
    this.queueTimedMessage(player, message, 0 /* ITEM */, durationSec);
    player.playSound("mco_nom.ui.unlock_reward" /* McoNomUiUnlockReward */);
  }
  /**
   * Queue a minigame status message (uses MINIGAMES priority).
   */
  queueMinigameStatus(player, message) {
    this.queueMessage(player, message, 1 /* MINIGAMES */);
  }
  /**
   * Clear any minigame messages for the player.
   */
  clearMinigameMessages(player) {
    const existingMessage = this.messageQueue.get(player.id);
    if (existingMessage && existingMessage.priority === 1 /* MINIGAMES */) {
      this.messageQueue.delete(player.id);
    }
  }
  clearStackMessages(player) {
    const existingMessage = this.messageQueue.get(player.id);
    if (existingMessage && existingMessage.priority === 2 /* STACK */) {
      this.messageQueue.delete(player.id);
      player.onScreenDisplay.setActionBar("");
    }
  }
  showStackFeedback(player, strategy, stackCount) {
    const message = `${strategy.theme.primaryColor}\xA7l[${strategy.theme.name.toUpperCase()} STACK] \xA7f${stackCount}/${strategy.maxStack}`;
    this.queueMessage(player, message, 2 /* STACK */);
  }
  updateSuperPowerCountdown(player, strategy) {
    this.updateAllSuperPowersDisplay(player);
  }
  updateAllSuperPowersDisplay(player) {
    const activeSuperPowers = [];
    const currentTime = system8.currentTick;
    const candyBreakMode = player.getDynamicProperty("mco_nom:candy_break_mode");
    if (candyBreakMode) {
      const candyStartTime = player.getDynamicProperty("mco_nom:candy_break_mode_start_time") || 0;
      const candyElapsedTime = currentTime - candyStartTime;
      const candyTotalDuration = 18 * 20;
      const candyRemainingTime = Math.max(0, candyTotalDuration - candyElapsedTime);
      const candyRemainingSeconds = Math.ceil(candyRemainingTime / 20);
      if (candyRemainingSeconds > 0) {
        const candyColor = this.getCountdownColor(candyRemainingSeconds, 18);
        const candyProgressBar = this.createCandyProgressBar(candyRemainingSeconds, 18);
        const candyTimeDisplay = this.formatTime(candyRemainingSeconds, 18);
        activeSuperPowers.push(
          `\xA76\xA7l[Sugar Rush] ${candyProgressBar} ${candyColor}${candyTimeDisplay}`
        );
      }
    }
    const donutSweetToothMode = player.getDynamicProperty(
      "mco_nom:donut_sweet_tooth_mode"
    );
    if (donutSweetToothMode) {
      const donutStartTime = player.getDynamicProperty("mco_nom:donut_sweet_tooth_start_time") || 0;
      const currentTime2 = system8.currentTick;
      const donutElapsedTime = currentTime2 - donutStartTime;
      const donutTotalDuration = 90 * 20;
      const donutRemainingTime = Math.max(0, donutTotalDuration - donutElapsedTime);
      const donutRemainingSeconds = Math.ceil(donutRemainingTime / 20);
      if (donutRemainingSeconds > 0) {
        const donutColor = this.getCountdownColor(donutRemainingSeconds, 90);
        const donutThemeColor = "\xA7d";
        const donutProgressBar = this.createCountdownBarForDuration(
          donutRemainingSeconds,
          90,
          donutThemeColor
        );
        const donutTimeDisplay = this.formatTime(donutRemainingSeconds, 90);
        activeSuperPowers.push(
          `${donutThemeColor}\xA7l[Sweet Tooth] ${donutProgressBar} ${donutColor}${donutTimeDisplay}`
        );
      }
    }
    if (activeSuperPowers.length > 0) {
      const message = activeSuperPowers.join(" \xA78| ");
      this.queueMessage(player, message, 3 /* SUPER_POWER */);
    } else {
      const existing = this.messageQueue.get(player.id);
      if (existing && existing.priority === 3 /* SUPER_POWER */) {
        this.messageQueue.delete(player.id);
        player.onScreenDisplay.setActionBar("");
      }
    }
  }
  updateStackStatus(player, strategy) {
    const lastEatenTime = player.getDynamicProperty(strategy.lastEatenProperty) || 0;
    const currentTime = system8.currentTick;
    const stackTimeLeft = Math.max(
      0,
      strategy.stackTimeout - (currentTime - lastEatenTime)
    );
    const stackSecondsLeft = Math.ceil(stackTimeLeft / 20);
    const stackCount = player.getDynamicProperty(strategy.stackProperty) || 0;
    if (stackSecondsLeft > 0 && stackCount > 0) {
      let progressBar;
      if (strategy.itemTypeId.includes("candy")) {
        progressBar = this.createCandyProgressBar(stackCount, strategy.maxStack);
      } else {
        progressBar = strategy.theme.primaryColor + strategy.theme.progressSymbol.repeat(stackCount) + "\xA77" + strategy.theme.progressSymbol.repeat(strategy.maxStack - stackCount);
      }
      const effectName = this.getEffectName(strategy);
      const effect = player.getEffect(this.getEffectType(strategy));
      const effectTimeLeft = effect ? Math.ceil(effect.duration / 20) : 0;
      let message;
      if (effectTimeLeft > 0) {
        message = `${strategy.theme.primaryColor}[${strategy.theme.name.toUpperCase()}] ${progressBar} \xA7f${stackCount}/${strategy.maxStack} \xA77${effectName}: ${effectTimeLeft}s`;
      } else {
        message = `${strategy.theme.primaryColor}[${strategy.theme.name.toUpperCase()}] ${progressBar} \xA7f${stackCount}/${strategy.maxStack} \xA77Stack: ${stackSecondsLeft}s`;
      }
      this.queueMessage(player, message, 2 /* STACK */);
    } else {
      this.clearStackMessages(player);
    }
  }
  // Creates a repeating yellow/red progress bar for candy
  createCandyProgressBar(count, max) {
    let filled = "";
    let unfilled = "";
    for (let i = 0; i < max; i++) {
      if (i < count) {
        filled += i % 2 === 0 ? "\xA7e\u2588" : "\xA7c\u2588";
      } else {
        unfilled += "\xA77\u2588";
      }
    }
    return filled + unfilled;
  }
  getEffectName(strategy) {
    if (strategy.itemTypeId.includes("candy")) {
      return "Speed";
    } else if (strategy.itemTypeId.includes("donut")) {
      return "Regen";
    }
    return "Effect";
  }
  getEffectType(strategy) {
    if (strategy.itemTypeId.includes("candy")) {
      return "speed";
    } else if (strategy.itemTypeId.includes("donut")) {
      return "regeneration";
    }
    return "speed";
  }
  /**
   * Generates a string representing the super power symbols or message based on the strategy and stack count.
   *
   * @param strategy - The stack item strategy containing configuration details.
   * @param stackCount - The current stack count for the item.
   * @returns A string representing the visual symbols or message associated with the super power activation.
   *          - For "donut" items, returns a visual representation of hearts based on the stack count.
   *          - For "candy" items, returns a block breaking mode activation message.
   *          - Returns an empty string for other item types.
   */
  getSuperPowerSymbols(strategy, stackCount) {
    if (strategy.itemTypeId.includes("donut")) {
      return stackCount === 4 ? "\u2588\u2588" : "\u2588\u2588\u2588\u2588\u2588";
    } else if (strategy.itemTypeId.includes("candy")) {
      return stackCount === 4 ? "\u2588\u2588" : "\u2588\u2588\u2588\u2588\u2588";
    }
    return "";
  }
  /**
   * Determines the color code for the countdown based on the remaining time.
   *
   * @param remainingSeconds - The number of seconds remaining in the countdown.
   * @param totalDuration - The total duration of the countdown in seconds.
   * @returns A color code string where:
   *          - "§c" is returned if the remaining time is less than or equal to 10% of the total duration.
   *          - "§e" is returned if the remaining time is less than or equal to 30% of the total duration.
   *          - "§a" is returned for all other cases.
   */
  getCountdownColor(remainingSeconds, totalDuration) {
    const percentage = remainingSeconds / totalDuration;
    if (percentage <= 0.1)
      return "\xA7c";
    if (percentage <= 0.3)
      return "\xA7e";
    return "\xA7a";
  }
  /**
   * Creates a visual countdown bar representation for a given duration.
   *
   * @param remainingSeconds - The remaining seconds for the countdown.
   * @param totalDuration - The total duration of the countdown in seconds.
   * @param color - The color code for the active part of the countdown bar.
   * @returns A string representing the countdown bar with color-coded segments.
   */
  createCountdownBarForDuration(remainingSeconds, totalDuration, color) {
    const maxBars = 6;
    const barCount = Math.min(
      maxBars,
      Math.ceil(remainingSeconds / totalDuration * maxBars)
    );
    return color + "\u2588".repeat(barCount) + "\xA77" + "\u2588".repeat(maxBars - barCount);
  }
  formatTime(remainingSeconds, totalDuration) {
    if (totalDuration >= 60) {
      const minutes = Math.floor(remainingSeconds / 60);
      const seconds = remainingSeconds % 60;
      return `${minutes}:${seconds.toString().padStart(2, "0")}`;
    } else {
      return `${remainingSeconds}s`;
    }
  }
  showBubbleCharging(player, chargeLevel, maxCharge, bubbleType) {
    const progress = Math.min(chargeLevel / maxCharge, 1);
    const maxBars = 8;
    const filledBars = Math.floor(progress * maxBars);
    const progressBar = "\xA7b\u2588".repeat(filledBars) + "\xA77\u2588".repeat(maxBars - filledBars);
    const typeColor = bubbleType === "SMALL" ? "\xA7a" : bubbleType === "MEDIUM" ? "\xA7e" : "\xA7c";
    const typeDisplay = `${typeColor}${bubbleType}`;
    const message = `\xA7b\xA7lCharging Bubble: ${progressBar} \xA7f${Math.floor(
      progress * 100
    )}% \xA77| ${typeDisplay}`;
    this.queueMessage(player, message, 0 /* ITEM */);
  }
  showBubbleShot(player, bubbleType, chargePercentage) {
    const typeColor = bubbleType === "SMALL" ? "\xA7a" : bubbleType === "MEDIUM" ? "\xA7e" : "\xA7c";
    const message = `\xA7b\xA7lBubble Shot: ${typeColor}${bubbleType} \xA77(${chargePercentage}% charge)`;
    this.queueMessage(player, message, 0 /* ITEM */);
    system8.runTimeout(() => {
      const currentMessage = this.messageQueue.get(player.id);
      if (currentMessage && currentMessage.message === message) {
        this.messageQueue.delete(player.id);
      }
    }, 40);
  }
  clearBubbleMessages(player) {
    const existingMessage = this.messageQueue.get(player.id);
    if (existingMessage && existingMessage.priority === 0 /* ITEM */) {
      this.messageQueue.delete(player.id);
    }
  }
};
_ActionBarManager._instance = null;
var ActionBarManager = _ActionBarManager;

// data/gametests/src/items/food/EatStackItemsManager.ts
var EatStackItemsManager = class {
  constructor() {
    this.superPowerTimerStart = 0;
    this.EatStackItemsStrategies = /* @__PURE__ */ new Map();
    this.actionBarManager = ActionBarManager.getInstance();
    this.setupEventListeners();
    this.startUpdateLoop();
    this.startCleanupLoop();
    this.setupDeathListener();
  }
  setupDeathListener() {
    world8.afterEvents.entityDie.subscribe((event) => {
      const player = event.deadEntity;
      if (!(player instanceof Player4))
        return;
      for (const strategy of this.EatStackItemsStrategies.values()) {
        player.setDynamicProperty(strategy.stackProperty, 0);
        player.setDynamicProperty(strategy.lastEatenProperty, 0);
        player.setDynamicProperty(`mco_nom:${strategy.theme.name.toLowerCase()}_eaten`, false);
        const isSuperPowerActive = player.getDynamicProperty(
          strategy.superPowerModeProperty
        );
        if (isSuperPowerActive) {
          this.disableSuperPower(player, strategy);
        }
      }
      this.actionBarManager.clearAllMessages(player);
    });
    world8.afterEvents.itemCompleteUse.subscribe((eventData) => {
      const item = eventData.itemStack;
      const player = eventData.source;
      if (!(player instanceof Player4))
        return;
      if (item.typeId === "minecraft:milk_bucket") {
        for (const strategy of this.EatStackItemsStrategies.values()) {
          player.setDynamicProperty(strategy.stackProperty, 0);
          player.setDynamicProperty(strategy.lastEatenProperty, 0);
          player.setDynamicProperty(`mco_nom:${strategy.theme.name.toLowerCase()}_eaten`, false);
          const isSuperPowerActive = player.getDynamicProperty(
            strategy.superPowerModeProperty
          );
          if (isSuperPowerActive) {
            this.disableSuperPower(player, strategy);
          }
        }
        this.actionBarManager.clearAllMessages(player);
      }
    });
  }
  registerStrategy(strategy) {
    this.EatStackItemsStrategies.set(strategy.itemTypeId, strategy);
  }
  setupEventListeners() {
    world8.afterEvents.itemCompleteUse.subscribe((eventData) => {
      const item = eventData.itemStack;
      const player = eventData.source;
      const strategy = this.EatStackItemsStrategies.get(item.typeId);
      if (strategy) {
        this.handleItemConsumption(player, strategy);
      }
    });
  }
  handleItemConsumption(player, strategy) {
    const currentTime = system9.currentTick;
    const lastEatenTime = player.getDynamicProperty(strategy.lastEatenProperty) || 0;
    const currentStack = player.getDynamicProperty(strategy.stackProperty) || 0;
    let newStackCount;
    if (currentTime - lastEatenTime <= strategy.stackTimeout) {
      newStackCount = Math.min(currentStack + 1, strategy.maxStack);
    } else {
      newStackCount = 1;
    }
    player.setDynamicProperty(strategy.stackProperty, newStackCount);
    player.setDynamicProperty(strategy.lastEatenProperty, currentTime);
    player.setDynamicProperty(`mco_nom:${strategy.theme.name.toLowerCase()}_eaten`, true);
    this.applyEffects(player, strategy, newStackCount);
    this.actionBarManager.showStackFeedback(player, strategy, newStackCount);
  }
  applyEffects(player, strategy, stackCount) {
    const effectConfig = strategy.effects[stackCount];
    if (!effectConfig)
      return;
    strategy.applyStackEffect(player, stackCount, effectConfig);
    if (stackCount >= strategy.superPower.threshold) {
      this.enableSuperPower(player, strategy, stackCount);
    }
  }
  enableSuperPower(player, strategy, stackCount) {
    const currentTime = system9.currentTick;
    player.setDynamicProperty(strategy.superPowerModeProperty, true);
    player.setDynamicProperty(strategy.superPowerStartTimeProperty, currentTime);
    strategy.applySuperPower(player, stackCount);
    try {
      this.actionBarManager.updateSuperPowerCountdown(player, strategy);
    } catch {
    }
  }
  disableSuperPower(player, strategy) {
    player.setDynamicProperty(strategy.superPowerModeProperty, false);
    player.setDynamicProperty(strategy.superPowerStartTimeProperty, 0);
    player.playSound("mco_nom.power_up_disable" /* McoNomPowerUpDisable */, {
      pitch: 0.9 + Math.random() * 0.2,
      // [0.9, 1.1]
      volume: 0.8
    });
    strategy.onSuperPowerEnd(player);
  }
  /**
   * Clear stack state and super powers for a player. Safe to call at minigame start.
   */
  clearPlayerState(player) {
    try {
      for (const strategy of this.EatStackItemsStrategies.values()) {
        const isSuperPowerActive = player.getDynamicProperty(strategy.superPowerModeProperty);
        if (isSuperPowerActive) {
          try {
            this.disableSuperPower(player, strategy);
          } catch {
          }
        }
        try {
          player.setDynamicProperty(strategy.stackProperty, 0);
          player.setDynamicProperty(strategy.lastEatenProperty, 0);
          player.setDynamicProperty(strategy.superPowerModeProperty, false);
          player.setDynamicProperty(strategy.superPowerStartTimeProperty, 0);
          player.setDynamicProperty(`mco_nom:${strategy.theme.name.toLowerCase()}_eaten`, false);
        } catch {
        }
      }
      try {
        player.removeEffect("speed");
      } catch {
      }
      try {
        player.removeEffect("regeneration");
      } catch {
      }
      try {
        player.removeEffect("absorption");
      } catch {
      }
      try {
        this.actionBarManager.clearAllMessages(player);
      } catch {
      }
    } catch (err) {
    }
  }
  startUpdateLoop() {
    system9.runInterval(() => {
      for (const player of world8.getAllPlayers()) {
        for (const strategy of this.EatStackItemsStrategies.values()) {
          this.updatePlayerStatus(player, strategy);
        }
      }
    }, 10);
    system9.runInterval(() => {
      for (const player of world8.getAllPlayers()) {
        for (const strategy of this.EatStackItemsStrategies.values()) {
          this.updatePlayerPowerUp(player, strategy);
        }
      }
    });
  }
  updatePlayerStatus(player, strategy) {
    const isSuperPowerActive = player.getDynamicProperty(strategy.superPowerModeProperty);
    const stackCount = player.getDynamicProperty(strategy.stackProperty) || 0;
    const powerStartTime = player.getDynamicProperty(strategy.superPowerStartTimeProperty) || 0;
    if (isSuperPowerActive) {
      this.actionBarManager.updateSuperPowerCountdown(player, strategy);
      const now = system9.currentTick;
      if (now - powerStartTime > strategy.superPower.duration * 20) {
        this.disableSuperPower(player, strategy);
      }
    } else if (stackCount > 0) {
      this.actionBarManager.updateStackStatus(player, strategy);
    } else {
      this.actionBarManager.updateStackStatus(player, strategy);
    }
  }
  updatePlayerPowerUp(player, strategy) {
    if (strategy.updateSuperPower) {
      strategy.updateSuperPower(player);
    }
  }
  startCleanupLoop() {
    system9.runInterval(() => {
      const currentTime = system9.currentTick;
      for (const player of world8.getAllPlayers()) {
        for (const strategy of this.EatStackItemsStrategies.values()) {
          this.cleanupExpiredStack(player, strategy, currentTime);
        }
      }
    }, 20);
  }
  cleanupExpiredStack(player, strategy, currentTime) {
    const lastEatenTime = player.getDynamicProperty(strategy.lastEatenProperty) || 0;
    const currentStack = player.getDynamicProperty(strategy.stackProperty) || 0;
    const isSuperPowerActive = player.getDynamicProperty(strategy.superPowerModeProperty);
    if (currentStack > 0 && currentTime - lastEatenTime > strategy.stackTimeout) {
      player.setDynamicProperty(strategy.stackProperty, 0);
      if (!isSuperPowerActive) {
        player.setDynamicProperty(strategy.superPowerModeProperty, false);
        player.setDynamicProperty(strategy.superPowerStartTimeProperty, 0);
      }
    }
  }
};
var eatStackItemsManager = new EatStackItemsManager();

// data/gametests/src/items/food/EatStackItemsStrategies/candyStrategy.ts
import { system as system10 } from "@minecraft/server";
var distanceSqr = /* @__PURE__ */ new Map();
var sugarRushAuraIntervals = /* @__PURE__ */ new Map();
var candyStrategy = {
  // Basic config
  itemTypeId: "mco_nom:candy",
  stackTimeout: 10 * 20,
  // 10 seconds in ticks
  maxStack: 5,
  // Dynamic property keys
  stackProperty: "mco_nom:candy_stack_count",
  lastEatenProperty: "mco_nom:candy_last_eaten",
  superPowerModeProperty: "mco_nom:candy_break_mode",
  superPowerStartTimeProperty: "mco_nom:candy_break_mode_start_time",
  // Effects configuration
  effects: {
    1: { amplifier: 0, duration: 4 },
    2: { amplifier: 1, duration: 8 },
    3: { amplifier: 2, duration: 12 },
    4: { amplifier: 3, duration: 15 },
    5: { amplifier: 4, duration: 18 }
  },
  // Super power configuration
  superPower: {
    threshold: 5,
    duration: 18,
    // matches level 5 speed duration
    name: "Sugar Rush",
    activationMessage: "Sugar Rush activated!",
    deactivationMessage: "Sugar Rush deactivated!"
  },
  // Display theme
  theme: {
    primaryColor: "\xA76",
    // Gold
    secondaryColor: "\xA7a",
    // Green
    progressSymbol: "\xA7c\u2588\xA7e\u2588",
    // Candy-themed progress bar
    name: "Candy"
  },
  // Apply speed effect
  applyStackEffect: (player, stackCount, config) => {
    const volume = 0.5;
    const volumeIncrement = 0;
    switch (stackCount) {
      case 1:
        player.playSound("mco_nom.candy_item.stack_1" /* McoNomCandyItemStack1 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 2:
        player.playSound("mco_nom.candy_item.stack_2" /* McoNomCandyItemStack2 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 3:
        player.playSound("mco_nom.candy_item.stack_3" /* McoNomCandyItemStack3 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 4:
        player.playSound("mco_nom.candy_item.stack_4" /* McoNomCandyItemStack4 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 5:
        player.playSound("mco_nom.candy_item.stack_5" /* McoNomCandyItemStack5 */, {
          volume: volume + volumeIncrement
        });
        break;
      default:
        player.playSound("mco_nom.candy_item.stack_1" /* McoNomCandyItemStack1 */, {
          volume: volume + volumeIncrement
        });
        break;
    }
    if (player.getEffect("speed")) {
      player.removeEffect("speed");
    }
    player.addEffect("speed", config.duration * 20, {
      amplifier: config.amplifier,
      showParticles: false
    });
  },
  // Apply sugar rush (block breaking mode)
  applySuperPower: (player, stackCount) => {
    player.setDynamicProperty("mco_nom:candy_last_position", {
      x: player.location.x,
      y: player.location.y,
      z: player.location.z
    });
    try {
      player.dimension.spawnParticle("mco_nom:sugar_rush_activate" /* SugarRushActivate */, player.location);
    } catch (error2) {
      "Failed to spawn SugarRush activation particle:", error2;
    }
    const intervalId = system10.runInterval(() => {
      try {
        const isSuperPowerActive = player.getDynamicProperty("mco_nom:candy_break_mode");
        if (!isSuperPowerActive) {
          const id = sugarRushAuraIntervals.get(player.id);
          if (id !== void 0) {
            system10.clearRun(id);
            sugarRushAuraIntervals.delete(player.id);
          }
          return;
        }
        player.dimension.spawnParticle("mco_nom:sugar_rush" /* SugarRush */, player.location);
      } catch (error2) {
        const id = sugarRushAuraIntervals.get(player.id);
        if (id !== void 0) {
          system10.clearRun(id);
          sugarRushAuraIntervals.delete(player.id);
        }
      }
    }, 10);
    sugarRushAuraIntervals.set(player.id, intervalId);
  },
  // Update sugar rush (handle block breaking)
  updateSuperPower: (player) => {
    const isBreakModeActive = player.getDynamicProperty(
      "mco_nom:candy_break_mode"
    );
    if (!isBreakModeActive)
      return;
    const speedEffect = player.getEffect("speed");
    if (!speedEffect || speedEffect.amplifier < 4) {
      return;
    }
    breakBlocksAhead(player);
    const dx = player.location.x - prevLocation.x;
    const dz = player.location.z - prevLocation.z;
    distanceSqr.set(player.id, dx * dx + dz * dz);
    if ((distanceSqr.get(player.id) ?? 0) >= 2 && player.isOnGround) {
      prevLocation = player.location;
      player.dimension.playSound("mco_nom.candy_item.run" /* McoNomCandyItemRun */, player.location, {
        volume: 0.5,
        pitch: 0.8 + Math.random() * 0.4
        // [0.8, 1.2]
      });
    }
  },
  // Clean up when super power ends
  onSuperPowerEnd: (player) => {
    player.setDynamicProperty("mco_nom:candy_last_position", void 0);
    const intervalId = sugarRushAuraIntervals.get(player.id);
    if (intervalId !== void 0) {
      system10.clearRun(intervalId);
      sugarRushAuraIntervals.delete(player.id);
    }
  }
};
var prevLocation = { x: 0, y: 0, z: 0 };
var blocksBeenDestroyed = false;
function isWood(block) {
  return block.hasTag?.("log") || block.typeId.includes("log") || block.typeId.includes("stem");
}
function isStoneBlock(block) {
  return block.hasTag?.("stone") || block.typeId.includes("stone");
}
var BREAKABLE_BLOCKS = [
  // Grass and dirt
  "minecraft:grass_block",
  "minecraft:grass_path",
  "minecraft:dirt",
  "minecraft:coarse_dirt",
  "minecraft:podzol",
  "minecraft:mycelium",
  "minecraft:sand",
  "minecraft:red_sand",
  // Plants
  "minecraft:grass",
  "minecraft:tall_grass",
  "minecraft:short_grass",
  "minecraft:fern",
  "minecraft:large_fern",
  "minecraft:dead_bush",
  // Flowers
  "minecraft:poppy",
  "minecraft:dandelion",
  "minecraft:blue_orchid",
  "minecraft:allium",
  "minecraft:azure_bluet",
  "minecraft:red_tulip",
  "minecraft:orange_tulip",
  "minecraft:white_tulip",
  "minecraft:pink_tulip",
  "minecraft:oxeye_daisy",
  "minecraft:cornflower",
  "minecraft:lily_of_the_valley",
  "minecraft:wither_rose",
  // Tall flowers
  "minecraft:sunflower",
  "minecraft:lilac",
  "minecraft:rose_bush",
  "minecraft:peony",
  "minecraft:bush",
  "minecraft:firefly_bush",
  // Saplings
  "minecraft:oak_sapling",
  "minecraft:birch_sapling",
  "minecraft:spruce_sapling",
  "minecraft:jungle_sapling",
  "minecraft:acacia_sapling",
  "minecraft:dark_oak_sapling",
  // Mushrooms
  "minecraft:brown_mushroom",
  "minecraft:red_mushroom",
  // Crops
  "minecraft:wheat",
  "minecraft:carrots",
  "minecraft:potatoes",
  "minecraft:beetroots",
  "minecraft:sweet_berry_bush",
  // Others
  "minecraft:cactus",
  "minecraft:sugar_cane",
  "minecraft:bamboo",
  "minecraft:kelp",
  "minecraft:vine",
  "minecraft:nether_wart",
  "minecraft:lily_pad",
  "minecraft:seagrass",
  "minecraft:sea_pickle",
  // Snow
  "minecraft:snow",
  "minecraft:snow_block",
  "minecraft:snow_layer",
  // Clay
  "minecraft:clay",
  // Web
  "minecraft:cobweb",
  // Leaves
  "minecraft:oak_leaves",
  "minecraft:spruce_leaves",
  "minecraft:birch_leaves",
  "minecraft:jungle_leaves",
  "minecraft:acacia_leaves",
  "minecraft:dark_oak_leaves",
  "minecraft:mangrove_leaves",
  "minecraft:cherry_leaves",
  "minecraft:azalea_leaves",
  "minecraft:flowering_azalea_leaves",
  // Fungi
  "minecraft:warped_fungus",
  "minecraft:crimson_fungus",
  "minecraft:nether_sprouts",
  "minecraft:weeping_vines",
  "minecraft:twisting_vines",
  // Gravel
  "minecraft:gravel",
  // Nether blocks
  "minecraft:netherrack",
  "minecraft:soul_sand",
  "minecraft:soul_soil",
  "minecraft:blackstone",
  "minecraft:basalt",
  "minecraft:polished_basalt",
  // Mud
  "minecraft:mud",
  "minecraft:packed_mud",
  // Petals
  "minecraft:pink_petals",
  // Concrete powder
  "minecraft:white_concrete_powder",
  "minecraft:orange_concrete_powder",
  "minecraft:magenta_concrete_powder",
  "minecraft:light_blue_concrete_powder",
  "minecraft:yellow_concrete_powder",
  "minecraft:lime_concrete_powder",
  "minecraft:pink_concrete_powder",
  "minecraft:gray_concrete_powder",
  "minecraft:light_gray_concrete_powder",
  "minecraft:cyan_concrete_powder",
  "minecraft:purple_concrete_powder",
  "minecraft:blue_concrete_powder",
  "minecraft:brown_concrete_powder",
  "minecraft:green_concrete_powder",
  "minecraft:red_concrete_powder",
  "minecraft:black_concrete_powder",
  // Misc Ground cover
  "minecraft:leaf_litter",
  "minecraft:wildflowers",
  // Sculk
  "minecraft:sculk_vein",
  "minecraft:sculk",
  "minecraft:sculk_sensor"
];
function breakBlocksAhead(player) {
  const SIDE_RANGE = 1;
  const HEIGHT = 4;
  const viewDirection = player.getViewDirection();
  const playerLocation = player.location;
  const forwardX = Math.round(viewDirection.x);
  const forwardZ = Math.round(viewDirection.z);
  const ahead = {
    x: playerLocation.x + forwardX,
    y: Math.floor(playerLocation.y),
    z: playerLocation.z + forwardZ
  };
  let sideAxis;
  if (Math.abs(viewDirection.x) > Math.abs(viewDirection.z)) {
    sideAxis = "z";
  } else {
    sideAxis = "x";
  }
  let wasKnockbackApplied = false;
  const baseX = Math.floor(ahead.x);
  const baseZ = Math.floor(ahead.z);
  const baseY = ahead.y | 0;
  const view = player.getViewDirection();
  const knockVec = { x: -view.x * 2, z: -view.z * 2 };
  const knockVertical = 0.3;
  const varyX = sideAxis === "x";
  for (let side = -SIDE_RANGE; side <= SIDE_RANGE; side++) {
    const colX = varyX ? baseX + side : baseX;
    const colZ = varyX ? baseZ : baseZ + side;
    for (let yOffset = 0; yOffset < HEIGHT; yOffset++) {
      const blockLocation = {
        x: colX,
        y: baseY + yOffset,
        z: colZ
      };
      try {
        const block = player.dimension.getBlock(blockLocation);
        if (!block)
          continue;
        if (block.isAir || block.isLiquid)
          continue;
        const isTree = isWood(block);
        const isStone = isStoneBlock(block);
        const isBreakable = BREAKABLE_BLOCKS.includes(block.typeId);
        if (!wasKnockbackApplied && (isTree || isStone || !isBreakable)) {
          try {
            player.applyKnockback(knockVec, knockVertical);
          } catch {
          }
          try {
            player.playSound("mco_nom.candy_item.hit_tree" /* McoNomCandyItemHitTree */, {
              volume: 0.5,
              pitch: 0.8 + Math.random() * 0.4
            });
          } catch {
          }
          wasKnockbackApplied = true;
        }
        if (isTree || isStone || isBreakable) {
          try {
            block.setType("minecraft:air");
          } catch {
          }
          blocksBeenDestroyed = true;
        }
      } catch {
        continue;
      }
    }
  }
}

// data/gametests/src/items/food/EatStackItemsStrategies/donutStrategy.ts
import { system as system11 } from "@minecraft/server";
var sweetToothAuraIntervals = /* @__PURE__ */ new Map();
var donutStrategy = {
  // Basic config
  itemTypeId: "mco_nom:donut",
  stackTimeout: 10 * 20,
  // 30 seconds in ticks
  maxStack: 5,
  // Dynamic property keys
  stackProperty: "mco_nom:donut_stack_count",
  lastEatenProperty: "mco_nom:donut_last_eaten",
  superPowerModeProperty: "mco_nom:donut_sweet_tooth_mode",
  superPowerStartTimeProperty: "mco_nom:donut_sweet_tooth_start_time",
  // Effects configuration
  effects: {
    1: { amplifier: 0, duration: 30 },
    2: { amplifier: 1, duration: 45 },
    3: { amplifier: 2, duration: 60 },
    4: { amplifier: 3, duration: 75 },
    5: { amplifier: 4, duration: 90 }
  },
  // Super power configuration
  superPower: {
    threshold: 4,
    duration: 90,
    // 1.5 minutes
    name: "Sweet Tooth",
    activationMessage: "Extra hearts for 1.5 minutes!",
    deactivationMessage: "Extra hearts will no longer regenerate"
  },
  // Display theme
  theme: {
    primaryColor: "\xA7d",
    // Light purple/magenta
    secondaryColor: "\xA76",
    // Gold for super power
    progressSymbol: "\u2588\u2588",
    name: "Donut"
  },
  // Apply regeneration effect
  applyStackEffect: (player, stackCount, config) => {
    const volume = 0.55;
    const volumeIncrement = 0;
    switch (stackCount) {
      case 1:
        player.playSound("mco_nom.donut_item.stack_1" /* McoNomDonutItemStack1 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 2:
        player.playSound("mco_nom.donut_item.stack_2" /* McoNomDonutItemStack2 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 3:
        player.playSound("mco_nom.donut_item.stack_3" /* McoNomDonutItemStack3 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 4:
        player.playSound("mco_nom.donut_item.stack_4" /* McoNomDonutItemStack4 */, {
          volume: volume + volumeIncrement
        });
        break;
      case 5:
        player.playSound("mco_nom.donut_item.stack_5" /* McoNomDonutItemStack5 */, {
          volume: volume + volumeIncrement
        });
        break;
      default:
        player.playSound("mco_nom.donut_item.stack_1" /* McoNomDonutItemStack1 */, {
          volume: volume + volumeIncrement
        });
        break;
    }
    if (player.getEffect("regeneration")) {
      player.removeEffect("regeneration");
    }
    player.addEffect("regeneration", config.duration * 20, {
      amplifier: config.amplifier,
      showParticles: false
    });
  },
  // Apply sweet tooth (absorption hearts)
  applySuperPower: (player, stackCount) => {
    const absorptionHearts = stackCount === 4 ? 4 : 10;
    const absorptionDuration = 90;
    if (player.getEffect("absorption")) {
      player.removeEffect("absorption");
    }
    player.addEffect("absorption", absorptionDuration * 20, {
      amplifier: absorptionHearts === 4 ? 1 : 4,
      // 4th stack = 1, 5th stack = 4
      showParticles: false
    });
    try {
      player.dimension.spawnParticle("mco_nom:sweet_tooth_activate" /* SweetToothActivate */, player.location);
    } catch (error2) {
      "Failed to spawn SweetTooth activation particle:", error2;
    }
    const intervalId = system11.runInterval(() => {
      try {
        const isSuperPowerActive = player.getDynamicProperty("mco_nom:donut_sweet_tooth_mode");
        if (!isSuperPowerActive) {
          const id = sweetToothAuraIntervals.get(player.id);
          if (id !== void 0) {
            system11.clearRun(id);
            sweetToothAuraIntervals.delete(player.id);
          }
          return;
        }
        player.dimension.spawnParticle("mco_nom:sweet_tooth" /* SweetTooth */, player.location);
      } catch (error2) {
        const id = sweetToothAuraIntervals.get(player.id);
        if (id !== void 0) {
          system11.clearRun(id);
          sweetToothAuraIntervals.delete(player.id);
        }
      }
    }, 10);
    sweetToothAuraIntervals.set(player.id, intervalId);
  },
  // No ongoing update needed for donuts (unlike candy's block breaking)
  updateSuperPower: void 0,
  // Clean up when super power ends
  onSuperPowerEnd: (player) => {
    const intervalId = sweetToothAuraIntervals.get(player.id);
    if (intervalId !== void 0) {
      system11.clearRun(intervalId);
      sweetToothAuraIntervals.delete(player.id);
    }
  }
};

// data/gametests/src/items/systems/durability.ts
import { world as world10, GameMode, EquipmentSlot as EquipmentSlot2 } from "@minecraft/server";
var toolTypeIds = [
  "mco_nom:candy_axe",
  "mco_nom:candy_pickaxe",
  "mco_nom:candy_hoe",
  "mco_nom:candy_sword",
  "mco_nom:candy_shovel"
];
world10.afterEvents.playerBreakBlock.subscribe((evd) => {
  const { player, itemStackBeforeBreak: itemUsed } = evd;
  if (!itemUsed || player.matches({ gameMode: GameMode.Creative }))
    return;
  if (toolTypeIds.includes(itemUsed.typeId)) {
    handleDurabilityDamage(player, itemUsed);
  }
});
world10.afterEvents.playerInteractWithBlock.subscribe((evd) => {
  const { player, itemStack: itemUsed } = evd;
  if (!itemUsed || player.matches({ gameMode: GameMode.Creative }))
    return;
  if (toolTypeIds.includes(itemUsed.typeId)) {
    handleDurabilityDamage(player, itemUsed);
  }
});
function handleDurabilityDamage(player, itemUsed) {
  const playerEquippableComp = player.getComponent("equippable");
  if (!playerEquippableComp)
    return;
  const itemEnchantmentComp = itemUsed.getComponent("minecraft:enchantable");
  const unbreakingLevel = itemEnchantmentComp?.getEnchantment("unbreaking")?.level ?? 0;
  const breakChance = 100 / (unbreakingLevel + 1);
  const randomizeChance = Math.random() * 100;
  if (breakChance < randomizeChance)
    return;
  const itemUsedDurabilityComp = itemUsed.getComponent("durability");
  if (!itemUsedDurabilityComp)
    return;
  const durabilityModifier = 1;
  itemUsedDurabilityComp.damage += durabilityModifier;
  const maxDurability = itemUsedDurabilityComp.maxDurability;
  const currentDamage = itemUsedDurabilityComp.damage;
  if (currentDamage >= maxDurability) {
    player.playSound("mco_nom.candy_tools.tool_break" /* McoNomCandyToolsToolBreak */, { pitch: 0.9, location: player.location, volume: 0.8 });
    playerEquippableComp.setEquipment(EquipmentSlot2.Mainhand);
  } else if (currentDamage < maxDurability) {
    playerEquippableComp.setEquipment(EquipmentSlot2.Mainhand, itemUsed);
  }
}

// data/gametests/src/items/tools/ToolsItemManager.ts
import { world as world11, ItemStack as ItemStack3, GameMode as GameMode2, system as system12 } from "@minecraft/server";

// data/gametests/src/items/tools/SOUNDS_func.ts
function playBlockBreakSound(player, block, blockType, isChunkMining, isWoodBlockType, isOreBlockType) {
  let sound = "";
  let pitch = 0.8 + Math.random() * 0.2;
  let volume = 0.2;
  if (isWoodBlockType(blockType)) {
    sound = "dig.wood";
    volume = 0.35;
  } else if (blockType.includes("stone")) {
    sound = "dig.stone";
  } else if (blockType.includes("deepslate_bricks")) {
    sound = "dig.deepslate_bricks";
  } else if (blockType.includes("deepslate")) {
    sound = "dig.deepslate";
  } else if (blockType.includes("tuff")) {
    sound = "break.tuff";
  } else if (blockType === "minecraft:netherrack") {
    sound = "dig.netherrack";
  } else if (blockType.includes("nylium")) {
    sound = "dig.nylium";
  } else if (isOreBlockType(blockType)) {
    sound = "dig.stone";
  } else if (blockType.includes("dirt") || blockType.includes("gravel") || blockType === "clay" || blockType.includes("podzol") || blockType.includes("mycelium") || blockType.includes("farmland")) {
    sound = "dig.gravel";
    volume = 0.15;
  } else if (blockType.includes("grass")) {
    sound = "dig.grass";
    volume = 0.15;
  } else if (blockType.includes("sand") || blockType.includes("concrete_powder")) {
    if (blockType.includes("soul")) {
      sound = "dig.soul_sand";
    } else if (blockType.includes("suspicious")) {
      sound = "break.suspicious_sand";
    } else if (blockType.includes("sandstone")) {
      sound = "dig.stone";
    } else {
      sound = "dig.sand";
    }
  } else if (blockType.includes("snow")) {
    sound = "dig.snow";
    volume = 0.25;
  } else if (blockType.includes("soul_soil")) {
    sound = "dig.soul_soil";
  } else if (blockType === "minecraft:mud") {
    sound = "block.mud.break";
  } else if (blockType === "minecraft:muddy_mangrove_roots") {
    sound = "block.muddy_mangrove_roots.break";
  } else {
    sound = "dig.stone";
  }
  try {
    player.dimension.playSound(sound, block.center(), {
      pitch,
      volume
    });
  } catch (error2) {
    player.playSound("dig.stone", {
      pitch,
      location: block.center(),
      volume
    });
  }
}

// data/gametests/src/items/tools/ToolsItemManager.ts
var CandyToolsManager = class _CandyToolsManager {
  constructor() {
    this.activeProcesses = /* @__PURE__ */ new Set();
    // Block type to drop item mapping for ore blocks
    this.blockData = /* @__PURE__ */ new Map([
      // Coal ores
      ["minecraft:coal_ore", { item: "minecraft:coal", amount: 1 }],
      ["minecraft:deepslate_coal_ore", { item: "minecraft:coal", amount: 1 }],
      // Iron ores
      ["minecraft:iron_ore", { item: "minecraft:raw_iron", amount: 1 }],
      ["minecraft:deepslate_iron_ore", { item: "minecraft:raw_iron", amount: 1 }],
      // Gold ores
      ["minecraft:gold_ore", { item: "minecraft:raw_gold", amount: 1 }],
      ["minecraft:deepslate_gold_ore", { item: "minecraft:raw_gold", amount: 1 }],
      ["minecraft:nether_gold_ore", { item: "minecraft:gold_nugget", amount: 3 }],
      // Diamond ores
      ["minecraft:diamond_ore", { item: "minecraft:diamond", amount: 1 }],
      ["minecraft:deepslate_diamond_ore", { item: "minecraft:diamond", amount: 1 }],
      // Emerald ores
      ["minecraft:emerald_ore", { item: "minecraft:emerald", amount: 1 }],
      ["minecraft:deepslate_emerald_ore", { item: "minecraft:emerald", amount: 1 }],
      // Lapis ores
      ["minecraft:lapis_ore", { item: "minecraft:lapis_lazuli", amount: 6 }],
      ["minecraft:deepslate_lapis_ore", { item: "minecraft:lapis_lazuli", amount: 6 }],
      // Redstone ores
      ["minecraft:redstone_ore", { item: "minecraft:redstone", amount: 5 }],
      ["minecraft:deepslate_redstone_ore", { item: "minecraft:redstone", amount: 5 }],
      // Copper ores
      ["minecraft:copper_ore", { item: "minecraft:raw_copper", amount: 3 }],
      ["minecraft:deepslate_copper_ore", { item: "minecraft:raw_copper", amount: 3 }],
      // Quartz ore
      ["minecraft:nether_quartz_ore", { item: "minecraft:quartz", amount: 1 }],
      // Ancient debris
      ["minecraft:ancient_debris", { item: "minecraft:ancient_debris", amount: 1 }],
      // Stone (should drop cobblestone)
      ["minecraft:stone", { item: "minecraft:cobblestone", amount: 1 }],
      ["minecraft:deepslate", { item: "minecraft:cobbled_deepslate", amount: 1 }],
      // Gravel (chance for flint)
      ["minecraft:gravel", {
        item: "minecraft:gravel",
        amount: 1,
        chance: { item: "minecraft:flint", amount: 1, probability: 0.1 }
      }],
      // Water and Lava (should not drop anything)
      ["minecraft:water", { item: "undefined", amount: 1 }],
      ["minecraft:lava", { item: "undefined", amount: 1 }],
      // Grass
      ["minecraft:grass_block", { item: "minecraft:dirt", amount: 1 }],
      // Plant (grass, flowers, etc.)
      ["minecraft:grass", { item: "undefined", amount: 1 }],
      ["minecraft:tall_grass", { item: "undefined", amount: 1 }],
      ["minecraft:short_grass", { item: "undefined", amount: 1 }],
      ["minecraft:fern", { item: "undefined", amount: 1 }],
      ["minecraft:large_fern", { item: "undefined", amount: 1 }],
      ["minecraft:dead_bush", { item: "minecraft:stick", amount: 1 }],
      // Common flowers
      ["minecraft:poppy", { item: "minecraft:poppy", amount: 1 }],
      ["minecraft:dandelion", { item: "minecraft:dandelion", amount: 1 }],
      ["minecraft:blue_orchid", { item: "minecraft:blue_orchid", amount: 1 }],
      ["minecraft:allium", { item: "minecraft:allium", amount: 1 }],
      ["minecraft:azure_bluet", { item: "minecraft:azure_bluet", amount: 1 }],
      ["minecraft:red_tulip", { item: "minecraft:red_tulip", amount: 1 }],
      ["minecraft:orange_tulip", { item: "minecraft:orange_tulip", amount: 1 }],
      ["minecraft:white_tulip", { item: "minecraft:white_tulip", amount: 1 }],
      ["minecraft:pink_tulip", { item: "minecraft:pink_tulip", amount: 1 }],
      ["minecraft:oxeye_daisy", { item: "minecraft:oxeye_daisy", amount: 1 }],
      ["minecraft:cornflower", { item: "minecraft:cornflower", amount: 1 }],
      ["minecraft:lily_of_the_valley", { item: "minecraft:lily_of_the_valley", amount: 1 }],
      // Tall flowers
      ["minecraft:sunflower", { item: "minecraft:sunflower", amount: 1 }],
      ["minecraft:lilac", { item: "minecraft:lilac", amount: 1 }],
      ["minecraft:rose_bush", { item: "minecraft:rose_bush", amount: 1 }],
      ["minecraft:peony", { item: "minecraft:peony", amount: 1 }],
      // Saplings
      ["minecraft:oak_sapling", { item: "minecraft:oak_sapling", amount: 1 }],
      ["minecraft:birch_sapling", { item: "minecraft:birch_sapling", amount: 1 }],
      ["minecraft:spruce_sapling", { item: "minecraft:spruce_sapling", amount: 1 }],
      ["minecraft:jungle_sapling", { item: "minecraft:jungle_sapling", amount: 1 }],
      ["minecraft:acacia_sapling", { item: "minecraft:acacia_sapling", amount: 1 }],
      ["minecraft:dark_oak_sapling", { item: "minecraft:dark_oak_sapling", amount: 1 }]
    ]);
    this.setupEventListeners();
  }
  static getInstance() {
    if (!_CandyToolsManager.instance) {
      _CandyToolsManager.instance = new _CandyToolsManager();
    }
    return _CandyToolsManager.instance;
  }
  setupEventListeners() {
    world11.beforeEvents.playerBreakBlock.subscribe((eventData) => {
      const { player, block, itemStack: tool } = eventData;
      if (!tool || player.matches({ gameMode: GameMode2.Creative }))
        return;
      switch (tool.typeId) {
        case "mco_nom:candy_axe":
          this.startTreeCapitator(player, block, tool);
          break;
        case "mco_nom:candy_pickaxe":
          if (this.isOreBlock(block)) {
            this.startVeinMiner(player, block, tool);
          } else if (this.isStoneBlock(block)) {
            this.startChunkMining(player, block, tool);
          }
          break;
        case "mco_nom:candy_shovel":
          if (this.isShovelBlock(block)) {
            this.startChunkMining(player, block, tool);
          }
          break;
      }
    });
    world11.beforeEvents.playerInteractWithBlock.subscribe((eventData) => {
      const { player, block, itemStack: tool } = eventData;
      if (!tool)
        return;
      if (tool.typeId === "mco_nom:candy_hoe" && block.above() && block.above()?.typeId === "minecraft:air") {
        this.startMassTilling(player, block, tool);
      } else if (tool.typeId === "mco_nom:candy_shovel" && block.typeId === "minecraft:grass_block" && block.above() && block.above()?.typeId === "minecraft:air") {
        system12.run(() => {
          player.dimension.playSound("use.grass", block.location, {
            pitch: 0.8
          });
        });
      } else if (tool.typeId === "mco_nom:candy_axe" && this.isStrippableBlock(block)) {
        let useSoundToPlay = "use.wood";
        switch (block.typeId) {
          case "minecraft:bamboo_block":
            useSoundToPlay = "step.bamboo_wood";
            break;
          case "minecraft:cherry_wood":
            useSoundToPlay = "step.cherry_wood";
            break;
          case "minecraft:crimson_stem":
            useSoundToPlay = "use.stem";
            break;
          case "minecraft:warped_stem":
            useSoundToPlay = "use.stem";
            break;
          case "minecraft:crimson_hyphae":
            useSoundToPlay = "use.stem";
            break;
          case "minecraft:warped_hyphae":
            useSoundToPlay = "use.stem";
            break;
          default:
            useSoundToPlay = "use.wood";
            break;
        }
        system12.run(() => {
          player.dimension.playSound(useSoundToPlay, block.location, {
            pitch: 0.8
          });
        });
      }
    });
  }
  // #region Block Filter
  isStrippableBlock(block) {
    const STRIPPABLE_BLOCKS = /* @__PURE__ */ new Set([
      "minecraft:oak_log",
      "minecraft:spruce_log",
      "minecraft:birch_log",
      "minecraft:jungle_log",
      "minecraft:acacia_log",
      "minecraft:dark_oak_log",
      "minecraft:mangrove_log",
      "minecraft:cherry_log",
      "minecraft:pale_oak_log",
      "minecraft:oak_wood",
      "minecraft:spruce_wood",
      "minecraft:birch_wood",
      "minecraft:jungle_wood",
      "minecraft:acacia_wood",
      "minecraft:dark_oak_wood",
      "minecraft:mangrove_wood",
      "minecraft:cherry_wood",
      "minecraft:pale_oak_wood",
      "minecraft:crimson_stem",
      "minecraft:warped_stem",
      "minecraft:crimson_hyphae",
      "minecraft:warped_hyphae",
      "minecraft:bamboo_block"
    ]);
    return STRIPPABLE_BLOCKS.has(block.typeId);
  }
  isWoodBlock(block) {
    return block.typeId.includes("log") || block.typeId.includes("stem") || block.typeId.includes("wood") || block.typeId === "minecraft:mushroom_stem";
  }
  isOreBlock(block) {
    return block.hasTag("ore") || block.hasTag("minecraft:coal_ores") || block.hasTag("minecraft:iron_ores") || block.hasTag("minecraft:gold_ores") || block.hasTag("minecraft:diamond_ores") || block.hasTag("minecraft:emerald_ores") || block.hasTag("minecraft:lapis_ores") || block.hasTag("minecraft:redstone_ores") || block.hasTag("minecraft:copper_ores") || block.typeId.includes("ore") || block.typeId === "minecraft:ancient_debris" || block.typeId === "minecraft:nether_quartz_ore";
  }
  isStoneBlock(block) {
    return block.typeId.includes("terracotta") || block.typeId === "minecraft:stone" || block.typeId === "minecraft:cobblestone" || block.typeId === "minecraft:deepslate" || block.typeId === "minecraft:cobbled_deepslate" || block.typeId === "minecraft:andesite" || block.typeId === "minecraft:granite" || block.typeId === "minecraft:diorite" || block.typeId === "minecraft:polished_andesite" || block.typeId === "minecraft:polished_granite" || block.typeId === "minecraft:polished_diorite" || block.typeId === "minecraft:tuff" || block.typeId === "minecraft:sandstone" || block.typeId === "minecraft:red_sandstone" || block.typeId === "minecraft:hardened_clay" || block.typeId === "minecraft:netherrack" || block.typeId === "minecraft:magma" || block.typeId === "minecraft:blackstone" || block.typeId === "minecraft:end_stone" || block.typeId.includes("nylium") || block.typeId === "minecraft:stone_bricks" || block.typeId === "minecraft:cracked_stone_bricks" || block.typeId === "minecraft:mossy_stone_bricks" || block.typeId === "minecraft:infested_stone" || block.typeId === "minecraft:infested_cobblestone" || block.typeId === "minecraft:infested_deepslate" || block.typeId === "minecraft:infested_stone_bricks" || block.typeId === "minecraft:infested_cracked_stone_bricks" || block.typeId === "minecraft:infested_mossy_stone_bricks" || block.typeId === "minecraft:infested_chiseled_stone_bricks";
  }
  isShovelBlock(block) {
    return block.typeId === "minecraft:dirt" || block.typeId === "minecraft:grass_block" || block.typeId === "minecraft:coarse_dirt" || block.typeId === "minecraft:grass_path" || block.typeId === "minecraft:rooted_dirt" || block.typeId === "minecraft:podzol" || block.typeId === "minecraft:mycelium" || block.typeId === "minecraft:farmland" || block.typeId === "minecraft:sand" || block.typeId === "minecraft:red_sand" || block.typeId.includes("concrete_powder") || block.typeId === "minecraft:suspicious_sand" || block.typeId === "minecraft:gravel" || block.typeId === "minecraft:suspicious_gravel" || block.typeId === "minecraft:clay" || block.typeId === "minecraft:snow" || block.typeId === "minecraft:snow_block" || block.typeId === "minecraft:mud" || block.typeId === "minecraft:muddy_mangrove_roots" || block.typeId === "minecraft:soul_sand" || block.typeId === "minecraft:soul_soil";
  }
  isWoodBlockType(blockType) {
    return blockType.includes("log") || blockType.includes("stem") || blockType.includes("wood") || blockType === "minecraft:mushroom_stem";
  }
  isOreBlockType(blockType) {
    return blockType.includes("ore") || blockType === "minecraft:ancient_debris" || blockType === "minecraft:nether_quartz_ore";
  }
  isTillableBlock(block) {
    return block.typeId === "minecraft:dirt" || block.typeId === "minecraft:grass_block" || block.typeId === "minecraft:dirt_path" || block.typeId === "minecraft:coarse_dirt";
  }
  isCropBlock(block) {
    return block.hasTag("minecraft:crop") || block.typeId.includes("wheat") || block.typeId.includes("carrots") || block.typeId.includes("potatoes") || block.typeId.includes("beetroots") || block.typeId.includes("melon_stem") || block.typeId.includes("pumpkin_stem") || block.typeId.includes("sweet_berry_bush") || block.typeId === "minecraft:farmland";
  }
  isReplaceablePlant(block) {
    return block.hasTag("plant") || block.hasTag("flower") || block.hasTag("minecraft:flowers") || block.typeId === "minecraft:grass" || block.typeId === "minecraft:tall_grass" || block.typeId === "minecraft:bush" || block.typeId === "minecraft:firefly_bush" || block.typeId === "minecraft:fern" || block.typeId === "minecraft:large_fern" || block.typeId === "minecraft:dead_bush" || block.typeId === "minecraft:poppy" || block.typeId === "minecraft:dandelion" || block.typeId === "minecraft:blue_orchid" || block.typeId === "minecraft:allium" || block.typeId === "minecraft:azure_bluet" || block.typeId === "minecraft:red_tulip" || block.typeId === "minecraft:orange_tulip" || block.typeId === "minecraft:white_tulip" || block.typeId === "minecraft:pink_tulip" || block.typeId === "minecraft:oxeye_daisy" || block.typeId === "minecraft:cornflower" || block.typeId === "minecraft:lily_of_the_valley" || block.typeId === "minecraft:sunflower" || block.typeId === "minecraft:lilac" || block.typeId === "minecraft:rose_bush" || block.typeId === "minecraft:peony" || block.typeId.includes("sapling") || block.typeId.includes("_grass") || block.typeId.includes("_flower");
  }
  getTillingBlocks(startBlock) {
    const blocks = [];
    const startPos = startBlock.location;
    for (let dx = -1; dx <= 1; dx++) {
      for (let dz = -1; dz <= 1; dz++) {
        try {
          const blockPos = {
            x: startPos.x + dx,
            y: startPos.y,
            z: startPos.z + dz
          };
          const block = startBlock.dimension.getBlock(blockPos);
          if (block && this.isTillableBlock(block)) {
            const blockAbove = startBlock.dimension.getBlock({
              x: blockPos.x,
              y: blockPos.y + 1,
              z: blockPos.z
            });
            if (blockAbove && (blockAbove.isAir || this.isCropBlock(blockAbove) || this.isReplaceablePlant(blockAbove))) {
              blocks.push(block);
            }
          }
        } catch (error2) {
        }
      }
    }
    return blocks;
  }
  // #endregion
  playToolSound(tool, player, position, crackingSound) {
    let soundToPlay = "";
    const soundProps = {
      volume: 0.8,
      pitch: 0.8 + Math.random() * 0.2,
      location: position
    };
    switch (tool.typeId) {
      case "mco_nom:candy_pickaxe":
        soundToPlay = "mco_nom.candy_tools.pickaxe_hit" /* McoNomCandyToolsPickaxeHit */;
        break;
      case "mco_nom:candy_axe":
        soundToPlay = "mco_nom.candy_tools.axe_hit" /* McoNomCandyToolsAxeHit */;
        break;
      case "mco_nom:candy_shovel":
        soundToPlay = "mco_nom.candy_tools.shovel_hit" /* McoNomCandyToolsShovelHit */;
        break;
      case "mco_nom:candy_hoe":
        soundToPlay = "mco_nom.candy_tools.hoe_hit" /* McoNomCandyToolsHoeHit */;
        break;
    }
    system12.run(() => {
      player.playSound(soundToPlay, soundProps);
      if (crackingSound !== void 0 && crackingSound === true) {
        player.playSound("mco_nom.candy_tools.sword_cracking" /* McoNomCandyToolsSwordCracking */, {
          volume: 0.3,
          pitch: 0.8 + Math.random() * 0.2,
          location: position
        });
      }
    });
  }
  startTreeCapitator(player, startBlock, tool) {
    const playerId = player.id;
    if (this.activeProcesses.has(playerId))
      return;
    if (!this.isWoodBlock(startBlock)) {
      return;
    }
    this.activeProcesses.add(playerId);
    this.playToolSound(tool, player, startBlock.center());
    const blocksToBreak = this.findConnectedBlocks(startBlock, startBlock.typeId, 64, true);
    const startPos = startBlock.location;
    const filteredBlocks = blocksToBreak.filter((block) => {
      const pos = block.location;
      return !(pos.x === startPos.x && pos.y === startPos.y && pos.z === startPos.z);
    });
    this.processBlocksBatched(player, filteredBlocks, false, () => {
      this.activeProcesses.delete(playerId);
    });
  }
  startVeinMiner(player, startBlock, tool) {
    const playerId = player.id;
    if (this.activeProcesses.has(playerId))
      return;
    this.activeProcesses.add(playerId);
    this.playToolSound(tool, player, startBlock.center(), true);
    const blocksToBreak = this.findConnectedBlocks(startBlock, startBlock.typeId, 64, false);
    const startPos = startBlock.location;
    const filteredBlocks = blocksToBreak.filter((block) => {
      const pos = block.location;
      return !(pos.x === startPos.x && pos.y === startPos.y && pos.z === startPos.z);
    });
    this.processBlocksBatched(player, filteredBlocks, false, () => {
      this.activeProcesses.delete(playerId);
    });
  }
  getChunkMiningBlocks(player, startBlock) {
    const blocks = [];
    const startPos = startBlock.location;
    const viewDirection = player.getViewDirection();
    const absX = Math.abs(viewDirection.x);
    const absY = Math.abs(viewDirection.y);
    const absZ = Math.abs(viewDirection.z);
    let forward;
    let right;
    let up = { x: 0, y: 1, z: 0 };
    if (absX > absY && absX > absZ) {
      forward = viewDirection.x > 0 ? { x: 1, y: 0, z: 0 } : { x: -1, y: 0, z: 0 };
      right = { x: 0, y: 0, z: 1 };
    } else if (absZ > absY && absZ > absX) {
      forward = viewDirection.z > 0 ? { x: 0, y: 0, z: 1 } : { x: 0, y: 0, z: -1 };
      right = { x: 1, y: 0, z: 0 };
    } else {
      forward = viewDirection.y > 0 ? { x: 0, y: 1, z: 0 } : { x: 0, y: -1, z: 0 };
      right = { x: 1, y: 0, z: 0 };
      up = { x: 0, y: 0, z: 1 };
    }
    for (let f = 0; f < 3; f++) {
      for (let r = -1; r <= 1; r++) {
        for (let u = -1; u <= 1; u++) {
          try {
            const blockPos = {
              x: startPos.x + forward.x * f + right.x * r + up.x * u,
              y: startPos.y + forward.y * f + right.y * r + up.y * u,
              z: startPos.z + forward.z * f + right.z * r + up.z * u
            };
            const block = startBlock.dimension.getBlock(blockPos);
            if (block && !block.isAir) {
              blocks.push(block);
            }
          } catch (error2) {
          }
        }
      }
    }
    return blocks;
  }
  startChunkMining(player, startBlock, tool) {
    const playerId = player.id;
    if (this.activeProcesses.has(playerId))
      return;
    this.activeProcesses.add(playerId);
    this.playToolSound(tool, player, startBlock.center());
    let blocksToBreak = this.getChunkMiningBlocks(player, startBlock);
    switch (tool.typeId) {
      case "mco_nom:candy_pickaxe":
        blocksToBreak = blocksToBreak.filter((block) => this.isStoneBlock(block));
        break;
      case "mco_nom:candy_shovel":
        blocksToBreak = blocksToBreak.filter((block) => this.isShovelBlock(block));
        break;
    }
    const startPos = startBlock.location;
    const filteredBlocks = blocksToBreak.filter((block) => {
      const pos = block.location;
      return !(pos.x === startPos.x && pos.y === startPos.y && pos.z === startPos.z);
    });
    this.processBlocksBatched(player, filteredBlocks, true, () => {
      this.activeProcesses.delete(playerId);
    });
  }
  startMassTilling(player, startBlock, tool) {
    const playerId = player.id;
    if (this.activeProcesses.has(playerId))
      return;
    if (!this.isTillableBlock(startBlock)) {
      return;
    }
    this.activeProcesses.add(playerId);
    this.playToolSound(tool, player, startBlock.center());
    const blocksToTill = this.getTillingBlocks(startBlock);
    const startPos = startBlock.location;
    const filteredBlocks = blocksToTill.filter((block) => {
      const pos = block.location;
      return !(pos.x === startPos.x && pos.y === startPos.y && pos.z === startPos.z);
    });
    this.processTillingBatched(player, filteredBlocks, () => {
      this.activeProcesses.delete(playerId);
    });
  }
  processTillingBatched(player, blocks, onComplete) {
    let index = 0;
    const processNextBatch = () => {
      const batchSize = 4;
      let processed = 0;
      while (index < blocks.length && processed < batchSize) {
        const block = blocks[index++];
        try {
          if (block && this.isTillableBlock(block)) {
            system12.runTimeout(() => {
              const blockAbove = block.dimension.getBlock({
                x: block.location.x,
                y: block.location.y + 1,
                z: block.location.z
              });
              if (blockAbove && this.isReplaceablePlant(blockAbove)) {
                const drops = this.getDropsForBlock(blockAbove.typeId);
                blockAbove.setType("minecraft:air");
                for (const drop of drops) {
                  if (drop.typeId !== "undefined") {
                    block.dimension.spawnItem(drop, blockAbove.center());
                  }
                }
              }
              block.setType("minecraft:farmland");
              player.dimension.playSound("use.gravel", block.center(), {
                pitch: 0.9 + Math.random() * 0.2,
                volume: 0.15
              });
              try {
                player.dimension.spawnParticle("mco_nom:candy_tool_break", {
                  x: block.center().x,
                  y: block.center().y + 0.5,
                  z: block.center().z
                });
              } catch {
              }
            }, processed * 2);
          }
        } catch (error2) {
        }
        processed++;
      }
      if (index < blocks.length) {
        system12.runTimeout(() => processNextBatch(), batchSize * 2);
      } else {
        onComplete();
      }
    };
    processNextBatch();
  }
  findConnectedBlocks(startBlock, targetType, maxBlocks, isTreeCapitator) {
    const visited = /* @__PURE__ */ new Set();
    const result = [];
    const searchRecursive = (block, depth = 0) => {
      if (depth > 64 || result.length >= maxBlocks)
        return;
      const pos = block.location;
      const posKey2 = `${pos.x},${pos.y},${pos.z}`;
      if (visited.has(posKey2))
        return;
      visited.add(posKey2);
      let isValidBlock = false;
      if (isTreeCapitator) {
        isValidBlock = this.isWoodBlock(block) && block.typeId === targetType;
      } else {
        isValidBlock = this.isOreBlock(block) && (block.typeId === targetType || block.typeId === targetType.replace("lit_", ""));
      }
      if (isValidBlock) {
        result.push(block);
        const neighbors = isTreeCapitator ? this.getTreeNeighborPositions(pos) : this.getVeinNeighborPositions(pos);
        for (const neighborPos of neighbors) {
          const neighborPosKey = `${neighborPos.x},${neighborPos.y},${neighborPos.z}`;
          if (!visited.has(neighborPosKey)) {
            try {
              const neighborBlock = block.dimension.getBlock(neighborPos);
              if (neighborBlock && !neighborBlock.isAir) {
                searchRecursive(neighborBlock, depth + 1);
              }
            } catch (error2) {
            }
          }
        }
      }
    };
    searchRecursive(startBlock);
    return result;
  }
  getTreeNeighborPositions(center) {
    const positions = [];
    for (let dx = -1; dx <= 1; dx++) {
      for (let dy = -1; dy <= 1; dy++) {
        for (let dz = -1; dz <= 1; dz++) {
          if (dx === 0 && dy === 0 && dz === 0)
            continue;
          positions.push({ x: center.x + dx, y: center.y + dy, z: center.z + dz });
        }
      }
    }
    return positions;
  }
  getVeinNeighborPositions(center) {
    const positions = [];
    const directions = [
      [1, 0, 0],
      [-1, 0, 0],
      [0, 1, 0],
      [0, -1, 0],
      [0, 0, 1],
      [0, 0, -1]
    ];
    for (const [dx, dy, dz] of directions) {
      positions.push({ x: center.x + dx, y: center.y + dy, z: center.z + dz });
    }
    return positions;
  }
  getDropsForBlock(blockType) {
    const dropData = this.blockData.get(blockType);
    if (!dropData) {
      return [new ItemStack3(blockType, 1)];
    }
    const drops = [];
    if (dropData.item !== "undefined") {
      drops.push(new ItemStack3(dropData.item, dropData.amount));
    }
    if (dropData.chance && Math.random() < dropData.chance.probability) {
      drops.push(new ItemStack3(dropData.chance.item, dropData.chance.amount));
    }
    return drops;
  }
  processBlocksBatched(player, blocks, isChunkMining, onComplete) {
    let index = 0;
    const batchSize = 3;
    const processNextBatch = () => {
      let processed = 0;
      while (index < blocks.length && processed < batchSize) {
        const block = blocks[index++];
        try {
          if (block && !block.isAir) {
            const blockType = block.typeId;
            const drops = this.getDropsForBlock(blockType);
            const hasCustomDrop = this.blockData.has(blockType);
            const delay = isChunkMining && !hasCustomDrop ? 8 : 4;
            system12.runTimeout(() => {
              block.setType("minecraft:air");
              try {
                player.dimension.spawnParticle(
                  "mco_nom:candy_tool_break_small",
                  block.location
                );
              } catch (e) {
              }
              playBlockBreakSound(
                player,
                block,
                blockType,
                isChunkMining,
                this.isWoodBlockType.bind(this),
                this.isOreBlockType.bind(this)
              );
              if (!isChunkMining && block.above()?.typeId.includes("leaves")) {
                block.dimension.playSound(
                  "mco_nom.leaves_shake" /* McoNomLeavesShake */,
                  block.center(),
                  {
                    pitch: 0.8 + Math.random() * 0.2,
                    volume: 0.7
                  }
                );
              }
              for (const drop of drops) {
                block.dimension.spawnItem(drop, block.center());
              }
            }, delay);
          }
        } catch (error2) {
        }
        processed++;
      }
      if (index < blocks.length) {
        system12.runTimeout(() => processNextBatch(), 1);
      } else {
        onComplete();
      }
    };
    processNextBatch();
  }
};
var candyToolsManager = CandyToolsManager.getInstance();

// data/gametests/src/items/weapons/MeleeWeaponsManager.ts
import { world as world12, Player as Player9, ItemStack as ItemStack4, system as system13, Entity } from "@minecraft/server";
var CandyMeleeWeaponsManager = class _CandyMeleeWeaponsManager {
  constructor() {
    this.sweetFoods = [
      "mco_nom:candy",
      "mco_nom:donut"
    ];
    this.setupEventListeners();
  }
  static getInstance() {
    if (!_CandyMeleeWeaponsManager.instance) {
      _CandyMeleeWeaponsManager.instance = new _CandyMeleeWeaponsManager();
    }
    return _CandyMeleeWeaponsManager.instance;
  }
  setupEventListeners() {
    world12.afterEvents.entityHitEntity.subscribe((event) => {
      const source = event.damagingEntity;
      const target = event.hitEntity;
      if (!(source instanceof Player9) || !(target instanceof Entity))
        return;
      const sourceInv = source.getComponent("inventory");
      const container = sourceInv.container;
      const slot = container.getSlot(source.selectedSlotIndex);
      if (!slot || !slot.hasItem() || slot.typeId !== "mco_nom:candy_sword")
        return;
      this.CandySwordAbility(source, target);
    });
  }
  CandySwordAbility(player, target) {
    if (!this.isCasualMob(target))
      return;
    const singleConvertChance = 0.4;
    const slashAttackChance = 0.1;
    const randomChance = Math.random();
    if (randomChance < slashAttackChance) {
      this.playSlashingSound(target);
      this.performSlashAttack(player, target);
    } else if (randomChance < singleConvertChance) {
      this.playConversionSound(target);
      this.convertMobToSweet(target);
    }
  }
  isCasualMob(entity) {
    const casualMobTypes = [
      "minecraft:zombie",
      "minecraft:skeleton",
      "minecraft:creeper",
      "minecraft:spider",
      "minecraft:villager",
      "minecraft:pig",
      "minecraft:cow",
      "minecraft:sheep",
      "minecraft:chicken",
      "minecraft:rabbit",
      "minecraft:wolf",
      "minecraft:cat",
      "minecraft:horse",
      "minecraft:donkey",
      "minecraft:mule",
      "minecraft:llama",
      "minecraft:parrot",
      "minecraft:ocelot",
      "minecraft:bat",
      "minecraft:squid",
      "minecraft:mooshroom",
      "minecraft:zombie_villager",
      "minecraft:husk",
      "minecraft:stray",
      "minecraft:witch",
      "minecraft:slime",
      "minecraft:magma_cube",
      "minecraft:enderman"
    ];
    if (casualMobTypes.includes(entity.typeId)) {
      return true;
    }
    try {
      return entity.hasTag("animal") || entity.hasTag("villager") || entity.matches({ families: ["animal"] });
    } catch (error2) {
      return false;
    }
  }
  convertMobToSweet(entity) {
    const location = entity.location;
    const dimension = entity.dimension;
    entity.remove();
    const randomSweet = this.sweetFoods[Math.floor(Math.random() * this.sweetFoods.length)];
    const sweetAmount = Math.floor(Math.random() * 3) + 1;
    for (let i = 0; i < sweetAmount; i++) {
      const sweetItem = new ItemStack4(randomSweet, 1);
      dimension.spawnItem(sweetItem, {
        x: location.x + (Math.random() - 0.5) * 0.5,
        y: location.y + 0.5,
        z: location.z + (Math.random() - 0.5) * 0.5
      });
    }
    try {
      dimension.spawnParticle("mco_nom:candy_tool_break", {
        x: location.x,
        y: location.y + 1,
        z: location.z
      });
    } catch {
    }
  }
  playConversionSound(target) {
    try {
      target.dimension.playSound("mco_nom.candy_tools.sword_poof" /* McoNomCandyToolsSwordPoof */, target.location, {
        pitch: 0.8 + Math.random() * 0.4,
        volume: 0.7
      });
      target.dimension.playSound("mco_nom.candy_tools.sword_cracking" /* McoNomCandyToolsSwordCracking */, target.location, {
        pitch: 0.8 + Math.random() * 0.2,
        volume: 0.8
      });
    } catch {
    }
  }
  playSlashingSound(target) {
    try {
      target.dimension.playSound("mco_nom.candy_tools.sword_slash" /* McoNomCandyToolsSwordSlash */, target.location, {
        pitch: 0.8 + Math.random() * 0.3,
        volume: 0.8
      });
      target.dimension.playSound("mco_nom.candy_tools.sword_cracking" /* McoNomCandyToolsSwordCracking */, target.location, {
        pitch: 0.8 + Math.random() * 0.2,
        volume: 0.9
      });
    } catch {
    }
  }
  performSlashAttack(player, originalTarget) {
    this.convertMobToSweet(originalTarget);
    const viewDirection = player.getViewDirection();
    const playerLocation = player.location;
    const dimension = player.dimension;
    const slashRange = 5;
    const nearbyEntities = dimension.getEntities({
      location: playerLocation,
      maxDistance: slashRange
    });
    let convertedCount = 0;
    const maxConversions = 10;
    for (const entity of nearbyEntities) {
      if (convertedCount >= maxConversions)
        break;
      if (entity === player || entity === originalTarget)
        continue;
      if (!this.isCasualMob(entity))
        continue;
      const entityVector = {
        x: entity.location.x - playerLocation.x,
        y: entity.location.y - playerLocation.y,
        z: entity.location.z - playerLocation.z
      };
      const entityDistance = Math.sqrt(entityVector.x ** 2 + entityVector.y ** 2 + entityVector.z ** 2);
      if (entityDistance === 0)
        continue;
      const normalizedEntity = {
        x: entityVector.x / entityDistance,
        y: entityVector.y / entityDistance,
        z: entityVector.z / entityDistance
      };
      const dotProduct = viewDirection.x * normalizedEntity.x + viewDirection.y * normalizedEntity.y + viewDirection.z * normalizedEntity.z;
      if (dotProduct > 0.5) {
        this.convertMobToSweet(entity);
        convertedCount++;
        system13.runTimeout(() => {
        }, convertedCount * 2);
      }
    }
  }
};
var candyMeleeWeaponsManager = CandyMeleeWeaponsManager.getInstance();

// data/gametests/src/items/bubble_blower/BubbleBlowerManager.ts
import {
  Entity as Entity2,
  EntityComponentTypes,
  EquipmentSlot as EquipmentSlot3,
  MolangVariableMap,
  Player as Player10,
  system as system14,
  world as world13
} from "@minecraft/server";

// data/gametests/node_modules/@minecraft/vanilla-data/lib/index.js
var MinecraftBiomeTypes = ((MinecraftBiomeTypes2) => {
  MinecraftBiomeTypes2["BambooJungle"] = "minecraft:bamboo_jungle";
  MinecraftBiomeTypes2["BambooJungleHills"] = "minecraft:bamboo_jungle_hills";
  MinecraftBiomeTypes2["BasaltDeltas"] = "minecraft:basalt_deltas";
  MinecraftBiomeTypes2["Beach"] = "minecraft:beach";
  MinecraftBiomeTypes2["BirchForest"] = "minecraft:birch_forest";
  MinecraftBiomeTypes2["BirchForestHills"] = "minecraft:birch_forest_hills";
  MinecraftBiomeTypes2["BirchForestHillsMutated"] = "minecraft:birch_forest_hills_mutated";
  MinecraftBiomeTypes2["BirchForestMutated"] = "minecraft:birch_forest_mutated";
  MinecraftBiomeTypes2["CherryGrove"] = "minecraft:cherry_grove";
  MinecraftBiomeTypes2["ColdBeach"] = "minecraft:cold_beach";
  MinecraftBiomeTypes2["ColdOcean"] = "minecraft:cold_ocean";
  MinecraftBiomeTypes2["ColdTaiga"] = "minecraft:cold_taiga";
  MinecraftBiomeTypes2["ColdTaigaHills"] = "minecraft:cold_taiga_hills";
  MinecraftBiomeTypes2["ColdTaigaMutated"] = "minecraft:cold_taiga_mutated";
  MinecraftBiomeTypes2["CrimsonForest"] = "minecraft:crimson_forest";
  MinecraftBiomeTypes2["DeepColdOcean"] = "minecraft:deep_cold_ocean";
  MinecraftBiomeTypes2["DeepDark"] = "minecraft:deep_dark";
  MinecraftBiomeTypes2["DeepFrozenOcean"] = "minecraft:deep_frozen_ocean";
  MinecraftBiomeTypes2["DeepLukewarmOcean"] = "minecraft:deep_lukewarm_ocean";
  MinecraftBiomeTypes2["DeepOcean"] = "minecraft:deep_ocean";
  MinecraftBiomeTypes2["DeepWarmOcean"] = "minecraft:deep_warm_ocean";
  MinecraftBiomeTypes2["Desert"] = "minecraft:desert";
  MinecraftBiomeTypes2["DesertHills"] = "minecraft:desert_hills";
  MinecraftBiomeTypes2["DesertMutated"] = "minecraft:desert_mutated";
  MinecraftBiomeTypes2["DripstoneCaves"] = "minecraft:dripstone_caves";
  MinecraftBiomeTypes2["ExtremeHills"] = "minecraft:extreme_hills";
  MinecraftBiomeTypes2["ExtremeHillsEdge"] = "minecraft:extreme_hills_edge";
  MinecraftBiomeTypes2["ExtremeHillsMutated"] = "minecraft:extreme_hills_mutated";
  MinecraftBiomeTypes2["ExtremeHillsPlusTrees"] = "minecraft:extreme_hills_plus_trees";
  MinecraftBiomeTypes2["ExtremeHillsPlusTreesMutated"] = "minecraft:extreme_hills_plus_trees_mutated";
  MinecraftBiomeTypes2["FlowerForest"] = "minecraft:flower_forest";
  MinecraftBiomeTypes2["Forest"] = "minecraft:forest";
  MinecraftBiomeTypes2["ForestHills"] = "minecraft:forest_hills";
  MinecraftBiomeTypes2["FrozenOcean"] = "minecraft:frozen_ocean";
  MinecraftBiomeTypes2["FrozenPeaks"] = "minecraft:frozen_peaks";
  MinecraftBiomeTypes2["FrozenRiver"] = "minecraft:frozen_river";
  MinecraftBiomeTypes2["Grove"] = "minecraft:grove";
  MinecraftBiomeTypes2["Hell"] = "minecraft:hell";
  MinecraftBiomeTypes2["IceMountains"] = "minecraft:ice_mountains";
  MinecraftBiomeTypes2["IcePlains"] = "minecraft:ice_plains";
  MinecraftBiomeTypes2["IcePlainsSpikes"] = "minecraft:ice_plains_spikes";
  MinecraftBiomeTypes2["JaggedPeaks"] = "minecraft:jagged_peaks";
  MinecraftBiomeTypes2["Jungle"] = "minecraft:jungle";
  MinecraftBiomeTypes2["JungleEdge"] = "minecraft:jungle_edge";
  MinecraftBiomeTypes2["JungleEdgeMutated"] = "minecraft:jungle_edge_mutated";
  MinecraftBiomeTypes2["JungleHills"] = "minecraft:jungle_hills";
  MinecraftBiomeTypes2["JungleMutated"] = "minecraft:jungle_mutated";
  MinecraftBiomeTypes2["LegacyFrozenOcean"] = "minecraft:legacy_frozen_ocean";
  MinecraftBiomeTypes2["LukewarmOcean"] = "minecraft:lukewarm_ocean";
  MinecraftBiomeTypes2["LushCaves"] = "minecraft:lush_caves";
  MinecraftBiomeTypes2["MangroveSwamp"] = "minecraft:mangrove_swamp";
  MinecraftBiomeTypes2["Meadow"] = "minecraft:meadow";
  MinecraftBiomeTypes2["MegaTaiga"] = "minecraft:mega_taiga";
  MinecraftBiomeTypes2["MegaTaigaHills"] = "minecraft:mega_taiga_hills";
  MinecraftBiomeTypes2["Mesa"] = "minecraft:mesa";
  MinecraftBiomeTypes2["MesaBryce"] = "minecraft:mesa_bryce";
  MinecraftBiomeTypes2["MesaPlateau"] = "minecraft:mesa_plateau";
  MinecraftBiomeTypes2["MesaPlateauMutated"] = "minecraft:mesa_plateau_mutated";
  MinecraftBiomeTypes2["MesaPlateauStone"] = "minecraft:mesa_plateau_stone";
  MinecraftBiomeTypes2["MesaPlateauStoneMutated"] = "minecraft:mesa_plateau_stone_mutated";
  MinecraftBiomeTypes2["MushroomIsland"] = "minecraft:mushroom_island";
  MinecraftBiomeTypes2["MushroomIslandShore"] = "minecraft:mushroom_island_shore";
  MinecraftBiomeTypes2["Ocean"] = "minecraft:ocean";
  MinecraftBiomeTypes2["PaleGarden"] = "minecraft:pale_garden";
  MinecraftBiomeTypes2["Plains"] = "minecraft:plains";
  MinecraftBiomeTypes2["RedwoodTaigaHillsMutated"] = "minecraft:redwood_taiga_hills_mutated";
  MinecraftBiomeTypes2["RedwoodTaigaMutated"] = "minecraft:redwood_taiga_mutated";
  MinecraftBiomeTypes2["River"] = "minecraft:river";
  MinecraftBiomeTypes2["RoofedForest"] = "minecraft:roofed_forest";
  MinecraftBiomeTypes2["RoofedForestMutated"] = "minecraft:roofed_forest_mutated";
  MinecraftBiomeTypes2["Savanna"] = "minecraft:savanna";
  MinecraftBiomeTypes2["SavannaMutated"] = "minecraft:savanna_mutated";
  MinecraftBiomeTypes2["SavannaPlateau"] = "minecraft:savanna_plateau";
  MinecraftBiomeTypes2["SavannaPlateauMutated"] = "minecraft:savanna_plateau_mutated";
  MinecraftBiomeTypes2["SnowySlopes"] = "minecraft:snowy_slopes";
  MinecraftBiomeTypes2["SoulsandValley"] = "minecraft:soulsand_valley";
  MinecraftBiomeTypes2["StoneBeach"] = "minecraft:stone_beach";
  MinecraftBiomeTypes2["StonyPeaks"] = "minecraft:stony_peaks";
  MinecraftBiomeTypes2["SunflowerPlains"] = "minecraft:sunflower_plains";
  MinecraftBiomeTypes2["Swampland"] = "minecraft:swampland";
  MinecraftBiomeTypes2["SwamplandMutated"] = "minecraft:swampland_mutated";
  MinecraftBiomeTypes2["Taiga"] = "minecraft:taiga";
  MinecraftBiomeTypes2["TaigaHills"] = "minecraft:taiga_hills";
  MinecraftBiomeTypes2["TaigaMutated"] = "minecraft:taiga_mutated";
  MinecraftBiomeTypes2["TheEnd"] = "minecraft:the_end";
  MinecraftBiomeTypes2["WarmOcean"] = "minecraft:warm_ocean";
  MinecraftBiomeTypes2["WarpedForest"] = "minecraft:warped_forest";
  return MinecraftBiomeTypes2;
})(MinecraftBiomeTypes || {});
var MinecraftBlockTypes = ((MinecraftBlockTypes2) => {
  MinecraftBlockTypes2["AcaciaButton"] = "minecraft:acacia_button";
  MinecraftBlockTypes2["AcaciaDoor"] = "minecraft:acacia_door";
  MinecraftBlockTypes2["AcaciaDoubleSlab"] = "minecraft:acacia_double_slab";
  MinecraftBlockTypes2["AcaciaFence"] = "minecraft:acacia_fence";
  MinecraftBlockTypes2["AcaciaFenceGate"] = "minecraft:acacia_fence_gate";
  MinecraftBlockTypes2["AcaciaHangingSign"] = "minecraft:acacia_hanging_sign";
  MinecraftBlockTypes2["AcaciaLeaves"] = "minecraft:acacia_leaves";
  MinecraftBlockTypes2["AcaciaLog"] = "minecraft:acacia_log";
  MinecraftBlockTypes2["AcaciaPlanks"] = "minecraft:acacia_planks";
  MinecraftBlockTypes2["AcaciaPressurePlate"] = "minecraft:acacia_pressure_plate";
  MinecraftBlockTypes2["AcaciaSapling"] = "minecraft:acacia_sapling";
  MinecraftBlockTypes2["AcaciaSlab"] = "minecraft:acacia_slab";
  MinecraftBlockTypes2["AcaciaStairs"] = "minecraft:acacia_stairs";
  MinecraftBlockTypes2["AcaciaStandingSign"] = "minecraft:acacia_standing_sign";
  MinecraftBlockTypes2["AcaciaTrapdoor"] = "minecraft:acacia_trapdoor";
  MinecraftBlockTypes2["AcaciaWallSign"] = "minecraft:acacia_wall_sign";
  MinecraftBlockTypes2["AcaciaWood"] = "minecraft:acacia_wood";
  MinecraftBlockTypes2["ActivatorRail"] = "minecraft:activator_rail";
  MinecraftBlockTypes2["Air"] = "minecraft:air";
  MinecraftBlockTypes2["Allium"] = "minecraft:allium";
  MinecraftBlockTypes2["Allow"] = "minecraft:allow";
  MinecraftBlockTypes2["AmethystBlock"] = "minecraft:amethyst_block";
  MinecraftBlockTypes2["AmethystCluster"] = "minecraft:amethyst_cluster";
  MinecraftBlockTypes2["AncientDebris"] = "minecraft:ancient_debris";
  MinecraftBlockTypes2["Andesite"] = "minecraft:andesite";
  MinecraftBlockTypes2["AndesiteDoubleSlab"] = "minecraft:andesite_double_slab";
  MinecraftBlockTypes2["AndesiteSlab"] = "minecraft:andesite_slab";
  MinecraftBlockTypes2["AndesiteStairs"] = "minecraft:andesite_stairs";
  MinecraftBlockTypes2["AndesiteWall"] = "minecraft:andesite_wall";
  MinecraftBlockTypes2["Anvil"] = "minecraft:anvil";
  MinecraftBlockTypes2["Azalea"] = "minecraft:azalea";
  MinecraftBlockTypes2["AzaleaLeaves"] = "minecraft:azalea_leaves";
  MinecraftBlockTypes2["AzaleaLeavesFlowered"] = "minecraft:azalea_leaves_flowered";
  MinecraftBlockTypes2["AzureBluet"] = "minecraft:azure_bluet";
  MinecraftBlockTypes2["Bamboo"] = "minecraft:bamboo";
  MinecraftBlockTypes2["BambooBlock"] = "minecraft:bamboo_block";
  MinecraftBlockTypes2["BambooButton"] = "minecraft:bamboo_button";
  MinecraftBlockTypes2["BambooDoor"] = "minecraft:bamboo_door";
  MinecraftBlockTypes2["BambooDoubleSlab"] = "minecraft:bamboo_double_slab";
  MinecraftBlockTypes2["BambooFence"] = "minecraft:bamboo_fence";
  MinecraftBlockTypes2["BambooFenceGate"] = "minecraft:bamboo_fence_gate";
  MinecraftBlockTypes2["BambooHangingSign"] = "minecraft:bamboo_hanging_sign";
  MinecraftBlockTypes2["BambooMosaic"] = "minecraft:bamboo_mosaic";
  MinecraftBlockTypes2["BambooMosaicDoubleSlab"] = "minecraft:bamboo_mosaic_double_slab";
  MinecraftBlockTypes2["BambooMosaicSlab"] = "minecraft:bamboo_mosaic_slab";
  MinecraftBlockTypes2["BambooMosaicStairs"] = "minecraft:bamboo_mosaic_stairs";
  MinecraftBlockTypes2["BambooPlanks"] = "minecraft:bamboo_planks";
  MinecraftBlockTypes2["BambooPressurePlate"] = "minecraft:bamboo_pressure_plate";
  MinecraftBlockTypes2["BambooSapling"] = "minecraft:bamboo_sapling";
  MinecraftBlockTypes2["BambooSlab"] = "minecraft:bamboo_slab";
  MinecraftBlockTypes2["BambooStairs"] = "minecraft:bamboo_stairs";
  MinecraftBlockTypes2["BambooStandingSign"] = "minecraft:bamboo_standing_sign";
  MinecraftBlockTypes2["BambooTrapdoor"] = "minecraft:bamboo_trapdoor";
  MinecraftBlockTypes2["BambooWallSign"] = "minecraft:bamboo_wall_sign";
  MinecraftBlockTypes2["Barrel"] = "minecraft:barrel";
  MinecraftBlockTypes2["Barrier"] = "minecraft:barrier";
  MinecraftBlockTypes2["Basalt"] = "minecraft:basalt";
  MinecraftBlockTypes2["Beacon"] = "minecraft:beacon";
  MinecraftBlockTypes2["Bed"] = "minecraft:bed";
  MinecraftBlockTypes2["Bedrock"] = "minecraft:bedrock";
  MinecraftBlockTypes2["BeeNest"] = "minecraft:bee_nest";
  MinecraftBlockTypes2["Beehive"] = "minecraft:beehive";
  MinecraftBlockTypes2["Beetroot"] = "minecraft:beetroot";
  MinecraftBlockTypes2["Bell"] = "minecraft:bell";
  MinecraftBlockTypes2["BigDripleaf"] = "minecraft:big_dripleaf";
  MinecraftBlockTypes2["BirchButton"] = "minecraft:birch_button";
  MinecraftBlockTypes2["BirchDoor"] = "minecraft:birch_door";
  MinecraftBlockTypes2["BirchDoubleSlab"] = "minecraft:birch_double_slab";
  MinecraftBlockTypes2["BirchFence"] = "minecraft:birch_fence";
  MinecraftBlockTypes2["BirchFenceGate"] = "minecraft:birch_fence_gate";
  MinecraftBlockTypes2["BirchHangingSign"] = "minecraft:birch_hanging_sign";
  MinecraftBlockTypes2["BirchLeaves"] = "minecraft:birch_leaves";
  MinecraftBlockTypes2["BirchLog"] = "minecraft:birch_log";
  MinecraftBlockTypes2["BirchPlanks"] = "minecraft:birch_planks";
  MinecraftBlockTypes2["BirchPressurePlate"] = "minecraft:birch_pressure_plate";
  MinecraftBlockTypes2["BirchSapling"] = "minecraft:birch_sapling";
  MinecraftBlockTypes2["BirchSlab"] = "minecraft:birch_slab";
  MinecraftBlockTypes2["BirchStairs"] = "minecraft:birch_stairs";
  MinecraftBlockTypes2["BirchStandingSign"] = "minecraft:birch_standing_sign";
  MinecraftBlockTypes2["BirchTrapdoor"] = "minecraft:birch_trapdoor";
  MinecraftBlockTypes2["BirchWallSign"] = "minecraft:birch_wall_sign";
  MinecraftBlockTypes2["BirchWood"] = "minecraft:birch_wood";
  MinecraftBlockTypes2["BlackCandle"] = "minecraft:black_candle";
  MinecraftBlockTypes2["BlackCandleCake"] = "minecraft:black_candle_cake";
  MinecraftBlockTypes2["BlackCarpet"] = "minecraft:black_carpet";
  MinecraftBlockTypes2["BlackConcrete"] = "minecraft:black_concrete";
  MinecraftBlockTypes2["BlackConcretePowder"] = "minecraft:black_concrete_powder";
  MinecraftBlockTypes2["BlackGlazedTerracotta"] = "minecraft:black_glazed_terracotta";
  MinecraftBlockTypes2["BlackShulkerBox"] = "minecraft:black_shulker_box";
  MinecraftBlockTypes2["BlackStainedGlass"] = "minecraft:black_stained_glass";
  MinecraftBlockTypes2["BlackStainedGlassPane"] = "minecraft:black_stained_glass_pane";
  MinecraftBlockTypes2["BlackTerracotta"] = "minecraft:black_terracotta";
  MinecraftBlockTypes2["BlackWool"] = "minecraft:black_wool";
  MinecraftBlockTypes2["Blackstone"] = "minecraft:blackstone";
  MinecraftBlockTypes2["BlackstoneDoubleSlab"] = "minecraft:blackstone_double_slab";
  MinecraftBlockTypes2["BlackstoneSlab"] = "minecraft:blackstone_slab";
  MinecraftBlockTypes2["BlackstoneStairs"] = "minecraft:blackstone_stairs";
  MinecraftBlockTypes2["BlackstoneWall"] = "minecraft:blackstone_wall";
  MinecraftBlockTypes2["BlastFurnace"] = "minecraft:blast_furnace";
  MinecraftBlockTypes2["BlueCandle"] = "minecraft:blue_candle";
  MinecraftBlockTypes2["BlueCandleCake"] = "minecraft:blue_candle_cake";
  MinecraftBlockTypes2["BlueCarpet"] = "minecraft:blue_carpet";
  MinecraftBlockTypes2["BlueConcrete"] = "minecraft:blue_concrete";
  MinecraftBlockTypes2["BlueConcretePowder"] = "minecraft:blue_concrete_powder";
  MinecraftBlockTypes2["BlueGlazedTerracotta"] = "minecraft:blue_glazed_terracotta";
  MinecraftBlockTypes2["BlueIce"] = "minecraft:blue_ice";
  MinecraftBlockTypes2["BlueOrchid"] = "minecraft:blue_orchid";
  MinecraftBlockTypes2["BlueShulkerBox"] = "minecraft:blue_shulker_box";
  MinecraftBlockTypes2["BlueStainedGlass"] = "minecraft:blue_stained_glass";
  MinecraftBlockTypes2["BlueStainedGlassPane"] = "minecraft:blue_stained_glass_pane";
  MinecraftBlockTypes2["BlueTerracotta"] = "minecraft:blue_terracotta";
  MinecraftBlockTypes2["BlueWool"] = "minecraft:blue_wool";
  MinecraftBlockTypes2["BoneBlock"] = "minecraft:bone_block";
  MinecraftBlockTypes2["Bookshelf"] = "minecraft:bookshelf";
  MinecraftBlockTypes2["BorderBlock"] = "minecraft:border_block";
  MinecraftBlockTypes2["BrainCoral"] = "minecraft:brain_coral";
  MinecraftBlockTypes2["BrainCoralBlock"] = "minecraft:brain_coral_block";
  MinecraftBlockTypes2["BrainCoralFan"] = "minecraft:brain_coral_fan";
  MinecraftBlockTypes2["BrainCoralWallFan"] = "minecraft:brain_coral_wall_fan";
  MinecraftBlockTypes2["BrewingStand"] = "minecraft:brewing_stand";
  MinecraftBlockTypes2["BrickBlock"] = "minecraft:brick_block";
  MinecraftBlockTypes2["BrickDoubleSlab"] = "minecraft:brick_double_slab";
  MinecraftBlockTypes2["BrickSlab"] = "minecraft:brick_slab";
  MinecraftBlockTypes2["BrickStairs"] = "minecraft:brick_stairs";
  MinecraftBlockTypes2["BrickWall"] = "minecraft:brick_wall";
  MinecraftBlockTypes2["BrownCandle"] = "minecraft:brown_candle";
  MinecraftBlockTypes2["BrownCandleCake"] = "minecraft:brown_candle_cake";
  MinecraftBlockTypes2["BrownCarpet"] = "minecraft:brown_carpet";
  MinecraftBlockTypes2["BrownConcrete"] = "minecraft:brown_concrete";
  MinecraftBlockTypes2["BrownConcretePowder"] = "minecraft:brown_concrete_powder";
  MinecraftBlockTypes2["BrownGlazedTerracotta"] = "minecraft:brown_glazed_terracotta";
  MinecraftBlockTypes2["BrownMushroom"] = "minecraft:brown_mushroom";
  MinecraftBlockTypes2["BrownMushroomBlock"] = "minecraft:brown_mushroom_block";
  MinecraftBlockTypes2["BrownShulkerBox"] = "minecraft:brown_shulker_box";
  MinecraftBlockTypes2["BrownStainedGlass"] = "minecraft:brown_stained_glass";
  MinecraftBlockTypes2["BrownStainedGlassPane"] = "minecraft:brown_stained_glass_pane";
  MinecraftBlockTypes2["BrownTerracotta"] = "minecraft:brown_terracotta";
  MinecraftBlockTypes2["BrownWool"] = "minecraft:brown_wool";
  MinecraftBlockTypes2["BubbleColumn"] = "minecraft:bubble_column";
  MinecraftBlockTypes2["BubbleCoral"] = "minecraft:bubble_coral";
  MinecraftBlockTypes2["BubbleCoralBlock"] = "minecraft:bubble_coral_block";
  MinecraftBlockTypes2["BubbleCoralFan"] = "minecraft:bubble_coral_fan";
  MinecraftBlockTypes2["BubbleCoralWallFan"] = "minecraft:bubble_coral_wall_fan";
  MinecraftBlockTypes2["BuddingAmethyst"] = "minecraft:budding_amethyst";
  MinecraftBlockTypes2["Bush"] = "minecraft:bush";
  MinecraftBlockTypes2["Cactus"] = "minecraft:cactus";
  MinecraftBlockTypes2["CactusFlower"] = "minecraft:cactus_flower";
  MinecraftBlockTypes2["Cake"] = "minecraft:cake";
  MinecraftBlockTypes2["Calcite"] = "minecraft:calcite";
  MinecraftBlockTypes2["CalibratedSculkSensor"] = "minecraft:calibrated_sculk_sensor";
  MinecraftBlockTypes2["Camera"] = "minecraft:camera";
  MinecraftBlockTypes2["Campfire"] = "minecraft:campfire";
  MinecraftBlockTypes2["Candle"] = "minecraft:candle";
  MinecraftBlockTypes2["CandleCake"] = "minecraft:candle_cake";
  MinecraftBlockTypes2["Carrots"] = "minecraft:carrots";
  MinecraftBlockTypes2["CartographyTable"] = "minecraft:cartography_table";
  MinecraftBlockTypes2["CarvedPumpkin"] = "minecraft:carved_pumpkin";
  MinecraftBlockTypes2["Cauldron"] = "minecraft:cauldron";
  MinecraftBlockTypes2["CaveVines"] = "minecraft:cave_vines";
  MinecraftBlockTypes2["CaveVinesBodyWithBerries"] = "minecraft:cave_vines_body_with_berries";
  MinecraftBlockTypes2["CaveVinesHeadWithBerries"] = "minecraft:cave_vines_head_with_berries";
  MinecraftBlockTypes2["Chain"] = "minecraft:chain";
  MinecraftBlockTypes2["ChainCommandBlock"] = "minecraft:chain_command_block";
  MinecraftBlockTypes2["ChemicalHeat"] = "minecraft:chemical_heat";
  MinecraftBlockTypes2["CherryButton"] = "minecraft:cherry_button";
  MinecraftBlockTypes2["CherryDoor"] = "minecraft:cherry_door";
  MinecraftBlockTypes2["CherryDoubleSlab"] = "minecraft:cherry_double_slab";
  MinecraftBlockTypes2["CherryFence"] = "minecraft:cherry_fence";
  MinecraftBlockTypes2["CherryFenceGate"] = "minecraft:cherry_fence_gate";
  MinecraftBlockTypes2["CherryHangingSign"] = "minecraft:cherry_hanging_sign";
  MinecraftBlockTypes2["CherryLeaves"] = "minecraft:cherry_leaves";
  MinecraftBlockTypes2["CherryLog"] = "minecraft:cherry_log";
  MinecraftBlockTypes2["CherryPlanks"] = "minecraft:cherry_planks";
  MinecraftBlockTypes2["CherryPressurePlate"] = "minecraft:cherry_pressure_plate";
  MinecraftBlockTypes2["CherrySapling"] = "minecraft:cherry_sapling";
  MinecraftBlockTypes2["CherrySlab"] = "minecraft:cherry_slab";
  MinecraftBlockTypes2["CherryStairs"] = "minecraft:cherry_stairs";
  MinecraftBlockTypes2["CherryStandingSign"] = "minecraft:cherry_standing_sign";
  MinecraftBlockTypes2["CherryTrapdoor"] = "minecraft:cherry_trapdoor";
  MinecraftBlockTypes2["CherryWallSign"] = "minecraft:cherry_wall_sign";
  MinecraftBlockTypes2["CherryWood"] = "minecraft:cherry_wood";
  MinecraftBlockTypes2["Chest"] = "minecraft:chest";
  MinecraftBlockTypes2["ChippedAnvil"] = "minecraft:chipped_anvil";
  MinecraftBlockTypes2["ChiseledBookshelf"] = "minecraft:chiseled_bookshelf";
  MinecraftBlockTypes2["ChiseledCopper"] = "minecraft:chiseled_copper";
  MinecraftBlockTypes2["ChiseledDeepslate"] = "minecraft:chiseled_deepslate";
  MinecraftBlockTypes2["ChiseledNetherBricks"] = "minecraft:chiseled_nether_bricks";
  MinecraftBlockTypes2["ChiseledPolishedBlackstone"] = "minecraft:chiseled_polished_blackstone";
  MinecraftBlockTypes2["ChiseledQuartzBlock"] = "minecraft:chiseled_quartz_block";
  MinecraftBlockTypes2["ChiseledRedSandstone"] = "minecraft:chiseled_red_sandstone";
  MinecraftBlockTypes2["ChiseledResinBricks"] = "minecraft:chiseled_resin_bricks";
  MinecraftBlockTypes2["ChiseledSandstone"] = "minecraft:chiseled_sandstone";
  MinecraftBlockTypes2["ChiseledStoneBricks"] = "minecraft:chiseled_stone_bricks";
  MinecraftBlockTypes2["ChiseledTuff"] = "minecraft:chiseled_tuff";
  MinecraftBlockTypes2["ChiseledTuffBricks"] = "minecraft:chiseled_tuff_bricks";
  MinecraftBlockTypes2["ChorusFlower"] = "minecraft:chorus_flower";
  MinecraftBlockTypes2["ChorusPlant"] = "minecraft:chorus_plant";
  MinecraftBlockTypes2["Clay"] = "minecraft:clay";
  MinecraftBlockTypes2["ClosedEyeblossom"] = "minecraft:closed_eyeblossom";
  MinecraftBlockTypes2["CoalBlock"] = "minecraft:coal_block";
  MinecraftBlockTypes2["CoalOre"] = "minecraft:coal_ore";
  MinecraftBlockTypes2["CoarseDirt"] = "minecraft:coarse_dirt";
  MinecraftBlockTypes2["CobbledDeepslate"] = "minecraft:cobbled_deepslate";
  MinecraftBlockTypes2["CobbledDeepslateDoubleSlab"] = "minecraft:cobbled_deepslate_double_slab";
  MinecraftBlockTypes2["CobbledDeepslateSlab"] = "minecraft:cobbled_deepslate_slab";
  MinecraftBlockTypes2["CobbledDeepslateStairs"] = "minecraft:cobbled_deepslate_stairs";
  MinecraftBlockTypes2["CobbledDeepslateWall"] = "minecraft:cobbled_deepslate_wall";
  MinecraftBlockTypes2["Cobblestone"] = "minecraft:cobblestone";
  MinecraftBlockTypes2["CobblestoneDoubleSlab"] = "minecraft:cobblestone_double_slab";
  MinecraftBlockTypes2["CobblestoneSlab"] = "minecraft:cobblestone_slab";
  MinecraftBlockTypes2["CobblestoneWall"] = "minecraft:cobblestone_wall";
  MinecraftBlockTypes2["Cocoa"] = "minecraft:cocoa";
  MinecraftBlockTypes2["ColoredTorchBlue"] = "minecraft:colored_torch_blue";
  MinecraftBlockTypes2["ColoredTorchGreen"] = "minecraft:colored_torch_green";
  MinecraftBlockTypes2["ColoredTorchPurple"] = "minecraft:colored_torch_purple";
  MinecraftBlockTypes2["ColoredTorchRed"] = "minecraft:colored_torch_red";
  MinecraftBlockTypes2["CommandBlock"] = "minecraft:command_block";
  MinecraftBlockTypes2["Composter"] = "minecraft:composter";
  MinecraftBlockTypes2["CompoundCreator"] = "minecraft:compound_creator";
  MinecraftBlockTypes2["Conduit"] = "minecraft:conduit";
  MinecraftBlockTypes2["CopperBlock"] = "minecraft:copper_block";
  MinecraftBlockTypes2["CopperBulb"] = "minecraft:copper_bulb";
  MinecraftBlockTypes2["CopperDoor"] = "minecraft:copper_door";
  MinecraftBlockTypes2["CopperGrate"] = "minecraft:copper_grate";
  MinecraftBlockTypes2["CopperOre"] = "minecraft:copper_ore";
  MinecraftBlockTypes2["CopperTrapdoor"] = "minecraft:copper_trapdoor";
  MinecraftBlockTypes2["Cornflower"] = "minecraft:cornflower";
  MinecraftBlockTypes2["CrackedDeepslateBricks"] = "minecraft:cracked_deepslate_bricks";
  MinecraftBlockTypes2["CrackedDeepslateTiles"] = "minecraft:cracked_deepslate_tiles";
  MinecraftBlockTypes2["CrackedNetherBricks"] = "minecraft:cracked_nether_bricks";
  MinecraftBlockTypes2["CrackedPolishedBlackstoneBricks"] = "minecraft:cracked_polished_blackstone_bricks";
  MinecraftBlockTypes2["CrackedStoneBricks"] = "minecraft:cracked_stone_bricks";
  MinecraftBlockTypes2["Crafter"] = "minecraft:crafter";
  MinecraftBlockTypes2["CraftingTable"] = "minecraft:crafting_table";
  MinecraftBlockTypes2["CreakingHeart"] = "minecraft:creaking_heart";
  MinecraftBlockTypes2["CreeperHead"] = "minecraft:creeper_head";
  MinecraftBlockTypes2["CrimsonButton"] = "minecraft:crimson_button";
  MinecraftBlockTypes2["CrimsonDoor"] = "minecraft:crimson_door";
  MinecraftBlockTypes2["CrimsonDoubleSlab"] = "minecraft:crimson_double_slab";
  MinecraftBlockTypes2["CrimsonFence"] = "minecraft:crimson_fence";
  MinecraftBlockTypes2["CrimsonFenceGate"] = "minecraft:crimson_fence_gate";
  MinecraftBlockTypes2["CrimsonFungus"] = "minecraft:crimson_fungus";
  MinecraftBlockTypes2["CrimsonHangingSign"] = "minecraft:crimson_hanging_sign";
  MinecraftBlockTypes2["CrimsonHyphae"] = "minecraft:crimson_hyphae";
  MinecraftBlockTypes2["CrimsonNylium"] = "minecraft:crimson_nylium";
  MinecraftBlockTypes2["CrimsonPlanks"] = "minecraft:crimson_planks";
  MinecraftBlockTypes2["CrimsonPressurePlate"] = "minecraft:crimson_pressure_plate";
  MinecraftBlockTypes2["CrimsonRoots"] = "minecraft:crimson_roots";
  MinecraftBlockTypes2["CrimsonSlab"] = "minecraft:crimson_slab";
  MinecraftBlockTypes2["CrimsonStairs"] = "minecraft:crimson_stairs";
  MinecraftBlockTypes2["CrimsonStandingSign"] = "minecraft:crimson_standing_sign";
  MinecraftBlockTypes2["CrimsonStem"] = "minecraft:crimson_stem";
  MinecraftBlockTypes2["CrimsonTrapdoor"] = "minecraft:crimson_trapdoor";
  MinecraftBlockTypes2["CrimsonWallSign"] = "minecraft:crimson_wall_sign";
  MinecraftBlockTypes2["CryingObsidian"] = "minecraft:crying_obsidian";
  MinecraftBlockTypes2["CutCopper"] = "minecraft:cut_copper";
  MinecraftBlockTypes2["CutCopperSlab"] = "minecraft:cut_copper_slab";
  MinecraftBlockTypes2["CutCopperStairs"] = "minecraft:cut_copper_stairs";
  MinecraftBlockTypes2["CutRedSandstone"] = "minecraft:cut_red_sandstone";
  MinecraftBlockTypes2["CutRedSandstoneDoubleSlab"] = "minecraft:cut_red_sandstone_double_slab";
  MinecraftBlockTypes2["CutRedSandstoneSlab"] = "minecraft:cut_red_sandstone_slab";
  MinecraftBlockTypes2["CutSandstone"] = "minecraft:cut_sandstone";
  MinecraftBlockTypes2["CutSandstoneDoubleSlab"] = "minecraft:cut_sandstone_double_slab";
  MinecraftBlockTypes2["CutSandstoneSlab"] = "minecraft:cut_sandstone_slab";
  MinecraftBlockTypes2["CyanCandle"] = "minecraft:cyan_candle";
  MinecraftBlockTypes2["CyanCandleCake"] = "minecraft:cyan_candle_cake";
  MinecraftBlockTypes2["CyanCarpet"] = "minecraft:cyan_carpet";
  MinecraftBlockTypes2["CyanConcrete"] = "minecraft:cyan_concrete";
  MinecraftBlockTypes2["CyanConcretePowder"] = "minecraft:cyan_concrete_powder";
  MinecraftBlockTypes2["CyanGlazedTerracotta"] = "minecraft:cyan_glazed_terracotta";
  MinecraftBlockTypes2["CyanShulkerBox"] = "minecraft:cyan_shulker_box";
  MinecraftBlockTypes2["CyanStainedGlass"] = "minecraft:cyan_stained_glass";
  MinecraftBlockTypes2["CyanStainedGlassPane"] = "minecraft:cyan_stained_glass_pane";
  MinecraftBlockTypes2["CyanTerracotta"] = "minecraft:cyan_terracotta";
  MinecraftBlockTypes2["CyanWool"] = "minecraft:cyan_wool";
  MinecraftBlockTypes2["DamagedAnvil"] = "minecraft:damaged_anvil";
  MinecraftBlockTypes2["Dandelion"] = "minecraft:dandelion";
  MinecraftBlockTypes2["DarkOakButton"] = "minecraft:dark_oak_button";
  MinecraftBlockTypes2["DarkOakDoor"] = "minecraft:dark_oak_door";
  MinecraftBlockTypes2["DarkOakDoubleSlab"] = "minecraft:dark_oak_double_slab";
  MinecraftBlockTypes2["DarkOakFence"] = "minecraft:dark_oak_fence";
  MinecraftBlockTypes2["DarkOakFenceGate"] = "minecraft:dark_oak_fence_gate";
  MinecraftBlockTypes2["DarkOakHangingSign"] = "minecraft:dark_oak_hanging_sign";
  MinecraftBlockTypes2["DarkOakLeaves"] = "minecraft:dark_oak_leaves";
  MinecraftBlockTypes2["DarkOakLog"] = "minecraft:dark_oak_log";
  MinecraftBlockTypes2["DarkOakPlanks"] = "minecraft:dark_oak_planks";
  MinecraftBlockTypes2["DarkOakPressurePlate"] = "minecraft:dark_oak_pressure_plate";
  MinecraftBlockTypes2["DarkOakSapling"] = "minecraft:dark_oak_sapling";
  MinecraftBlockTypes2["DarkOakSlab"] = "minecraft:dark_oak_slab";
  MinecraftBlockTypes2["DarkOakStairs"] = "minecraft:dark_oak_stairs";
  MinecraftBlockTypes2["DarkOakTrapdoor"] = "minecraft:dark_oak_trapdoor";
  MinecraftBlockTypes2["DarkOakWood"] = "minecraft:dark_oak_wood";
  MinecraftBlockTypes2["DarkPrismarine"] = "minecraft:dark_prismarine";
  MinecraftBlockTypes2["DarkPrismarineDoubleSlab"] = "minecraft:dark_prismarine_double_slab";
  MinecraftBlockTypes2["DarkPrismarineSlab"] = "minecraft:dark_prismarine_slab";
  MinecraftBlockTypes2["DarkPrismarineStairs"] = "minecraft:dark_prismarine_stairs";
  MinecraftBlockTypes2["DarkoakStandingSign"] = "minecraft:darkoak_standing_sign";
  MinecraftBlockTypes2["DarkoakWallSign"] = "minecraft:darkoak_wall_sign";
  MinecraftBlockTypes2["DaylightDetector"] = "minecraft:daylight_detector";
  MinecraftBlockTypes2["DaylightDetectorInverted"] = "minecraft:daylight_detector_inverted";
  MinecraftBlockTypes2["DeadBrainCoral"] = "minecraft:dead_brain_coral";
  MinecraftBlockTypes2["DeadBrainCoralBlock"] = "minecraft:dead_brain_coral_block";
  MinecraftBlockTypes2["DeadBrainCoralFan"] = "minecraft:dead_brain_coral_fan";
  MinecraftBlockTypes2["DeadBrainCoralWallFan"] = "minecraft:dead_brain_coral_wall_fan";
  MinecraftBlockTypes2["DeadBubbleCoral"] = "minecraft:dead_bubble_coral";
  MinecraftBlockTypes2["DeadBubbleCoralBlock"] = "minecraft:dead_bubble_coral_block";
  MinecraftBlockTypes2["DeadBubbleCoralFan"] = "minecraft:dead_bubble_coral_fan";
  MinecraftBlockTypes2["DeadBubbleCoralWallFan"] = "minecraft:dead_bubble_coral_wall_fan";
  MinecraftBlockTypes2["DeadFireCoral"] = "minecraft:dead_fire_coral";
  MinecraftBlockTypes2["DeadFireCoralBlock"] = "minecraft:dead_fire_coral_block";
  MinecraftBlockTypes2["DeadFireCoralFan"] = "minecraft:dead_fire_coral_fan";
  MinecraftBlockTypes2["DeadFireCoralWallFan"] = "minecraft:dead_fire_coral_wall_fan";
  MinecraftBlockTypes2["DeadHornCoral"] = "minecraft:dead_horn_coral";
  MinecraftBlockTypes2["DeadHornCoralBlock"] = "minecraft:dead_horn_coral_block";
  MinecraftBlockTypes2["DeadHornCoralFan"] = "minecraft:dead_horn_coral_fan";
  MinecraftBlockTypes2["DeadHornCoralWallFan"] = "minecraft:dead_horn_coral_wall_fan";
  MinecraftBlockTypes2["DeadTubeCoral"] = "minecraft:dead_tube_coral";
  MinecraftBlockTypes2["DeadTubeCoralBlock"] = "minecraft:dead_tube_coral_block";
  MinecraftBlockTypes2["DeadTubeCoralFan"] = "minecraft:dead_tube_coral_fan";
  MinecraftBlockTypes2["DeadTubeCoralWallFan"] = "minecraft:dead_tube_coral_wall_fan";
  MinecraftBlockTypes2["Deadbush"] = "minecraft:deadbush";
  MinecraftBlockTypes2["DecoratedPot"] = "minecraft:decorated_pot";
  MinecraftBlockTypes2["Deepslate"] = "minecraft:deepslate";
  MinecraftBlockTypes2["DeepslateBrickDoubleSlab"] = "minecraft:deepslate_brick_double_slab";
  MinecraftBlockTypes2["DeepslateBrickSlab"] = "minecraft:deepslate_brick_slab";
  MinecraftBlockTypes2["DeepslateBrickStairs"] = "minecraft:deepslate_brick_stairs";
  MinecraftBlockTypes2["DeepslateBrickWall"] = "minecraft:deepslate_brick_wall";
  MinecraftBlockTypes2["DeepslateBricks"] = "minecraft:deepslate_bricks";
  MinecraftBlockTypes2["DeepslateCoalOre"] = "minecraft:deepslate_coal_ore";
  MinecraftBlockTypes2["DeepslateCopperOre"] = "minecraft:deepslate_copper_ore";
  MinecraftBlockTypes2["DeepslateDiamondOre"] = "minecraft:deepslate_diamond_ore";
  MinecraftBlockTypes2["DeepslateEmeraldOre"] = "minecraft:deepslate_emerald_ore";
  MinecraftBlockTypes2["DeepslateGoldOre"] = "minecraft:deepslate_gold_ore";
  MinecraftBlockTypes2["DeepslateIronOre"] = "minecraft:deepslate_iron_ore";
  MinecraftBlockTypes2["DeepslateLapisOre"] = "minecraft:deepslate_lapis_ore";
  MinecraftBlockTypes2["DeepslateRedstoneOre"] = "minecraft:deepslate_redstone_ore";
  MinecraftBlockTypes2["DeepslateTileDoubleSlab"] = "minecraft:deepslate_tile_double_slab";
  MinecraftBlockTypes2["DeepslateTileSlab"] = "minecraft:deepslate_tile_slab";
  MinecraftBlockTypes2["DeepslateTileStairs"] = "minecraft:deepslate_tile_stairs";
  MinecraftBlockTypes2["DeepslateTileWall"] = "minecraft:deepslate_tile_wall";
  MinecraftBlockTypes2["DeepslateTiles"] = "minecraft:deepslate_tiles";
  MinecraftBlockTypes2["Deny"] = "minecraft:deny";
  MinecraftBlockTypes2["DetectorRail"] = "minecraft:detector_rail";
  MinecraftBlockTypes2["DiamondBlock"] = "minecraft:diamond_block";
  MinecraftBlockTypes2["DiamondOre"] = "minecraft:diamond_ore";
  MinecraftBlockTypes2["Diorite"] = "minecraft:diorite";
  MinecraftBlockTypes2["DioriteDoubleSlab"] = "minecraft:diorite_double_slab";
  MinecraftBlockTypes2["DioriteSlab"] = "minecraft:diorite_slab";
  MinecraftBlockTypes2["DioriteStairs"] = "minecraft:diorite_stairs";
  MinecraftBlockTypes2["DioriteWall"] = "minecraft:diorite_wall";
  MinecraftBlockTypes2["Dirt"] = "minecraft:dirt";
  MinecraftBlockTypes2["DirtWithRoots"] = "minecraft:dirt_with_roots";
  MinecraftBlockTypes2["Dispenser"] = "minecraft:dispenser";
  MinecraftBlockTypes2["DoubleCutCopperSlab"] = "minecraft:double_cut_copper_slab";
  MinecraftBlockTypes2["DragonEgg"] = "minecraft:dragon_egg";
  MinecraftBlockTypes2["DragonHead"] = "minecraft:dragon_head";
  MinecraftBlockTypes2["DriedGhast"] = "minecraft:dried_ghast";
  MinecraftBlockTypes2["DriedKelpBlock"] = "minecraft:dried_kelp_block";
  MinecraftBlockTypes2["DripstoneBlock"] = "minecraft:dripstone_block";
  MinecraftBlockTypes2["Dropper"] = "minecraft:dropper";
  MinecraftBlockTypes2["Element0"] = "minecraft:element_0";
  MinecraftBlockTypes2["Element1"] = "minecraft:element_1";
  MinecraftBlockTypes2["Element10"] = "minecraft:element_10";
  MinecraftBlockTypes2["Element100"] = "minecraft:element_100";
  MinecraftBlockTypes2["Element101"] = "minecraft:element_101";
  MinecraftBlockTypes2["Element102"] = "minecraft:element_102";
  MinecraftBlockTypes2["Element103"] = "minecraft:element_103";
  MinecraftBlockTypes2["Element104"] = "minecraft:element_104";
  MinecraftBlockTypes2["Element105"] = "minecraft:element_105";
  MinecraftBlockTypes2["Element106"] = "minecraft:element_106";
  MinecraftBlockTypes2["Element107"] = "minecraft:element_107";
  MinecraftBlockTypes2["Element108"] = "minecraft:element_108";
  MinecraftBlockTypes2["Element109"] = "minecraft:element_109";
  MinecraftBlockTypes2["Element11"] = "minecraft:element_11";
  MinecraftBlockTypes2["Element110"] = "minecraft:element_110";
  MinecraftBlockTypes2["Element111"] = "minecraft:element_111";
  MinecraftBlockTypes2["Element112"] = "minecraft:element_112";
  MinecraftBlockTypes2["Element113"] = "minecraft:element_113";
  MinecraftBlockTypes2["Element114"] = "minecraft:element_114";
  MinecraftBlockTypes2["Element115"] = "minecraft:element_115";
  MinecraftBlockTypes2["Element116"] = "minecraft:element_116";
  MinecraftBlockTypes2["Element117"] = "minecraft:element_117";
  MinecraftBlockTypes2["Element118"] = "minecraft:element_118";
  MinecraftBlockTypes2["Element12"] = "minecraft:element_12";
  MinecraftBlockTypes2["Element13"] = "minecraft:element_13";
  MinecraftBlockTypes2["Element14"] = "minecraft:element_14";
  MinecraftBlockTypes2["Element15"] = "minecraft:element_15";
  MinecraftBlockTypes2["Element16"] = "minecraft:element_16";
  MinecraftBlockTypes2["Element17"] = "minecraft:element_17";
  MinecraftBlockTypes2["Element18"] = "minecraft:element_18";
  MinecraftBlockTypes2["Element19"] = "minecraft:element_19";
  MinecraftBlockTypes2["Element2"] = "minecraft:element_2";
  MinecraftBlockTypes2["Element20"] = "minecraft:element_20";
  MinecraftBlockTypes2["Element21"] = "minecraft:element_21";
  MinecraftBlockTypes2["Element22"] = "minecraft:element_22";
  MinecraftBlockTypes2["Element23"] = "minecraft:element_23";
  MinecraftBlockTypes2["Element24"] = "minecraft:element_24";
  MinecraftBlockTypes2["Element25"] = "minecraft:element_25";
  MinecraftBlockTypes2["Element26"] = "minecraft:element_26";
  MinecraftBlockTypes2["Element27"] = "minecraft:element_27";
  MinecraftBlockTypes2["Element28"] = "minecraft:element_28";
  MinecraftBlockTypes2["Element29"] = "minecraft:element_29";
  MinecraftBlockTypes2["Element3"] = "minecraft:element_3";
  MinecraftBlockTypes2["Element30"] = "minecraft:element_30";
  MinecraftBlockTypes2["Element31"] = "minecraft:element_31";
  MinecraftBlockTypes2["Element32"] = "minecraft:element_32";
  MinecraftBlockTypes2["Element33"] = "minecraft:element_33";
  MinecraftBlockTypes2["Element34"] = "minecraft:element_34";
  MinecraftBlockTypes2["Element35"] = "minecraft:element_35";
  MinecraftBlockTypes2["Element36"] = "minecraft:element_36";
  MinecraftBlockTypes2["Element37"] = "minecraft:element_37";
  MinecraftBlockTypes2["Element38"] = "minecraft:element_38";
  MinecraftBlockTypes2["Element39"] = "minecraft:element_39";
  MinecraftBlockTypes2["Element4"] = "minecraft:element_4";
  MinecraftBlockTypes2["Element40"] = "minecraft:element_40";
  MinecraftBlockTypes2["Element41"] = "minecraft:element_41";
  MinecraftBlockTypes2["Element42"] = "minecraft:element_42";
  MinecraftBlockTypes2["Element43"] = "minecraft:element_43";
  MinecraftBlockTypes2["Element44"] = "minecraft:element_44";
  MinecraftBlockTypes2["Element45"] = "minecraft:element_45";
  MinecraftBlockTypes2["Element46"] = "minecraft:element_46";
  MinecraftBlockTypes2["Element47"] = "minecraft:element_47";
  MinecraftBlockTypes2["Element48"] = "minecraft:element_48";
  MinecraftBlockTypes2["Element49"] = "minecraft:element_49";
  MinecraftBlockTypes2["Element5"] = "minecraft:element_5";
  MinecraftBlockTypes2["Element50"] = "minecraft:element_50";
  MinecraftBlockTypes2["Element51"] = "minecraft:element_51";
  MinecraftBlockTypes2["Element52"] = "minecraft:element_52";
  MinecraftBlockTypes2["Element53"] = "minecraft:element_53";
  MinecraftBlockTypes2["Element54"] = "minecraft:element_54";
  MinecraftBlockTypes2["Element55"] = "minecraft:element_55";
  MinecraftBlockTypes2["Element56"] = "minecraft:element_56";
  MinecraftBlockTypes2["Element57"] = "minecraft:element_57";
  MinecraftBlockTypes2["Element58"] = "minecraft:element_58";
  MinecraftBlockTypes2["Element59"] = "minecraft:element_59";
  MinecraftBlockTypes2["Element6"] = "minecraft:element_6";
  MinecraftBlockTypes2["Element60"] = "minecraft:element_60";
  MinecraftBlockTypes2["Element61"] = "minecraft:element_61";
  MinecraftBlockTypes2["Element62"] = "minecraft:element_62";
  MinecraftBlockTypes2["Element63"] = "minecraft:element_63";
  MinecraftBlockTypes2["Element64"] = "minecraft:element_64";
  MinecraftBlockTypes2["Element65"] = "minecraft:element_65";
  MinecraftBlockTypes2["Element66"] = "minecraft:element_66";
  MinecraftBlockTypes2["Element67"] = "minecraft:element_67";
  MinecraftBlockTypes2["Element68"] = "minecraft:element_68";
  MinecraftBlockTypes2["Element69"] = "minecraft:element_69";
  MinecraftBlockTypes2["Element7"] = "minecraft:element_7";
  MinecraftBlockTypes2["Element70"] = "minecraft:element_70";
  MinecraftBlockTypes2["Element71"] = "minecraft:element_71";
  MinecraftBlockTypes2["Element72"] = "minecraft:element_72";
  MinecraftBlockTypes2["Element73"] = "minecraft:element_73";
  MinecraftBlockTypes2["Element74"] = "minecraft:element_74";
  MinecraftBlockTypes2["Element75"] = "minecraft:element_75";
  MinecraftBlockTypes2["Element76"] = "minecraft:element_76";
  MinecraftBlockTypes2["Element77"] = "minecraft:element_77";
  MinecraftBlockTypes2["Element78"] = "minecraft:element_78";
  MinecraftBlockTypes2["Element79"] = "minecraft:element_79";
  MinecraftBlockTypes2["Element8"] = "minecraft:element_8";
  MinecraftBlockTypes2["Element80"] = "minecraft:element_80";
  MinecraftBlockTypes2["Element81"] = "minecraft:element_81";
  MinecraftBlockTypes2["Element82"] = "minecraft:element_82";
  MinecraftBlockTypes2["Element83"] = "minecraft:element_83";
  MinecraftBlockTypes2["Element84"] = "minecraft:element_84";
  MinecraftBlockTypes2["Element85"] = "minecraft:element_85";
  MinecraftBlockTypes2["Element86"] = "minecraft:element_86";
  MinecraftBlockTypes2["Element87"] = "minecraft:element_87";
  MinecraftBlockTypes2["Element88"] = "minecraft:element_88";
  MinecraftBlockTypes2["Element89"] = "minecraft:element_89";
  MinecraftBlockTypes2["Element9"] = "minecraft:element_9";
  MinecraftBlockTypes2["Element90"] = "minecraft:element_90";
  MinecraftBlockTypes2["Element91"] = "minecraft:element_91";
  MinecraftBlockTypes2["Element92"] = "minecraft:element_92";
  MinecraftBlockTypes2["Element93"] = "minecraft:element_93";
  MinecraftBlockTypes2["Element94"] = "minecraft:element_94";
  MinecraftBlockTypes2["Element95"] = "minecraft:element_95";
  MinecraftBlockTypes2["Element96"] = "minecraft:element_96";
  MinecraftBlockTypes2["Element97"] = "minecraft:element_97";
  MinecraftBlockTypes2["Element98"] = "minecraft:element_98";
  MinecraftBlockTypes2["Element99"] = "minecraft:element_99";
  MinecraftBlockTypes2["ElementConstructor"] = "minecraft:element_constructor";
  MinecraftBlockTypes2["EmeraldBlock"] = "minecraft:emerald_block";
  MinecraftBlockTypes2["EmeraldOre"] = "minecraft:emerald_ore";
  MinecraftBlockTypes2["EnchantingTable"] = "minecraft:enchanting_table";
  MinecraftBlockTypes2["EndBrickStairs"] = "minecraft:end_brick_stairs";
  MinecraftBlockTypes2["EndBricks"] = "minecraft:end_bricks";
  MinecraftBlockTypes2["EndPortal"] = "minecraft:end_portal";
  MinecraftBlockTypes2["EndPortalFrame"] = "minecraft:end_portal_frame";
  MinecraftBlockTypes2["EndRod"] = "minecraft:end_rod";
  MinecraftBlockTypes2["EndStone"] = "minecraft:end_stone";
  MinecraftBlockTypes2["EndStoneBrickDoubleSlab"] = "minecraft:end_stone_brick_double_slab";
  MinecraftBlockTypes2["EndStoneBrickSlab"] = "minecraft:end_stone_brick_slab";
  MinecraftBlockTypes2["EndStoneBrickWall"] = "minecraft:end_stone_brick_wall";
  MinecraftBlockTypes2["EnderChest"] = "minecraft:ender_chest";
  MinecraftBlockTypes2["ExposedChiseledCopper"] = "minecraft:exposed_chiseled_copper";
  MinecraftBlockTypes2["ExposedCopper"] = "minecraft:exposed_copper";
  MinecraftBlockTypes2["ExposedCopperBulb"] = "minecraft:exposed_copper_bulb";
  MinecraftBlockTypes2["ExposedCopperDoor"] = "minecraft:exposed_copper_door";
  MinecraftBlockTypes2["ExposedCopperGrate"] = "minecraft:exposed_copper_grate";
  MinecraftBlockTypes2["ExposedCopperTrapdoor"] = "minecraft:exposed_copper_trapdoor";
  MinecraftBlockTypes2["ExposedCutCopper"] = "minecraft:exposed_cut_copper";
  MinecraftBlockTypes2["ExposedCutCopperSlab"] = "minecraft:exposed_cut_copper_slab";
  MinecraftBlockTypes2["ExposedCutCopperStairs"] = "minecraft:exposed_cut_copper_stairs";
  MinecraftBlockTypes2["ExposedDoubleCutCopperSlab"] = "minecraft:exposed_double_cut_copper_slab";
  MinecraftBlockTypes2["Farmland"] = "minecraft:farmland";
  MinecraftBlockTypes2["FenceGate"] = "minecraft:fence_gate";
  MinecraftBlockTypes2["Fern"] = "minecraft:fern";
  MinecraftBlockTypes2["Fire"] = "minecraft:fire";
  MinecraftBlockTypes2["FireCoral"] = "minecraft:fire_coral";
  MinecraftBlockTypes2["FireCoralBlock"] = "minecraft:fire_coral_block";
  MinecraftBlockTypes2["FireCoralFan"] = "minecraft:fire_coral_fan";
  MinecraftBlockTypes2["FireCoralWallFan"] = "minecraft:fire_coral_wall_fan";
  MinecraftBlockTypes2["FireflyBush"] = "minecraft:firefly_bush";
  MinecraftBlockTypes2["FletchingTable"] = "minecraft:fletching_table";
  MinecraftBlockTypes2["FlowerPot"] = "minecraft:flower_pot";
  MinecraftBlockTypes2["FloweringAzalea"] = "minecraft:flowering_azalea";
  MinecraftBlockTypes2["FlowingLava"] = "minecraft:flowing_lava";
  MinecraftBlockTypes2["FlowingWater"] = "minecraft:flowing_water";
  MinecraftBlockTypes2["Frame"] = "minecraft:frame";
  MinecraftBlockTypes2["FrogSpawn"] = "minecraft:frog_spawn";
  MinecraftBlockTypes2["FrostedIce"] = "minecraft:frosted_ice";
  MinecraftBlockTypes2["Furnace"] = "minecraft:furnace";
  MinecraftBlockTypes2["GildedBlackstone"] = "minecraft:gilded_blackstone";
  MinecraftBlockTypes2["Glass"] = "minecraft:glass";
  MinecraftBlockTypes2["GlassPane"] = "minecraft:glass_pane";
  MinecraftBlockTypes2["GlowFrame"] = "minecraft:glow_frame";
  MinecraftBlockTypes2["GlowLichen"] = "minecraft:glow_lichen";
  MinecraftBlockTypes2["Glowstone"] = "minecraft:glowstone";
  MinecraftBlockTypes2["GoldBlock"] = "minecraft:gold_block";
  MinecraftBlockTypes2["GoldOre"] = "minecraft:gold_ore";
  MinecraftBlockTypes2["GoldenRail"] = "minecraft:golden_rail";
  MinecraftBlockTypes2["Granite"] = "minecraft:granite";
  MinecraftBlockTypes2["GraniteDoubleSlab"] = "minecraft:granite_double_slab";
  MinecraftBlockTypes2["GraniteSlab"] = "minecraft:granite_slab";
  MinecraftBlockTypes2["GraniteStairs"] = "minecraft:granite_stairs";
  MinecraftBlockTypes2["GraniteWall"] = "minecraft:granite_wall";
  MinecraftBlockTypes2["GrassBlock"] = "minecraft:grass_block";
  MinecraftBlockTypes2["GrassPath"] = "minecraft:grass_path";
  MinecraftBlockTypes2["Gravel"] = "minecraft:gravel";
  MinecraftBlockTypes2["GrayCandle"] = "minecraft:gray_candle";
  MinecraftBlockTypes2["GrayCandleCake"] = "minecraft:gray_candle_cake";
  MinecraftBlockTypes2["GrayCarpet"] = "minecraft:gray_carpet";
  MinecraftBlockTypes2["GrayConcrete"] = "minecraft:gray_concrete";
  MinecraftBlockTypes2["GrayConcretePowder"] = "minecraft:gray_concrete_powder";
  MinecraftBlockTypes2["GrayGlazedTerracotta"] = "minecraft:gray_glazed_terracotta";
  MinecraftBlockTypes2["GrayShulkerBox"] = "minecraft:gray_shulker_box";
  MinecraftBlockTypes2["GrayStainedGlass"] = "minecraft:gray_stained_glass";
  MinecraftBlockTypes2["GrayStainedGlassPane"] = "minecraft:gray_stained_glass_pane";
  MinecraftBlockTypes2["GrayTerracotta"] = "minecraft:gray_terracotta";
  MinecraftBlockTypes2["GrayWool"] = "minecraft:gray_wool";
  MinecraftBlockTypes2["GreenCandle"] = "minecraft:green_candle";
  MinecraftBlockTypes2["GreenCandleCake"] = "minecraft:green_candle_cake";
  MinecraftBlockTypes2["GreenCarpet"] = "minecraft:green_carpet";
  MinecraftBlockTypes2["GreenConcrete"] = "minecraft:green_concrete";
  MinecraftBlockTypes2["GreenConcretePowder"] = "minecraft:green_concrete_powder";
  MinecraftBlockTypes2["GreenGlazedTerracotta"] = "minecraft:green_glazed_terracotta";
  MinecraftBlockTypes2["GreenShulkerBox"] = "minecraft:green_shulker_box";
  MinecraftBlockTypes2["GreenStainedGlass"] = "minecraft:green_stained_glass";
  MinecraftBlockTypes2["GreenStainedGlassPane"] = "minecraft:green_stained_glass_pane";
  MinecraftBlockTypes2["GreenTerracotta"] = "minecraft:green_terracotta";
  MinecraftBlockTypes2["GreenWool"] = "minecraft:green_wool";
  MinecraftBlockTypes2["Grindstone"] = "minecraft:grindstone";
  MinecraftBlockTypes2["HangingRoots"] = "minecraft:hanging_roots";
  MinecraftBlockTypes2["HardBlackStainedGlass"] = "minecraft:hard_black_stained_glass";
  MinecraftBlockTypes2["HardBlackStainedGlassPane"] = "minecraft:hard_black_stained_glass_pane";
  MinecraftBlockTypes2["HardBlueStainedGlass"] = "minecraft:hard_blue_stained_glass";
  MinecraftBlockTypes2["HardBlueStainedGlassPane"] = "minecraft:hard_blue_stained_glass_pane";
  MinecraftBlockTypes2["HardBrownStainedGlass"] = "minecraft:hard_brown_stained_glass";
  MinecraftBlockTypes2["HardBrownStainedGlassPane"] = "minecraft:hard_brown_stained_glass_pane";
  MinecraftBlockTypes2["HardCyanStainedGlass"] = "minecraft:hard_cyan_stained_glass";
  MinecraftBlockTypes2["HardCyanStainedGlassPane"] = "minecraft:hard_cyan_stained_glass_pane";
  MinecraftBlockTypes2["HardGlass"] = "minecraft:hard_glass";
  MinecraftBlockTypes2["HardGlassPane"] = "minecraft:hard_glass_pane";
  MinecraftBlockTypes2["HardGrayStainedGlass"] = "minecraft:hard_gray_stained_glass";
  MinecraftBlockTypes2["HardGrayStainedGlassPane"] = "minecraft:hard_gray_stained_glass_pane";
  MinecraftBlockTypes2["HardGreenStainedGlass"] = "minecraft:hard_green_stained_glass";
  MinecraftBlockTypes2["HardGreenStainedGlassPane"] = "minecraft:hard_green_stained_glass_pane";
  MinecraftBlockTypes2["HardLightBlueStainedGlass"] = "minecraft:hard_light_blue_stained_glass";
  MinecraftBlockTypes2["HardLightBlueStainedGlassPane"] = "minecraft:hard_light_blue_stained_glass_pane";
  MinecraftBlockTypes2["HardLightGrayStainedGlass"] = "minecraft:hard_light_gray_stained_glass";
  MinecraftBlockTypes2["HardLightGrayStainedGlassPane"] = "minecraft:hard_light_gray_stained_glass_pane";
  MinecraftBlockTypes2["HardLimeStainedGlass"] = "minecraft:hard_lime_stained_glass";
  MinecraftBlockTypes2["HardLimeStainedGlassPane"] = "minecraft:hard_lime_stained_glass_pane";
  MinecraftBlockTypes2["HardMagentaStainedGlass"] = "minecraft:hard_magenta_stained_glass";
  MinecraftBlockTypes2["HardMagentaStainedGlassPane"] = "minecraft:hard_magenta_stained_glass_pane";
  MinecraftBlockTypes2["HardOrangeStainedGlass"] = "minecraft:hard_orange_stained_glass";
  MinecraftBlockTypes2["HardOrangeStainedGlassPane"] = "minecraft:hard_orange_stained_glass_pane";
  MinecraftBlockTypes2["HardPinkStainedGlass"] = "minecraft:hard_pink_stained_glass";
  MinecraftBlockTypes2["HardPinkStainedGlassPane"] = "minecraft:hard_pink_stained_glass_pane";
  MinecraftBlockTypes2["HardPurpleStainedGlass"] = "minecraft:hard_purple_stained_glass";
  MinecraftBlockTypes2["HardPurpleStainedGlassPane"] = "minecraft:hard_purple_stained_glass_pane";
  MinecraftBlockTypes2["HardRedStainedGlass"] = "minecraft:hard_red_stained_glass";
  MinecraftBlockTypes2["HardRedStainedGlassPane"] = "minecraft:hard_red_stained_glass_pane";
  MinecraftBlockTypes2["HardWhiteStainedGlass"] = "minecraft:hard_white_stained_glass";
  MinecraftBlockTypes2["HardWhiteStainedGlassPane"] = "minecraft:hard_white_stained_glass_pane";
  MinecraftBlockTypes2["HardYellowStainedGlass"] = "minecraft:hard_yellow_stained_glass";
  MinecraftBlockTypes2["HardYellowStainedGlassPane"] = "minecraft:hard_yellow_stained_glass_pane";
  MinecraftBlockTypes2["HardenedClay"] = "minecraft:hardened_clay";
  MinecraftBlockTypes2["HayBlock"] = "minecraft:hay_block";
  MinecraftBlockTypes2["HeavyCore"] = "minecraft:heavy_core";
  MinecraftBlockTypes2["HeavyWeightedPressurePlate"] = "minecraft:heavy_weighted_pressure_plate";
  MinecraftBlockTypes2["HoneyBlock"] = "minecraft:honey_block";
  MinecraftBlockTypes2["HoneycombBlock"] = "minecraft:honeycomb_block";
  MinecraftBlockTypes2["Hopper"] = "minecraft:hopper";
  MinecraftBlockTypes2["HornCoral"] = "minecraft:horn_coral";
  MinecraftBlockTypes2["HornCoralBlock"] = "minecraft:horn_coral_block";
  MinecraftBlockTypes2["HornCoralFan"] = "minecraft:horn_coral_fan";
  MinecraftBlockTypes2["HornCoralWallFan"] = "minecraft:horn_coral_wall_fan";
  MinecraftBlockTypes2["Ice"] = "minecraft:ice";
  MinecraftBlockTypes2["InfestedChiseledStoneBricks"] = "minecraft:infested_chiseled_stone_bricks";
  MinecraftBlockTypes2["InfestedCobblestone"] = "minecraft:infested_cobblestone";
  MinecraftBlockTypes2["InfestedCrackedStoneBricks"] = "minecraft:infested_cracked_stone_bricks";
  MinecraftBlockTypes2["InfestedDeepslate"] = "minecraft:infested_deepslate";
  MinecraftBlockTypes2["InfestedMossyStoneBricks"] = "minecraft:infested_mossy_stone_bricks";
  MinecraftBlockTypes2["InfestedStone"] = "minecraft:infested_stone";
  MinecraftBlockTypes2["InfestedStoneBricks"] = "minecraft:infested_stone_bricks";
  MinecraftBlockTypes2["IronBars"] = "minecraft:iron_bars";
  MinecraftBlockTypes2["IronBlock"] = "minecraft:iron_block";
  MinecraftBlockTypes2["IronDoor"] = "minecraft:iron_door";
  MinecraftBlockTypes2["IronOre"] = "minecraft:iron_ore";
  MinecraftBlockTypes2["IronTrapdoor"] = "minecraft:iron_trapdoor";
  MinecraftBlockTypes2["Jigsaw"] = "minecraft:jigsaw";
  MinecraftBlockTypes2["Jukebox"] = "minecraft:jukebox";
  MinecraftBlockTypes2["JungleButton"] = "minecraft:jungle_button";
  MinecraftBlockTypes2["JungleDoor"] = "minecraft:jungle_door";
  MinecraftBlockTypes2["JungleDoubleSlab"] = "minecraft:jungle_double_slab";
  MinecraftBlockTypes2["JungleFence"] = "minecraft:jungle_fence";
  MinecraftBlockTypes2["JungleFenceGate"] = "minecraft:jungle_fence_gate";
  MinecraftBlockTypes2["JungleHangingSign"] = "minecraft:jungle_hanging_sign";
  MinecraftBlockTypes2["JungleLeaves"] = "minecraft:jungle_leaves";
  MinecraftBlockTypes2["JungleLog"] = "minecraft:jungle_log";
  MinecraftBlockTypes2["JunglePlanks"] = "minecraft:jungle_planks";
  MinecraftBlockTypes2["JunglePressurePlate"] = "minecraft:jungle_pressure_plate";
  MinecraftBlockTypes2["JungleSapling"] = "minecraft:jungle_sapling";
  MinecraftBlockTypes2["JungleSlab"] = "minecraft:jungle_slab";
  MinecraftBlockTypes2["JungleStairs"] = "minecraft:jungle_stairs";
  MinecraftBlockTypes2["JungleStandingSign"] = "minecraft:jungle_standing_sign";
  MinecraftBlockTypes2["JungleTrapdoor"] = "minecraft:jungle_trapdoor";
  MinecraftBlockTypes2["JungleWallSign"] = "minecraft:jungle_wall_sign";
  MinecraftBlockTypes2["JungleWood"] = "minecraft:jungle_wood";
  MinecraftBlockTypes2["Kelp"] = "minecraft:kelp";
  MinecraftBlockTypes2["LabTable"] = "minecraft:lab_table";
  MinecraftBlockTypes2["Ladder"] = "minecraft:ladder";
  MinecraftBlockTypes2["Lantern"] = "minecraft:lantern";
  MinecraftBlockTypes2["LapisBlock"] = "minecraft:lapis_block";
  MinecraftBlockTypes2["LapisOre"] = "minecraft:lapis_ore";
  MinecraftBlockTypes2["LargeAmethystBud"] = "minecraft:large_amethyst_bud";
  MinecraftBlockTypes2["LargeFern"] = "minecraft:large_fern";
  MinecraftBlockTypes2["Lava"] = "minecraft:lava";
  MinecraftBlockTypes2["LeafLitter"] = "minecraft:leaf_litter";
  MinecraftBlockTypes2["Lectern"] = "minecraft:lectern";
  MinecraftBlockTypes2["Lever"] = "minecraft:lever";
  MinecraftBlockTypes2["LightBlock0"] = "minecraft:light_block_0";
  MinecraftBlockTypes2["LightBlock1"] = "minecraft:light_block_1";
  MinecraftBlockTypes2["LightBlock10"] = "minecraft:light_block_10";
  MinecraftBlockTypes2["LightBlock11"] = "minecraft:light_block_11";
  MinecraftBlockTypes2["LightBlock12"] = "minecraft:light_block_12";
  MinecraftBlockTypes2["LightBlock13"] = "minecraft:light_block_13";
  MinecraftBlockTypes2["LightBlock14"] = "minecraft:light_block_14";
  MinecraftBlockTypes2["LightBlock15"] = "minecraft:light_block_15";
  MinecraftBlockTypes2["LightBlock2"] = "minecraft:light_block_2";
  MinecraftBlockTypes2["LightBlock3"] = "minecraft:light_block_3";
  MinecraftBlockTypes2["LightBlock4"] = "minecraft:light_block_4";
  MinecraftBlockTypes2["LightBlock5"] = "minecraft:light_block_5";
  MinecraftBlockTypes2["LightBlock6"] = "minecraft:light_block_6";
  MinecraftBlockTypes2["LightBlock7"] = "minecraft:light_block_7";
  MinecraftBlockTypes2["LightBlock8"] = "minecraft:light_block_8";
  MinecraftBlockTypes2["LightBlock9"] = "minecraft:light_block_9";
  MinecraftBlockTypes2["LightBlueCandle"] = "minecraft:light_blue_candle";
  MinecraftBlockTypes2["LightBlueCandleCake"] = "minecraft:light_blue_candle_cake";
  MinecraftBlockTypes2["LightBlueCarpet"] = "minecraft:light_blue_carpet";
  MinecraftBlockTypes2["LightBlueConcrete"] = "minecraft:light_blue_concrete";
  MinecraftBlockTypes2["LightBlueConcretePowder"] = "minecraft:light_blue_concrete_powder";
  MinecraftBlockTypes2["LightBlueGlazedTerracotta"] = "minecraft:light_blue_glazed_terracotta";
  MinecraftBlockTypes2["LightBlueShulkerBox"] = "minecraft:light_blue_shulker_box";
  MinecraftBlockTypes2["LightBlueStainedGlass"] = "minecraft:light_blue_stained_glass";
  MinecraftBlockTypes2["LightBlueStainedGlassPane"] = "minecraft:light_blue_stained_glass_pane";
  MinecraftBlockTypes2["LightBlueTerracotta"] = "minecraft:light_blue_terracotta";
  MinecraftBlockTypes2["LightBlueWool"] = "minecraft:light_blue_wool";
  MinecraftBlockTypes2["LightGrayCandle"] = "minecraft:light_gray_candle";
  MinecraftBlockTypes2["LightGrayCandleCake"] = "minecraft:light_gray_candle_cake";
  MinecraftBlockTypes2["LightGrayCarpet"] = "minecraft:light_gray_carpet";
  MinecraftBlockTypes2["LightGrayConcrete"] = "minecraft:light_gray_concrete";
  MinecraftBlockTypes2["LightGrayConcretePowder"] = "minecraft:light_gray_concrete_powder";
  MinecraftBlockTypes2["LightGrayShulkerBox"] = "minecraft:light_gray_shulker_box";
  MinecraftBlockTypes2["LightGrayStainedGlass"] = "minecraft:light_gray_stained_glass";
  MinecraftBlockTypes2["LightGrayStainedGlassPane"] = "minecraft:light_gray_stained_glass_pane";
  MinecraftBlockTypes2["LightGrayTerracotta"] = "minecraft:light_gray_terracotta";
  MinecraftBlockTypes2["LightGrayWool"] = "minecraft:light_gray_wool";
  MinecraftBlockTypes2["LightWeightedPressurePlate"] = "minecraft:light_weighted_pressure_plate";
  MinecraftBlockTypes2["LightningRod"] = "minecraft:lightning_rod";
  MinecraftBlockTypes2["Lilac"] = "minecraft:lilac";
  MinecraftBlockTypes2["LilyOfTheValley"] = "minecraft:lily_of_the_valley";
  MinecraftBlockTypes2["LimeCandle"] = "minecraft:lime_candle";
  MinecraftBlockTypes2["LimeCandleCake"] = "minecraft:lime_candle_cake";
  MinecraftBlockTypes2["LimeCarpet"] = "minecraft:lime_carpet";
  MinecraftBlockTypes2["LimeConcrete"] = "minecraft:lime_concrete";
  MinecraftBlockTypes2["LimeConcretePowder"] = "minecraft:lime_concrete_powder";
  MinecraftBlockTypes2["LimeGlazedTerracotta"] = "minecraft:lime_glazed_terracotta";
  MinecraftBlockTypes2["LimeShulkerBox"] = "minecraft:lime_shulker_box";
  MinecraftBlockTypes2["LimeStainedGlass"] = "minecraft:lime_stained_glass";
  MinecraftBlockTypes2["LimeStainedGlassPane"] = "minecraft:lime_stained_glass_pane";
  MinecraftBlockTypes2["LimeTerracotta"] = "minecraft:lime_terracotta";
  MinecraftBlockTypes2["LimeWool"] = "minecraft:lime_wool";
  MinecraftBlockTypes2["LitBlastFurnace"] = "minecraft:lit_blast_furnace";
  MinecraftBlockTypes2["LitDeepslateRedstoneOre"] = "minecraft:lit_deepslate_redstone_ore";
  MinecraftBlockTypes2["LitFurnace"] = "minecraft:lit_furnace";
  MinecraftBlockTypes2["LitPumpkin"] = "minecraft:lit_pumpkin";
  MinecraftBlockTypes2["LitRedstoneLamp"] = "minecraft:lit_redstone_lamp";
  MinecraftBlockTypes2["LitRedstoneOre"] = "minecraft:lit_redstone_ore";
  MinecraftBlockTypes2["LitSmoker"] = "minecraft:lit_smoker";
  MinecraftBlockTypes2["Lodestone"] = "minecraft:lodestone";
  MinecraftBlockTypes2["Loom"] = "minecraft:loom";
  MinecraftBlockTypes2["MagentaCandle"] = "minecraft:magenta_candle";
  MinecraftBlockTypes2["MagentaCandleCake"] = "minecraft:magenta_candle_cake";
  MinecraftBlockTypes2["MagentaCarpet"] = "minecraft:magenta_carpet";
  MinecraftBlockTypes2["MagentaConcrete"] = "minecraft:magenta_concrete";
  MinecraftBlockTypes2["MagentaConcretePowder"] = "minecraft:magenta_concrete_powder";
  MinecraftBlockTypes2["MagentaGlazedTerracotta"] = "minecraft:magenta_glazed_terracotta";
  MinecraftBlockTypes2["MagentaShulkerBox"] = "minecraft:magenta_shulker_box";
  MinecraftBlockTypes2["MagentaStainedGlass"] = "minecraft:magenta_stained_glass";
  MinecraftBlockTypes2["MagentaStainedGlassPane"] = "minecraft:magenta_stained_glass_pane";
  MinecraftBlockTypes2["MagentaTerracotta"] = "minecraft:magenta_terracotta";
  MinecraftBlockTypes2["MagentaWool"] = "minecraft:magenta_wool";
  MinecraftBlockTypes2["Magma"] = "minecraft:magma";
  MinecraftBlockTypes2["MangroveButton"] = "minecraft:mangrove_button";
  MinecraftBlockTypes2["MangroveDoor"] = "minecraft:mangrove_door";
  MinecraftBlockTypes2["MangroveDoubleSlab"] = "minecraft:mangrove_double_slab";
  MinecraftBlockTypes2["MangroveFence"] = "minecraft:mangrove_fence";
  MinecraftBlockTypes2["MangroveFenceGate"] = "minecraft:mangrove_fence_gate";
  MinecraftBlockTypes2["MangroveHangingSign"] = "minecraft:mangrove_hanging_sign";
  MinecraftBlockTypes2["MangroveLeaves"] = "minecraft:mangrove_leaves";
  MinecraftBlockTypes2["MangroveLog"] = "minecraft:mangrove_log";
  MinecraftBlockTypes2["MangrovePlanks"] = "minecraft:mangrove_planks";
  MinecraftBlockTypes2["MangrovePressurePlate"] = "minecraft:mangrove_pressure_plate";
  MinecraftBlockTypes2["MangrovePropagule"] = "minecraft:mangrove_propagule";
  MinecraftBlockTypes2["MangroveRoots"] = "minecraft:mangrove_roots";
  MinecraftBlockTypes2["MangroveSlab"] = "minecraft:mangrove_slab";
  MinecraftBlockTypes2["MangroveStairs"] = "minecraft:mangrove_stairs";
  MinecraftBlockTypes2["MangroveStandingSign"] = "minecraft:mangrove_standing_sign";
  MinecraftBlockTypes2["MangroveTrapdoor"] = "minecraft:mangrove_trapdoor";
  MinecraftBlockTypes2["MangroveWallSign"] = "minecraft:mangrove_wall_sign";
  MinecraftBlockTypes2["MangroveWood"] = "minecraft:mangrove_wood";
  MinecraftBlockTypes2["MaterialReducer"] = "minecraft:material_reducer";
  MinecraftBlockTypes2["MediumAmethystBud"] = "minecraft:medium_amethyst_bud";
  MinecraftBlockTypes2["MelonBlock"] = "minecraft:melon_block";
  MinecraftBlockTypes2["MelonStem"] = "minecraft:melon_stem";
  MinecraftBlockTypes2["MobSpawner"] = "minecraft:mob_spawner";
  MinecraftBlockTypes2["MossBlock"] = "minecraft:moss_block";
  MinecraftBlockTypes2["MossCarpet"] = "minecraft:moss_carpet";
  MinecraftBlockTypes2["MossyCobblestone"] = "minecraft:mossy_cobblestone";
  MinecraftBlockTypes2["MossyCobblestoneDoubleSlab"] = "minecraft:mossy_cobblestone_double_slab";
  MinecraftBlockTypes2["MossyCobblestoneSlab"] = "minecraft:mossy_cobblestone_slab";
  MinecraftBlockTypes2["MossyCobblestoneStairs"] = "minecraft:mossy_cobblestone_stairs";
  MinecraftBlockTypes2["MossyCobblestoneWall"] = "minecraft:mossy_cobblestone_wall";
  MinecraftBlockTypes2["MossyStoneBrickDoubleSlab"] = "minecraft:mossy_stone_brick_double_slab";
  MinecraftBlockTypes2["MossyStoneBrickSlab"] = "minecraft:mossy_stone_brick_slab";
  MinecraftBlockTypes2["MossyStoneBrickStairs"] = "minecraft:mossy_stone_brick_stairs";
  MinecraftBlockTypes2["MossyStoneBrickWall"] = "minecraft:mossy_stone_brick_wall";
  MinecraftBlockTypes2["MossyStoneBricks"] = "minecraft:mossy_stone_bricks";
  MinecraftBlockTypes2["Mud"] = "minecraft:mud";
  MinecraftBlockTypes2["MudBrickDoubleSlab"] = "minecraft:mud_brick_double_slab";
  MinecraftBlockTypes2["MudBrickSlab"] = "minecraft:mud_brick_slab";
  MinecraftBlockTypes2["MudBrickStairs"] = "minecraft:mud_brick_stairs";
  MinecraftBlockTypes2["MudBrickWall"] = "minecraft:mud_brick_wall";
  MinecraftBlockTypes2["MudBricks"] = "minecraft:mud_bricks";
  MinecraftBlockTypes2["MuddyMangroveRoots"] = "minecraft:muddy_mangrove_roots";
  MinecraftBlockTypes2["MushroomStem"] = "minecraft:mushroom_stem";
  MinecraftBlockTypes2["Mycelium"] = "minecraft:mycelium";
  MinecraftBlockTypes2["NetherBrick"] = "minecraft:nether_brick";
  MinecraftBlockTypes2["NetherBrickDoubleSlab"] = "minecraft:nether_brick_double_slab";
  MinecraftBlockTypes2["NetherBrickFence"] = "minecraft:nether_brick_fence";
  MinecraftBlockTypes2["NetherBrickSlab"] = "minecraft:nether_brick_slab";
  MinecraftBlockTypes2["NetherBrickStairs"] = "minecraft:nether_brick_stairs";
  MinecraftBlockTypes2["NetherBrickWall"] = "minecraft:nether_brick_wall";
  MinecraftBlockTypes2["NetherGoldOre"] = "minecraft:nether_gold_ore";
  MinecraftBlockTypes2["NetherSprouts"] = "minecraft:nether_sprouts";
  MinecraftBlockTypes2["NetherWart"] = "minecraft:nether_wart";
  MinecraftBlockTypes2["NetherWartBlock"] = "minecraft:nether_wart_block";
  MinecraftBlockTypes2["NetheriteBlock"] = "minecraft:netherite_block";
  MinecraftBlockTypes2["Netherrack"] = "minecraft:netherrack";
  MinecraftBlockTypes2["NormalStoneDoubleSlab"] = "minecraft:normal_stone_double_slab";
  MinecraftBlockTypes2["NormalStoneSlab"] = "minecraft:normal_stone_slab";
  MinecraftBlockTypes2["NormalStoneStairs"] = "minecraft:normal_stone_stairs";
  MinecraftBlockTypes2["Noteblock"] = "minecraft:noteblock";
  MinecraftBlockTypes2["OakDoubleSlab"] = "minecraft:oak_double_slab";
  MinecraftBlockTypes2["OakFence"] = "minecraft:oak_fence";
  MinecraftBlockTypes2["OakHangingSign"] = "minecraft:oak_hanging_sign";
  MinecraftBlockTypes2["OakLeaves"] = "minecraft:oak_leaves";
  MinecraftBlockTypes2["OakLog"] = "minecraft:oak_log";
  MinecraftBlockTypes2["OakPlanks"] = "minecraft:oak_planks";
  MinecraftBlockTypes2["OakSapling"] = "minecraft:oak_sapling";
  MinecraftBlockTypes2["OakSlab"] = "minecraft:oak_slab";
  MinecraftBlockTypes2["OakStairs"] = "minecraft:oak_stairs";
  MinecraftBlockTypes2["OakWood"] = "minecraft:oak_wood";
  MinecraftBlockTypes2["Observer"] = "minecraft:observer";
  MinecraftBlockTypes2["Obsidian"] = "minecraft:obsidian";
  MinecraftBlockTypes2["OchreFroglight"] = "minecraft:ochre_froglight";
  MinecraftBlockTypes2["OpenEyeblossom"] = "minecraft:open_eyeblossom";
  MinecraftBlockTypes2["OrangeCandle"] = "minecraft:orange_candle";
  MinecraftBlockTypes2["OrangeCandleCake"] = "minecraft:orange_candle_cake";
  MinecraftBlockTypes2["OrangeCarpet"] = "minecraft:orange_carpet";
  MinecraftBlockTypes2["OrangeConcrete"] = "minecraft:orange_concrete";
  MinecraftBlockTypes2["OrangeConcretePowder"] = "minecraft:orange_concrete_powder";
  MinecraftBlockTypes2["OrangeGlazedTerracotta"] = "minecraft:orange_glazed_terracotta";
  MinecraftBlockTypes2["OrangeShulkerBox"] = "minecraft:orange_shulker_box";
  MinecraftBlockTypes2["OrangeStainedGlass"] = "minecraft:orange_stained_glass";
  MinecraftBlockTypes2["OrangeStainedGlassPane"] = "minecraft:orange_stained_glass_pane";
  MinecraftBlockTypes2["OrangeTerracotta"] = "minecraft:orange_terracotta";
  MinecraftBlockTypes2["OrangeTulip"] = "minecraft:orange_tulip";
  MinecraftBlockTypes2["OrangeWool"] = "minecraft:orange_wool";
  MinecraftBlockTypes2["OxeyeDaisy"] = "minecraft:oxeye_daisy";
  MinecraftBlockTypes2["OxidizedChiseledCopper"] = "minecraft:oxidized_chiseled_copper";
  MinecraftBlockTypes2["OxidizedCopper"] = "minecraft:oxidized_copper";
  MinecraftBlockTypes2["OxidizedCopperBulb"] = "minecraft:oxidized_copper_bulb";
  MinecraftBlockTypes2["OxidizedCopperDoor"] = "minecraft:oxidized_copper_door";
  MinecraftBlockTypes2["OxidizedCopperGrate"] = "minecraft:oxidized_copper_grate";
  MinecraftBlockTypes2["OxidizedCopperTrapdoor"] = "minecraft:oxidized_copper_trapdoor";
  MinecraftBlockTypes2["OxidizedCutCopper"] = "minecraft:oxidized_cut_copper";
  MinecraftBlockTypes2["OxidizedCutCopperSlab"] = "minecraft:oxidized_cut_copper_slab";
  MinecraftBlockTypes2["OxidizedCutCopperStairs"] = "minecraft:oxidized_cut_copper_stairs";
  MinecraftBlockTypes2["OxidizedDoubleCutCopperSlab"] = "minecraft:oxidized_double_cut_copper_slab";
  MinecraftBlockTypes2["PackedIce"] = "minecraft:packed_ice";
  MinecraftBlockTypes2["PackedMud"] = "minecraft:packed_mud";
  MinecraftBlockTypes2["PaleHangingMoss"] = "minecraft:pale_hanging_moss";
  MinecraftBlockTypes2["PaleMossBlock"] = "minecraft:pale_moss_block";
  MinecraftBlockTypes2["PaleMossCarpet"] = "minecraft:pale_moss_carpet";
  MinecraftBlockTypes2["PaleOakButton"] = "minecraft:pale_oak_button";
  MinecraftBlockTypes2["PaleOakDoor"] = "minecraft:pale_oak_door";
  MinecraftBlockTypes2["PaleOakDoubleSlab"] = "minecraft:pale_oak_double_slab";
  MinecraftBlockTypes2["PaleOakFence"] = "minecraft:pale_oak_fence";
  MinecraftBlockTypes2["PaleOakFenceGate"] = "minecraft:pale_oak_fence_gate";
  MinecraftBlockTypes2["PaleOakHangingSign"] = "minecraft:pale_oak_hanging_sign";
  MinecraftBlockTypes2["PaleOakLeaves"] = "minecraft:pale_oak_leaves";
  MinecraftBlockTypes2["PaleOakLog"] = "minecraft:pale_oak_log";
  MinecraftBlockTypes2["PaleOakPlanks"] = "minecraft:pale_oak_planks";
  MinecraftBlockTypes2["PaleOakPressurePlate"] = "minecraft:pale_oak_pressure_plate";
  MinecraftBlockTypes2["PaleOakSapling"] = "minecraft:pale_oak_sapling";
  MinecraftBlockTypes2["PaleOakSlab"] = "minecraft:pale_oak_slab";
  MinecraftBlockTypes2["PaleOakStairs"] = "minecraft:pale_oak_stairs";
  MinecraftBlockTypes2["PaleOakStandingSign"] = "minecraft:pale_oak_standing_sign";
  MinecraftBlockTypes2["PaleOakTrapdoor"] = "minecraft:pale_oak_trapdoor";
  MinecraftBlockTypes2["PaleOakWallSign"] = "minecraft:pale_oak_wall_sign";
  MinecraftBlockTypes2["PaleOakWood"] = "minecraft:pale_oak_wood";
  MinecraftBlockTypes2["PearlescentFroglight"] = "minecraft:pearlescent_froglight";
  MinecraftBlockTypes2["Peony"] = "minecraft:peony";
  MinecraftBlockTypes2["PetrifiedOakDoubleSlab"] = "minecraft:petrified_oak_double_slab";
  MinecraftBlockTypes2["PetrifiedOakSlab"] = "minecraft:petrified_oak_slab";
  MinecraftBlockTypes2["PiglinHead"] = "minecraft:piglin_head";
  MinecraftBlockTypes2["PinkCandle"] = "minecraft:pink_candle";
  MinecraftBlockTypes2["PinkCandleCake"] = "minecraft:pink_candle_cake";
  MinecraftBlockTypes2["PinkCarpet"] = "minecraft:pink_carpet";
  MinecraftBlockTypes2["PinkConcrete"] = "minecraft:pink_concrete";
  MinecraftBlockTypes2["PinkConcretePowder"] = "minecraft:pink_concrete_powder";
  MinecraftBlockTypes2["PinkGlazedTerracotta"] = "minecraft:pink_glazed_terracotta";
  MinecraftBlockTypes2["PinkPetals"] = "minecraft:pink_petals";
  MinecraftBlockTypes2["PinkShulkerBox"] = "minecraft:pink_shulker_box";
  MinecraftBlockTypes2["PinkStainedGlass"] = "minecraft:pink_stained_glass";
  MinecraftBlockTypes2["PinkStainedGlassPane"] = "minecraft:pink_stained_glass_pane";
  MinecraftBlockTypes2["PinkTerracotta"] = "minecraft:pink_terracotta";
  MinecraftBlockTypes2["PinkTulip"] = "minecraft:pink_tulip";
  MinecraftBlockTypes2["PinkWool"] = "minecraft:pink_wool";
  MinecraftBlockTypes2["Piston"] = "minecraft:piston";
  MinecraftBlockTypes2["PistonArmCollision"] = "minecraft:piston_arm_collision";
  MinecraftBlockTypes2["PitcherCrop"] = "minecraft:pitcher_crop";
  MinecraftBlockTypes2["PitcherPlant"] = "minecraft:pitcher_plant";
  MinecraftBlockTypes2["PlayerHead"] = "minecraft:player_head";
  MinecraftBlockTypes2["Podzol"] = "minecraft:podzol";
  MinecraftBlockTypes2["PointedDripstone"] = "minecraft:pointed_dripstone";
  MinecraftBlockTypes2["PolishedAndesite"] = "minecraft:polished_andesite";
  MinecraftBlockTypes2["PolishedAndesiteDoubleSlab"] = "minecraft:polished_andesite_double_slab";
  MinecraftBlockTypes2["PolishedAndesiteSlab"] = "minecraft:polished_andesite_slab";
  MinecraftBlockTypes2["PolishedAndesiteStairs"] = "minecraft:polished_andesite_stairs";
  MinecraftBlockTypes2["PolishedBasalt"] = "minecraft:polished_basalt";
  MinecraftBlockTypes2["PolishedBlackstone"] = "minecraft:polished_blackstone";
  MinecraftBlockTypes2["PolishedBlackstoneBrickDoubleSlab"] = "minecraft:polished_blackstone_brick_double_slab";
  MinecraftBlockTypes2["PolishedBlackstoneBrickSlab"] = "minecraft:polished_blackstone_brick_slab";
  MinecraftBlockTypes2["PolishedBlackstoneBrickStairs"] = "minecraft:polished_blackstone_brick_stairs";
  MinecraftBlockTypes2["PolishedBlackstoneBrickWall"] = "minecraft:polished_blackstone_brick_wall";
  MinecraftBlockTypes2["PolishedBlackstoneBricks"] = "minecraft:polished_blackstone_bricks";
  MinecraftBlockTypes2["PolishedBlackstoneButton"] = "minecraft:polished_blackstone_button";
  MinecraftBlockTypes2["PolishedBlackstoneDoubleSlab"] = "minecraft:polished_blackstone_double_slab";
  MinecraftBlockTypes2["PolishedBlackstonePressurePlate"] = "minecraft:polished_blackstone_pressure_plate";
  MinecraftBlockTypes2["PolishedBlackstoneSlab"] = "minecraft:polished_blackstone_slab";
  MinecraftBlockTypes2["PolishedBlackstoneStairs"] = "minecraft:polished_blackstone_stairs";
  MinecraftBlockTypes2["PolishedBlackstoneWall"] = "minecraft:polished_blackstone_wall";
  MinecraftBlockTypes2["PolishedDeepslate"] = "minecraft:polished_deepslate";
  MinecraftBlockTypes2["PolishedDeepslateDoubleSlab"] = "minecraft:polished_deepslate_double_slab";
  MinecraftBlockTypes2["PolishedDeepslateSlab"] = "minecraft:polished_deepslate_slab";
  MinecraftBlockTypes2["PolishedDeepslateStairs"] = "minecraft:polished_deepslate_stairs";
  MinecraftBlockTypes2["PolishedDeepslateWall"] = "minecraft:polished_deepslate_wall";
  MinecraftBlockTypes2["PolishedDiorite"] = "minecraft:polished_diorite";
  MinecraftBlockTypes2["PolishedDioriteDoubleSlab"] = "minecraft:polished_diorite_double_slab";
  MinecraftBlockTypes2["PolishedDioriteSlab"] = "minecraft:polished_diorite_slab";
  MinecraftBlockTypes2["PolishedDioriteStairs"] = "minecraft:polished_diorite_stairs";
  MinecraftBlockTypes2["PolishedGranite"] = "minecraft:polished_granite";
  MinecraftBlockTypes2["PolishedGraniteDoubleSlab"] = "minecraft:polished_granite_double_slab";
  MinecraftBlockTypes2["PolishedGraniteSlab"] = "minecraft:polished_granite_slab";
  MinecraftBlockTypes2["PolishedGraniteStairs"] = "minecraft:polished_granite_stairs";
  MinecraftBlockTypes2["PolishedTuff"] = "minecraft:polished_tuff";
  MinecraftBlockTypes2["PolishedTuffDoubleSlab"] = "minecraft:polished_tuff_double_slab";
  MinecraftBlockTypes2["PolishedTuffSlab"] = "minecraft:polished_tuff_slab";
  MinecraftBlockTypes2["PolishedTuffStairs"] = "minecraft:polished_tuff_stairs";
  MinecraftBlockTypes2["PolishedTuffWall"] = "minecraft:polished_tuff_wall";
  MinecraftBlockTypes2["Poppy"] = "minecraft:poppy";
  MinecraftBlockTypes2["Portal"] = "minecraft:portal";
  MinecraftBlockTypes2["Potatoes"] = "minecraft:potatoes";
  MinecraftBlockTypes2["PowderSnow"] = "minecraft:powder_snow";
  MinecraftBlockTypes2["PoweredComparator"] = "minecraft:powered_comparator";
  MinecraftBlockTypes2["PoweredRepeater"] = "minecraft:powered_repeater";
  MinecraftBlockTypes2["Prismarine"] = "minecraft:prismarine";
  MinecraftBlockTypes2["PrismarineBrickDoubleSlab"] = "minecraft:prismarine_brick_double_slab";
  MinecraftBlockTypes2["PrismarineBrickSlab"] = "minecraft:prismarine_brick_slab";
  MinecraftBlockTypes2["PrismarineBricks"] = "minecraft:prismarine_bricks";
  MinecraftBlockTypes2["PrismarineBricksStairs"] = "minecraft:prismarine_bricks_stairs";
  MinecraftBlockTypes2["PrismarineDoubleSlab"] = "minecraft:prismarine_double_slab";
  MinecraftBlockTypes2["PrismarineSlab"] = "minecraft:prismarine_slab";
  MinecraftBlockTypes2["PrismarineStairs"] = "minecraft:prismarine_stairs";
  MinecraftBlockTypes2["PrismarineWall"] = "minecraft:prismarine_wall";
  MinecraftBlockTypes2["Pumpkin"] = "minecraft:pumpkin";
  MinecraftBlockTypes2["PumpkinStem"] = "minecraft:pumpkin_stem";
  MinecraftBlockTypes2["PurpleCandle"] = "minecraft:purple_candle";
  MinecraftBlockTypes2["PurpleCandleCake"] = "minecraft:purple_candle_cake";
  MinecraftBlockTypes2["PurpleCarpet"] = "minecraft:purple_carpet";
  MinecraftBlockTypes2["PurpleConcrete"] = "minecraft:purple_concrete";
  MinecraftBlockTypes2["PurpleConcretePowder"] = "minecraft:purple_concrete_powder";
  MinecraftBlockTypes2["PurpleGlazedTerracotta"] = "minecraft:purple_glazed_terracotta";
  MinecraftBlockTypes2["PurpleShulkerBox"] = "minecraft:purple_shulker_box";
  MinecraftBlockTypes2["PurpleStainedGlass"] = "minecraft:purple_stained_glass";
  MinecraftBlockTypes2["PurpleStainedGlassPane"] = "minecraft:purple_stained_glass_pane";
  MinecraftBlockTypes2["PurpleTerracotta"] = "minecraft:purple_terracotta";
  MinecraftBlockTypes2["PurpleWool"] = "minecraft:purple_wool";
  MinecraftBlockTypes2["PurpurBlock"] = "minecraft:purpur_block";
  MinecraftBlockTypes2["PurpurDoubleSlab"] = "minecraft:purpur_double_slab";
  MinecraftBlockTypes2["PurpurPillar"] = "minecraft:purpur_pillar";
  MinecraftBlockTypes2["PurpurSlab"] = "minecraft:purpur_slab";
  MinecraftBlockTypes2["PurpurStairs"] = "minecraft:purpur_stairs";
  MinecraftBlockTypes2["QuartzBlock"] = "minecraft:quartz_block";
  MinecraftBlockTypes2["QuartzBricks"] = "minecraft:quartz_bricks";
  MinecraftBlockTypes2["QuartzDoubleSlab"] = "minecraft:quartz_double_slab";
  MinecraftBlockTypes2["QuartzOre"] = "minecraft:quartz_ore";
  MinecraftBlockTypes2["QuartzPillar"] = "minecraft:quartz_pillar";
  MinecraftBlockTypes2["QuartzSlab"] = "minecraft:quartz_slab";
  MinecraftBlockTypes2["QuartzStairs"] = "minecraft:quartz_stairs";
  MinecraftBlockTypes2["Rail"] = "minecraft:rail";
  MinecraftBlockTypes2["RawCopperBlock"] = "minecraft:raw_copper_block";
  MinecraftBlockTypes2["RawGoldBlock"] = "minecraft:raw_gold_block";
  MinecraftBlockTypes2["RawIronBlock"] = "minecraft:raw_iron_block";
  MinecraftBlockTypes2["RedCandle"] = "minecraft:red_candle";
  MinecraftBlockTypes2["RedCandleCake"] = "minecraft:red_candle_cake";
  MinecraftBlockTypes2["RedCarpet"] = "minecraft:red_carpet";
  MinecraftBlockTypes2["RedConcrete"] = "minecraft:red_concrete";
  MinecraftBlockTypes2["RedConcretePowder"] = "minecraft:red_concrete_powder";
  MinecraftBlockTypes2["RedGlazedTerracotta"] = "minecraft:red_glazed_terracotta";
  MinecraftBlockTypes2["RedMushroom"] = "minecraft:red_mushroom";
  MinecraftBlockTypes2["RedMushroomBlock"] = "minecraft:red_mushroom_block";
  MinecraftBlockTypes2["RedNetherBrick"] = "minecraft:red_nether_brick";
  MinecraftBlockTypes2["RedNetherBrickDoubleSlab"] = "minecraft:red_nether_brick_double_slab";
  MinecraftBlockTypes2["RedNetherBrickSlab"] = "minecraft:red_nether_brick_slab";
  MinecraftBlockTypes2["RedNetherBrickStairs"] = "minecraft:red_nether_brick_stairs";
  MinecraftBlockTypes2["RedNetherBrickWall"] = "minecraft:red_nether_brick_wall";
  MinecraftBlockTypes2["RedSand"] = "minecraft:red_sand";
  MinecraftBlockTypes2["RedSandstone"] = "minecraft:red_sandstone";
  MinecraftBlockTypes2["RedSandstoneDoubleSlab"] = "minecraft:red_sandstone_double_slab";
  MinecraftBlockTypes2["RedSandstoneSlab"] = "minecraft:red_sandstone_slab";
  MinecraftBlockTypes2["RedSandstoneStairs"] = "minecraft:red_sandstone_stairs";
  MinecraftBlockTypes2["RedSandstoneWall"] = "minecraft:red_sandstone_wall";
  MinecraftBlockTypes2["RedShulkerBox"] = "minecraft:red_shulker_box";
  MinecraftBlockTypes2["RedStainedGlass"] = "minecraft:red_stained_glass";
  MinecraftBlockTypes2["RedStainedGlassPane"] = "minecraft:red_stained_glass_pane";
  MinecraftBlockTypes2["RedTerracotta"] = "minecraft:red_terracotta";
  MinecraftBlockTypes2["RedTulip"] = "minecraft:red_tulip";
  MinecraftBlockTypes2["RedWool"] = "minecraft:red_wool";
  MinecraftBlockTypes2["RedstoneBlock"] = "minecraft:redstone_block";
  MinecraftBlockTypes2["RedstoneLamp"] = "minecraft:redstone_lamp";
  MinecraftBlockTypes2["RedstoneOre"] = "minecraft:redstone_ore";
  MinecraftBlockTypes2["RedstoneTorch"] = "minecraft:redstone_torch";
  MinecraftBlockTypes2["RedstoneWire"] = "minecraft:redstone_wire";
  MinecraftBlockTypes2["Reeds"] = "minecraft:reeds";
  MinecraftBlockTypes2["ReinforcedDeepslate"] = "minecraft:reinforced_deepslate";
  MinecraftBlockTypes2["RepeatingCommandBlock"] = "minecraft:repeating_command_block";
  MinecraftBlockTypes2["ResinBlock"] = "minecraft:resin_block";
  MinecraftBlockTypes2["ResinBrickDoubleSlab"] = "minecraft:resin_brick_double_slab";
  MinecraftBlockTypes2["ResinBrickSlab"] = "minecraft:resin_brick_slab";
  MinecraftBlockTypes2["ResinBrickStairs"] = "minecraft:resin_brick_stairs";
  MinecraftBlockTypes2["ResinBrickWall"] = "minecraft:resin_brick_wall";
  MinecraftBlockTypes2["ResinBricks"] = "minecraft:resin_bricks";
  MinecraftBlockTypes2["ResinClump"] = "minecraft:resin_clump";
  MinecraftBlockTypes2["RespawnAnchor"] = "minecraft:respawn_anchor";
  MinecraftBlockTypes2["RoseBush"] = "minecraft:rose_bush";
  MinecraftBlockTypes2["Sand"] = "minecraft:sand";
  MinecraftBlockTypes2["Sandstone"] = "minecraft:sandstone";
  MinecraftBlockTypes2["SandstoneDoubleSlab"] = "minecraft:sandstone_double_slab";
  MinecraftBlockTypes2["SandstoneSlab"] = "minecraft:sandstone_slab";
  MinecraftBlockTypes2["SandstoneStairs"] = "minecraft:sandstone_stairs";
  MinecraftBlockTypes2["SandstoneWall"] = "minecraft:sandstone_wall";
  MinecraftBlockTypes2["Scaffolding"] = "minecraft:scaffolding";
  MinecraftBlockTypes2["Sculk"] = "minecraft:sculk";
  MinecraftBlockTypes2["SculkCatalyst"] = "minecraft:sculk_catalyst";
  MinecraftBlockTypes2["SculkSensor"] = "minecraft:sculk_sensor";
  MinecraftBlockTypes2["SculkShrieker"] = "minecraft:sculk_shrieker";
  MinecraftBlockTypes2["SculkVein"] = "minecraft:sculk_vein";
  MinecraftBlockTypes2["SeaLantern"] = "minecraft:sea_lantern";
  MinecraftBlockTypes2["SeaPickle"] = "minecraft:sea_pickle";
  MinecraftBlockTypes2["Seagrass"] = "minecraft:seagrass";
  MinecraftBlockTypes2["ShortDryGrass"] = "minecraft:short_dry_grass";
  MinecraftBlockTypes2["ShortGrass"] = "minecraft:short_grass";
  MinecraftBlockTypes2["Shroomlight"] = "minecraft:shroomlight";
  MinecraftBlockTypes2["SilverGlazedTerracotta"] = "minecraft:silver_glazed_terracotta";
  MinecraftBlockTypes2["SkeletonSkull"] = "minecraft:skeleton_skull";
  MinecraftBlockTypes2["Slime"] = "minecraft:slime";
  MinecraftBlockTypes2["SmallAmethystBud"] = "minecraft:small_amethyst_bud";
  MinecraftBlockTypes2["SmallDripleafBlock"] = "minecraft:small_dripleaf_block";
  MinecraftBlockTypes2["SmithingTable"] = "minecraft:smithing_table";
  MinecraftBlockTypes2["Smoker"] = "minecraft:smoker";
  MinecraftBlockTypes2["SmoothBasalt"] = "minecraft:smooth_basalt";
  MinecraftBlockTypes2["SmoothQuartz"] = "minecraft:smooth_quartz";
  MinecraftBlockTypes2["SmoothQuartzDoubleSlab"] = "minecraft:smooth_quartz_double_slab";
  MinecraftBlockTypes2["SmoothQuartzSlab"] = "minecraft:smooth_quartz_slab";
  MinecraftBlockTypes2["SmoothQuartzStairs"] = "minecraft:smooth_quartz_stairs";
  MinecraftBlockTypes2["SmoothRedSandstone"] = "minecraft:smooth_red_sandstone";
  MinecraftBlockTypes2["SmoothRedSandstoneDoubleSlab"] = "minecraft:smooth_red_sandstone_double_slab";
  MinecraftBlockTypes2["SmoothRedSandstoneSlab"] = "minecraft:smooth_red_sandstone_slab";
  MinecraftBlockTypes2["SmoothRedSandstoneStairs"] = "minecraft:smooth_red_sandstone_stairs";
  MinecraftBlockTypes2["SmoothSandstone"] = "minecraft:smooth_sandstone";
  MinecraftBlockTypes2["SmoothSandstoneDoubleSlab"] = "minecraft:smooth_sandstone_double_slab";
  MinecraftBlockTypes2["SmoothSandstoneSlab"] = "minecraft:smooth_sandstone_slab";
  MinecraftBlockTypes2["SmoothSandstoneStairs"] = "minecraft:smooth_sandstone_stairs";
  MinecraftBlockTypes2["SmoothStone"] = "minecraft:smooth_stone";
  MinecraftBlockTypes2["SmoothStoneDoubleSlab"] = "minecraft:smooth_stone_double_slab";
  MinecraftBlockTypes2["SmoothStoneSlab"] = "minecraft:smooth_stone_slab";
  MinecraftBlockTypes2["SnifferEgg"] = "minecraft:sniffer_egg";
  MinecraftBlockTypes2["Snow"] = "minecraft:snow";
  MinecraftBlockTypes2["SnowLayer"] = "minecraft:snow_layer";
  MinecraftBlockTypes2["SoulCampfire"] = "minecraft:soul_campfire";
  MinecraftBlockTypes2["SoulFire"] = "minecraft:soul_fire";
  MinecraftBlockTypes2["SoulLantern"] = "minecraft:soul_lantern";
  MinecraftBlockTypes2["SoulSand"] = "minecraft:soul_sand";
  MinecraftBlockTypes2["SoulSoil"] = "minecraft:soul_soil";
  MinecraftBlockTypes2["SoulTorch"] = "minecraft:soul_torch";
  MinecraftBlockTypes2["Sponge"] = "minecraft:sponge";
  MinecraftBlockTypes2["SporeBlossom"] = "minecraft:spore_blossom";
  MinecraftBlockTypes2["SpruceButton"] = "minecraft:spruce_button";
  MinecraftBlockTypes2["SpruceDoor"] = "minecraft:spruce_door";
  MinecraftBlockTypes2["SpruceDoubleSlab"] = "minecraft:spruce_double_slab";
  MinecraftBlockTypes2["SpruceFence"] = "minecraft:spruce_fence";
  MinecraftBlockTypes2["SpruceFenceGate"] = "minecraft:spruce_fence_gate";
  MinecraftBlockTypes2["SpruceHangingSign"] = "minecraft:spruce_hanging_sign";
  MinecraftBlockTypes2["SpruceLeaves"] = "minecraft:spruce_leaves";
  MinecraftBlockTypes2["SpruceLog"] = "minecraft:spruce_log";
  MinecraftBlockTypes2["SprucePlanks"] = "minecraft:spruce_planks";
  MinecraftBlockTypes2["SprucePressurePlate"] = "minecraft:spruce_pressure_plate";
  MinecraftBlockTypes2["SpruceSapling"] = "minecraft:spruce_sapling";
  MinecraftBlockTypes2["SpruceSlab"] = "minecraft:spruce_slab";
  MinecraftBlockTypes2["SpruceStairs"] = "minecraft:spruce_stairs";
  MinecraftBlockTypes2["SpruceStandingSign"] = "minecraft:spruce_standing_sign";
  MinecraftBlockTypes2["SpruceTrapdoor"] = "minecraft:spruce_trapdoor";
  MinecraftBlockTypes2["SpruceWallSign"] = "minecraft:spruce_wall_sign";
  MinecraftBlockTypes2["SpruceWood"] = "minecraft:spruce_wood";
  MinecraftBlockTypes2["StandingBanner"] = "minecraft:standing_banner";
  MinecraftBlockTypes2["StandingSign"] = "minecraft:standing_sign";
  MinecraftBlockTypes2["StickyPiston"] = "minecraft:sticky_piston";
  MinecraftBlockTypes2["StickyPistonArmCollision"] = "minecraft:sticky_piston_arm_collision";
  MinecraftBlockTypes2["Stone"] = "minecraft:stone";
  MinecraftBlockTypes2["StoneBrickDoubleSlab"] = "minecraft:stone_brick_double_slab";
  MinecraftBlockTypes2["StoneBrickSlab"] = "minecraft:stone_brick_slab";
  MinecraftBlockTypes2["StoneBrickStairs"] = "minecraft:stone_brick_stairs";
  MinecraftBlockTypes2["StoneBrickWall"] = "minecraft:stone_brick_wall";
  MinecraftBlockTypes2["StoneBricks"] = "minecraft:stone_bricks";
  MinecraftBlockTypes2["StoneButton"] = "minecraft:stone_button";
  MinecraftBlockTypes2["StonePressurePlate"] = "minecraft:stone_pressure_plate";
  MinecraftBlockTypes2["StoneStairs"] = "minecraft:stone_stairs";
  MinecraftBlockTypes2["StonecutterBlock"] = "minecraft:stonecutter_block";
  MinecraftBlockTypes2["StrippedAcaciaLog"] = "minecraft:stripped_acacia_log";
  MinecraftBlockTypes2["StrippedAcaciaWood"] = "minecraft:stripped_acacia_wood";
  MinecraftBlockTypes2["StrippedBambooBlock"] = "minecraft:stripped_bamboo_block";
  MinecraftBlockTypes2["StrippedBirchLog"] = "minecraft:stripped_birch_log";
  MinecraftBlockTypes2["StrippedBirchWood"] = "minecraft:stripped_birch_wood";
  MinecraftBlockTypes2["StrippedCherryLog"] = "minecraft:stripped_cherry_log";
  MinecraftBlockTypes2["StrippedCherryWood"] = "minecraft:stripped_cherry_wood";
  MinecraftBlockTypes2["StrippedCrimsonHyphae"] = "minecraft:stripped_crimson_hyphae";
  MinecraftBlockTypes2["StrippedCrimsonStem"] = "minecraft:stripped_crimson_stem";
  MinecraftBlockTypes2["StrippedDarkOakLog"] = "minecraft:stripped_dark_oak_log";
  MinecraftBlockTypes2["StrippedDarkOakWood"] = "minecraft:stripped_dark_oak_wood";
  MinecraftBlockTypes2["StrippedJungleLog"] = "minecraft:stripped_jungle_log";
  MinecraftBlockTypes2["StrippedJungleWood"] = "minecraft:stripped_jungle_wood";
  MinecraftBlockTypes2["StrippedMangroveLog"] = "minecraft:stripped_mangrove_log";
  MinecraftBlockTypes2["StrippedMangroveWood"] = "minecraft:stripped_mangrove_wood";
  MinecraftBlockTypes2["StrippedOakLog"] = "minecraft:stripped_oak_log";
  MinecraftBlockTypes2["StrippedOakWood"] = "minecraft:stripped_oak_wood";
  MinecraftBlockTypes2["StrippedPaleOakLog"] = "minecraft:stripped_pale_oak_log";
  MinecraftBlockTypes2["StrippedPaleOakWood"] = "minecraft:stripped_pale_oak_wood";
  MinecraftBlockTypes2["StrippedSpruceLog"] = "minecraft:stripped_spruce_log";
  MinecraftBlockTypes2["StrippedSpruceWood"] = "minecraft:stripped_spruce_wood";
  MinecraftBlockTypes2["StrippedWarpedHyphae"] = "minecraft:stripped_warped_hyphae";
  MinecraftBlockTypes2["StrippedWarpedStem"] = "minecraft:stripped_warped_stem";
  MinecraftBlockTypes2["StructureBlock"] = "minecraft:structure_block";
  MinecraftBlockTypes2["StructureVoid"] = "minecraft:structure_void";
  MinecraftBlockTypes2["Sunflower"] = "minecraft:sunflower";
  MinecraftBlockTypes2["SuspiciousGravel"] = "minecraft:suspicious_gravel";
  MinecraftBlockTypes2["SuspiciousSand"] = "minecraft:suspicious_sand";
  MinecraftBlockTypes2["SweetBerryBush"] = "minecraft:sweet_berry_bush";
  MinecraftBlockTypes2["TallDryGrass"] = "minecraft:tall_dry_grass";
  MinecraftBlockTypes2["TallGrass"] = "minecraft:tall_grass";
  MinecraftBlockTypes2["Target"] = "minecraft:target";
  MinecraftBlockTypes2["TintedGlass"] = "minecraft:tinted_glass";
  MinecraftBlockTypes2["Tnt"] = "minecraft:tnt";
  MinecraftBlockTypes2["Torch"] = "minecraft:torch";
  MinecraftBlockTypes2["Torchflower"] = "minecraft:torchflower";
  MinecraftBlockTypes2["TorchflowerCrop"] = "minecraft:torchflower_crop";
  MinecraftBlockTypes2["Trapdoor"] = "minecraft:trapdoor";
  MinecraftBlockTypes2["TrappedChest"] = "minecraft:trapped_chest";
  MinecraftBlockTypes2["TrialSpawner"] = "minecraft:trial_spawner";
  MinecraftBlockTypes2["TripWire"] = "minecraft:trip_wire";
  MinecraftBlockTypes2["TripwireHook"] = "minecraft:tripwire_hook";
  MinecraftBlockTypes2["TubeCoral"] = "minecraft:tube_coral";
  MinecraftBlockTypes2["TubeCoralBlock"] = "minecraft:tube_coral_block";
  MinecraftBlockTypes2["TubeCoralFan"] = "minecraft:tube_coral_fan";
  MinecraftBlockTypes2["TubeCoralWallFan"] = "minecraft:tube_coral_wall_fan";
  MinecraftBlockTypes2["Tuff"] = "minecraft:tuff";
  MinecraftBlockTypes2["TuffBrickDoubleSlab"] = "minecraft:tuff_brick_double_slab";
  MinecraftBlockTypes2["TuffBrickSlab"] = "minecraft:tuff_brick_slab";
  MinecraftBlockTypes2["TuffBrickStairs"] = "minecraft:tuff_brick_stairs";
  MinecraftBlockTypes2["TuffBrickWall"] = "minecraft:tuff_brick_wall";
  MinecraftBlockTypes2["TuffBricks"] = "minecraft:tuff_bricks";
  MinecraftBlockTypes2["TuffDoubleSlab"] = "minecraft:tuff_double_slab";
  MinecraftBlockTypes2["TuffSlab"] = "minecraft:tuff_slab";
  MinecraftBlockTypes2["TuffStairs"] = "minecraft:tuff_stairs";
  MinecraftBlockTypes2["TuffWall"] = "minecraft:tuff_wall";
  MinecraftBlockTypes2["TurtleEgg"] = "minecraft:turtle_egg";
  MinecraftBlockTypes2["TwistingVines"] = "minecraft:twisting_vines";
  MinecraftBlockTypes2["UnderwaterTnt"] = "minecraft:underwater_tnt";
  MinecraftBlockTypes2["UnderwaterTorch"] = "minecraft:underwater_torch";
  MinecraftBlockTypes2["UndyedShulkerBox"] = "minecraft:undyed_shulker_box";
  MinecraftBlockTypes2["Unknown"] = "minecraft:unknown";
  MinecraftBlockTypes2["UnlitRedstoneTorch"] = "minecraft:unlit_redstone_torch";
  MinecraftBlockTypes2["UnpoweredComparator"] = "minecraft:unpowered_comparator";
  MinecraftBlockTypes2["UnpoweredRepeater"] = "minecraft:unpowered_repeater";
  MinecraftBlockTypes2["Vault"] = "minecraft:vault";
  MinecraftBlockTypes2["VerdantFroglight"] = "minecraft:verdant_froglight";
  MinecraftBlockTypes2["Vine"] = "minecraft:vine";
  MinecraftBlockTypes2["WallBanner"] = "minecraft:wall_banner";
  MinecraftBlockTypes2["WallSign"] = "minecraft:wall_sign";
  MinecraftBlockTypes2["WarpedButton"] = "minecraft:warped_button";
  MinecraftBlockTypes2["WarpedDoor"] = "minecraft:warped_door";
  MinecraftBlockTypes2["WarpedDoubleSlab"] = "minecraft:warped_double_slab";
  MinecraftBlockTypes2["WarpedFence"] = "minecraft:warped_fence";
  MinecraftBlockTypes2["WarpedFenceGate"] = "minecraft:warped_fence_gate";
  MinecraftBlockTypes2["WarpedFungus"] = "minecraft:warped_fungus";
  MinecraftBlockTypes2["WarpedHangingSign"] = "minecraft:warped_hanging_sign";
  MinecraftBlockTypes2["WarpedHyphae"] = "minecraft:warped_hyphae";
  MinecraftBlockTypes2["WarpedNylium"] = "minecraft:warped_nylium";
  MinecraftBlockTypes2["WarpedPlanks"] = "minecraft:warped_planks";
  MinecraftBlockTypes2["WarpedPressurePlate"] = "minecraft:warped_pressure_plate";
  MinecraftBlockTypes2["WarpedRoots"] = "minecraft:warped_roots";
  MinecraftBlockTypes2["WarpedSlab"] = "minecraft:warped_slab";
  MinecraftBlockTypes2["WarpedStairs"] = "minecraft:warped_stairs";
  MinecraftBlockTypes2["WarpedStandingSign"] = "minecraft:warped_standing_sign";
  MinecraftBlockTypes2["WarpedStem"] = "minecraft:warped_stem";
  MinecraftBlockTypes2["WarpedTrapdoor"] = "minecraft:warped_trapdoor";
  MinecraftBlockTypes2["WarpedWallSign"] = "minecraft:warped_wall_sign";
  MinecraftBlockTypes2["WarpedWartBlock"] = "minecraft:warped_wart_block";
  MinecraftBlockTypes2["Water"] = "minecraft:water";
  MinecraftBlockTypes2["Waterlily"] = "minecraft:waterlily";
  MinecraftBlockTypes2["WaxedChiseledCopper"] = "minecraft:waxed_chiseled_copper";
  MinecraftBlockTypes2["WaxedCopper"] = "minecraft:waxed_copper";
  MinecraftBlockTypes2["WaxedCopperBulb"] = "minecraft:waxed_copper_bulb";
  MinecraftBlockTypes2["WaxedCopperDoor"] = "minecraft:waxed_copper_door";
  MinecraftBlockTypes2["WaxedCopperGrate"] = "minecraft:waxed_copper_grate";
  MinecraftBlockTypes2["WaxedCopperTrapdoor"] = "minecraft:waxed_copper_trapdoor";
  MinecraftBlockTypes2["WaxedCutCopper"] = "minecraft:waxed_cut_copper";
  MinecraftBlockTypes2["WaxedCutCopperSlab"] = "minecraft:waxed_cut_copper_slab";
  MinecraftBlockTypes2["WaxedCutCopperStairs"] = "minecraft:waxed_cut_copper_stairs";
  MinecraftBlockTypes2["WaxedDoubleCutCopperSlab"] = "minecraft:waxed_double_cut_copper_slab";
  MinecraftBlockTypes2["WaxedExposedChiseledCopper"] = "minecraft:waxed_exposed_chiseled_copper";
  MinecraftBlockTypes2["WaxedExposedCopper"] = "minecraft:waxed_exposed_copper";
  MinecraftBlockTypes2["WaxedExposedCopperBulb"] = "minecraft:waxed_exposed_copper_bulb";
  MinecraftBlockTypes2["WaxedExposedCopperDoor"] = "minecraft:waxed_exposed_copper_door";
  MinecraftBlockTypes2["WaxedExposedCopperGrate"] = "minecraft:waxed_exposed_copper_grate";
  MinecraftBlockTypes2["WaxedExposedCopperTrapdoor"] = "minecraft:waxed_exposed_copper_trapdoor";
  MinecraftBlockTypes2["WaxedExposedCutCopper"] = "minecraft:waxed_exposed_cut_copper";
  MinecraftBlockTypes2["WaxedExposedCutCopperSlab"] = "minecraft:waxed_exposed_cut_copper_slab";
  MinecraftBlockTypes2["WaxedExposedCutCopperStairs"] = "minecraft:waxed_exposed_cut_copper_stairs";
  MinecraftBlockTypes2["WaxedExposedDoubleCutCopperSlab"] = "minecraft:waxed_exposed_double_cut_copper_slab";
  MinecraftBlockTypes2["WaxedOxidizedChiseledCopper"] = "minecraft:waxed_oxidized_chiseled_copper";
  MinecraftBlockTypes2["WaxedOxidizedCopper"] = "minecraft:waxed_oxidized_copper";
  MinecraftBlockTypes2["WaxedOxidizedCopperBulb"] = "minecraft:waxed_oxidized_copper_bulb";
  MinecraftBlockTypes2["WaxedOxidizedCopperDoor"] = "minecraft:waxed_oxidized_copper_door";
  MinecraftBlockTypes2["WaxedOxidizedCopperGrate"] = "minecraft:waxed_oxidized_copper_grate";
  MinecraftBlockTypes2["WaxedOxidizedCopperTrapdoor"] = "minecraft:waxed_oxidized_copper_trapdoor";
  MinecraftBlockTypes2["WaxedOxidizedCutCopper"] = "minecraft:waxed_oxidized_cut_copper";
  MinecraftBlockTypes2["WaxedOxidizedCutCopperSlab"] = "minecraft:waxed_oxidized_cut_copper_slab";
  MinecraftBlockTypes2["WaxedOxidizedCutCopperStairs"] = "minecraft:waxed_oxidized_cut_copper_stairs";
  MinecraftBlockTypes2["WaxedOxidizedDoubleCutCopperSlab"] = "minecraft:waxed_oxidized_double_cut_copper_slab";
  MinecraftBlockTypes2["WaxedWeatheredChiseledCopper"] = "minecraft:waxed_weathered_chiseled_copper";
  MinecraftBlockTypes2["WaxedWeatheredCopper"] = "minecraft:waxed_weathered_copper";
  MinecraftBlockTypes2["WaxedWeatheredCopperBulb"] = "minecraft:waxed_weathered_copper_bulb";
  MinecraftBlockTypes2["WaxedWeatheredCopperDoor"] = "minecraft:waxed_weathered_copper_door";
  MinecraftBlockTypes2["WaxedWeatheredCopperGrate"] = "minecraft:waxed_weathered_copper_grate";
  MinecraftBlockTypes2["WaxedWeatheredCopperTrapdoor"] = "minecraft:waxed_weathered_copper_trapdoor";
  MinecraftBlockTypes2["WaxedWeatheredCutCopper"] = "minecraft:waxed_weathered_cut_copper";
  MinecraftBlockTypes2["WaxedWeatheredCutCopperSlab"] = "minecraft:waxed_weathered_cut_copper_slab";
  MinecraftBlockTypes2["WaxedWeatheredCutCopperStairs"] = "minecraft:waxed_weathered_cut_copper_stairs";
  MinecraftBlockTypes2["WaxedWeatheredDoubleCutCopperSlab"] = "minecraft:waxed_weathered_double_cut_copper_slab";
  MinecraftBlockTypes2["WeatheredChiseledCopper"] = "minecraft:weathered_chiseled_copper";
  MinecraftBlockTypes2["WeatheredCopper"] = "minecraft:weathered_copper";
  MinecraftBlockTypes2["WeatheredCopperBulb"] = "minecraft:weathered_copper_bulb";
  MinecraftBlockTypes2["WeatheredCopperDoor"] = "minecraft:weathered_copper_door";
  MinecraftBlockTypes2["WeatheredCopperGrate"] = "minecraft:weathered_copper_grate";
  MinecraftBlockTypes2["WeatheredCopperTrapdoor"] = "minecraft:weathered_copper_trapdoor";
  MinecraftBlockTypes2["WeatheredCutCopper"] = "minecraft:weathered_cut_copper";
  MinecraftBlockTypes2["WeatheredCutCopperSlab"] = "minecraft:weathered_cut_copper_slab";
  MinecraftBlockTypes2["WeatheredCutCopperStairs"] = "minecraft:weathered_cut_copper_stairs";
  MinecraftBlockTypes2["WeatheredDoubleCutCopperSlab"] = "minecraft:weathered_double_cut_copper_slab";
  MinecraftBlockTypes2["Web"] = "minecraft:web";
  MinecraftBlockTypes2["WeepingVines"] = "minecraft:weeping_vines";
  MinecraftBlockTypes2["WetSponge"] = "minecraft:wet_sponge";
  MinecraftBlockTypes2["Wheat"] = "minecraft:wheat";
  MinecraftBlockTypes2["WhiteCandle"] = "minecraft:white_candle";
  MinecraftBlockTypes2["WhiteCandleCake"] = "minecraft:white_candle_cake";
  MinecraftBlockTypes2["WhiteCarpet"] = "minecraft:white_carpet";
  MinecraftBlockTypes2["WhiteConcrete"] = "minecraft:white_concrete";
  MinecraftBlockTypes2["WhiteConcretePowder"] = "minecraft:white_concrete_powder";
  MinecraftBlockTypes2["WhiteGlazedTerracotta"] = "minecraft:white_glazed_terracotta";
  MinecraftBlockTypes2["WhiteShulkerBox"] = "minecraft:white_shulker_box";
  MinecraftBlockTypes2["WhiteStainedGlass"] = "minecraft:white_stained_glass";
  MinecraftBlockTypes2["WhiteStainedGlassPane"] = "minecraft:white_stained_glass_pane";
  MinecraftBlockTypes2["WhiteTerracotta"] = "minecraft:white_terracotta";
  MinecraftBlockTypes2["WhiteTulip"] = "minecraft:white_tulip";
  MinecraftBlockTypes2["WhiteWool"] = "minecraft:white_wool";
  MinecraftBlockTypes2["Wildflowers"] = "minecraft:wildflowers";
  MinecraftBlockTypes2["WitherRose"] = "minecraft:wither_rose";
  MinecraftBlockTypes2["WitherSkeletonSkull"] = "minecraft:wither_skeleton_skull";
  MinecraftBlockTypes2["WoodenButton"] = "minecraft:wooden_button";
  MinecraftBlockTypes2["WoodenDoor"] = "minecraft:wooden_door";
  MinecraftBlockTypes2["WoodenPressurePlate"] = "minecraft:wooden_pressure_plate";
  MinecraftBlockTypes2["YellowCandle"] = "minecraft:yellow_candle";
  MinecraftBlockTypes2["YellowCandleCake"] = "minecraft:yellow_candle_cake";
  MinecraftBlockTypes2["YellowCarpet"] = "minecraft:yellow_carpet";
  MinecraftBlockTypes2["YellowConcrete"] = "minecraft:yellow_concrete";
  MinecraftBlockTypes2["YellowConcretePowder"] = "minecraft:yellow_concrete_powder";
  MinecraftBlockTypes2["YellowGlazedTerracotta"] = "minecraft:yellow_glazed_terracotta";
  MinecraftBlockTypes2["YellowShulkerBox"] = "minecraft:yellow_shulker_box";
  MinecraftBlockTypes2["YellowStainedGlass"] = "minecraft:yellow_stained_glass";
  MinecraftBlockTypes2["YellowStainedGlassPane"] = "minecraft:yellow_stained_glass_pane";
  MinecraftBlockTypes2["YellowTerracotta"] = "minecraft:yellow_terracotta";
  MinecraftBlockTypes2["YellowWool"] = "minecraft:yellow_wool";
  MinecraftBlockTypes2["ZombieHead"] = "minecraft:zombie_head";
  return MinecraftBlockTypes2;
})(MinecraftBlockTypes || {});
var MinecraftCameraPresetsTypes = ((MinecraftCameraPresetsTypes2) => {
  MinecraftCameraPresetsTypes2["ControlSchemeCamera"] = "minecraft:control_scheme_camera";
  MinecraftCameraPresetsTypes2["FirstPerson"] = "minecraft:first_person";
  MinecraftCameraPresetsTypes2["FixedBoom"] = "minecraft:fixed_boom";
  MinecraftCameraPresetsTypes2["FollowOrbit"] = "minecraft:follow_orbit";
  MinecraftCameraPresetsTypes2["Free"] = "minecraft:free";
  MinecraftCameraPresetsTypes2["ThirdPerson"] = "minecraft:third_person";
  MinecraftCameraPresetsTypes2["ThirdPersonFront"] = "minecraft:third_person_front";
  return MinecraftCameraPresetsTypes2;
})(MinecraftCameraPresetsTypes || {});
var MinecraftCooldownCategoryTypes = ((MinecraftCooldownCategoryTypes2) => {
  MinecraftCooldownCategoryTypes2["Chorusfruit"] = "minecraft:chorusfruit";
  MinecraftCooldownCategoryTypes2["EnderPearl"] = "minecraft:ender_pearl";
  MinecraftCooldownCategoryTypes2["GoatHorn"] = "minecraft:goat_horn";
  MinecraftCooldownCategoryTypes2["Shield"] = "minecraft:shield";
  MinecraftCooldownCategoryTypes2["WindCharge"] = "minecraft:wind_charge";
  return MinecraftCooldownCategoryTypes2;
})(MinecraftCooldownCategoryTypes || {});
var MinecraftDimensionTypes = ((MinecraftDimensionTypes2) => {
  MinecraftDimensionTypes2["Nether"] = "minecraft:nether";
  MinecraftDimensionTypes2["Overworld"] = "minecraft:overworld";
  MinecraftDimensionTypes2["TheEnd"] = "minecraft:the_end";
  return MinecraftDimensionTypes2;
})(MinecraftDimensionTypes || {});
var MinecraftEffectTypes = ((MinecraftEffectTypes2) => {
  MinecraftEffectTypes2["Absorption"] = "minecraft:absorption";
  MinecraftEffectTypes2["BadOmen"] = "minecraft:bad_omen";
  MinecraftEffectTypes2["Blindness"] = "minecraft:blindness";
  MinecraftEffectTypes2["ConduitPower"] = "minecraft:conduit_power";
  MinecraftEffectTypes2["Darkness"] = "minecraft:darkness";
  MinecraftEffectTypes2["FatalPoison"] = "minecraft:fatal_poison";
  MinecraftEffectTypes2["FireResistance"] = "minecraft:fire_resistance";
  MinecraftEffectTypes2["Haste"] = "minecraft:haste";
  MinecraftEffectTypes2["HealthBoost"] = "minecraft:health_boost";
  MinecraftEffectTypes2["Hunger"] = "minecraft:hunger";
  MinecraftEffectTypes2["Infested"] = "minecraft:infested";
  MinecraftEffectTypes2["InstantDamage"] = "minecraft:instant_damage";
  MinecraftEffectTypes2["InstantHealth"] = "minecraft:instant_health";
  MinecraftEffectTypes2["Invisibility"] = "minecraft:invisibility";
  MinecraftEffectTypes2["JumpBoost"] = "minecraft:jump_boost";
  MinecraftEffectTypes2["Levitation"] = "minecraft:levitation";
  MinecraftEffectTypes2["MiningFatigue"] = "minecraft:mining_fatigue";
  MinecraftEffectTypes2["Nausea"] = "minecraft:nausea";
  MinecraftEffectTypes2["NightVision"] = "minecraft:night_vision";
  MinecraftEffectTypes2["Oozing"] = "minecraft:oozing";
  MinecraftEffectTypes2["Poison"] = "minecraft:poison";
  MinecraftEffectTypes2["RaidOmen"] = "minecraft:raid_omen";
  MinecraftEffectTypes2["Regeneration"] = "minecraft:regeneration";
  MinecraftEffectTypes2["Resistance"] = "minecraft:resistance";
  MinecraftEffectTypes2["Saturation"] = "minecraft:saturation";
  MinecraftEffectTypes2["SlowFalling"] = "minecraft:slow_falling";
  MinecraftEffectTypes2["Slowness"] = "minecraft:slowness";
  MinecraftEffectTypes2["Speed"] = "minecraft:speed";
  MinecraftEffectTypes2["Strength"] = "minecraft:strength";
  MinecraftEffectTypes2["TrialOmen"] = "minecraft:trial_omen";
  MinecraftEffectTypes2["VillageHero"] = "minecraft:village_hero";
  MinecraftEffectTypes2["WaterBreathing"] = "minecraft:water_breathing";
  MinecraftEffectTypes2["Weakness"] = "minecraft:weakness";
  MinecraftEffectTypes2["Weaving"] = "minecraft:weaving";
  MinecraftEffectTypes2["WindCharged"] = "minecraft:wind_charged";
  MinecraftEffectTypes2["Wither"] = "minecraft:wither";
  return MinecraftEffectTypes2;
})(MinecraftEffectTypes || {});
var MinecraftEnchantmentTypes = ((MinecraftEnchantmentTypes2) => {
  MinecraftEnchantmentTypes2["AquaAffinity"] = "minecraft:aqua_affinity";
  MinecraftEnchantmentTypes2["BaneOfArthropods"] = "minecraft:bane_of_arthropods";
  MinecraftEnchantmentTypes2["Binding"] = "minecraft:binding";
  MinecraftEnchantmentTypes2["BlastProtection"] = "minecraft:blast_protection";
  MinecraftEnchantmentTypes2["BowInfinity"] = "minecraft:infinity";
  MinecraftEnchantmentTypes2["Breach"] = "minecraft:breach";
  MinecraftEnchantmentTypes2["Channeling"] = "minecraft:channeling";
  MinecraftEnchantmentTypes2["Density"] = "minecraft:density";
  MinecraftEnchantmentTypes2["DepthStrider"] = "minecraft:depth_strider";
  MinecraftEnchantmentTypes2["Efficiency"] = "minecraft:efficiency";
  MinecraftEnchantmentTypes2["FeatherFalling"] = "minecraft:feather_falling";
  MinecraftEnchantmentTypes2["FireAspect"] = "minecraft:fire_aspect";
  MinecraftEnchantmentTypes2["FireProtection"] = "minecraft:fire_protection";
  MinecraftEnchantmentTypes2["Flame"] = "minecraft:flame";
  MinecraftEnchantmentTypes2["Fortune"] = "minecraft:fortune";
  MinecraftEnchantmentTypes2["FrostWalker"] = "minecraft:frost_walker";
  MinecraftEnchantmentTypes2["Impaling"] = "minecraft:impaling";
  MinecraftEnchantmentTypes2["Knockback"] = "minecraft:knockback";
  MinecraftEnchantmentTypes2["Looting"] = "minecraft:looting";
  MinecraftEnchantmentTypes2["Loyalty"] = "minecraft:loyalty";
  MinecraftEnchantmentTypes2["LuckOfTheSea"] = "minecraft:luck_of_the_sea";
  MinecraftEnchantmentTypes2["Lure"] = "minecraft:lure";
  MinecraftEnchantmentTypes2["Mending"] = "minecraft:mending";
  MinecraftEnchantmentTypes2["Multishot"] = "minecraft:multishot";
  MinecraftEnchantmentTypes2["Piercing"] = "minecraft:piercing";
  MinecraftEnchantmentTypes2["Power"] = "minecraft:power";
  MinecraftEnchantmentTypes2["ProjectileProtection"] = "minecraft:projectile_protection";
  MinecraftEnchantmentTypes2["Protection"] = "minecraft:protection";
  MinecraftEnchantmentTypes2["Punch"] = "minecraft:punch";
  MinecraftEnchantmentTypes2["QuickCharge"] = "minecraft:quick_charge";
  MinecraftEnchantmentTypes2["Respiration"] = "minecraft:respiration";
  MinecraftEnchantmentTypes2["Riptide"] = "minecraft:riptide";
  MinecraftEnchantmentTypes2["Sharpness"] = "minecraft:sharpness";
  MinecraftEnchantmentTypes2["SilkTouch"] = "minecraft:silk_touch";
  MinecraftEnchantmentTypes2["Smite"] = "minecraft:smite";
  MinecraftEnchantmentTypes2["SoulSpeed"] = "minecraft:soul_speed";
  MinecraftEnchantmentTypes2["SwiftSneak"] = "minecraft:swift_sneak";
  MinecraftEnchantmentTypes2["Thorns"] = "minecraft:thorns";
  MinecraftEnchantmentTypes2["Unbreaking"] = "minecraft:unbreaking";
  MinecraftEnchantmentTypes2["Vanishing"] = "minecraft:vanishing";
  MinecraftEnchantmentTypes2["WindBurst"] = "minecraft:wind_burst";
  return MinecraftEnchantmentTypes2;
})(MinecraftEnchantmentTypes || {});
var MinecraftEntityTypes = ((MinecraftEntityTypes2) => {
  MinecraftEntityTypes2["Agent"] = "minecraft:agent";
  MinecraftEntityTypes2["Allay"] = "minecraft:allay";
  MinecraftEntityTypes2["AreaEffectCloud"] = "minecraft:area_effect_cloud";
  MinecraftEntityTypes2["Armadillo"] = "minecraft:armadillo";
  MinecraftEntityTypes2["ArmorStand"] = "minecraft:armor_stand";
  MinecraftEntityTypes2["Arrow"] = "minecraft:arrow";
  MinecraftEntityTypes2["Axolotl"] = "minecraft:axolotl";
  MinecraftEntityTypes2["Bat"] = "minecraft:bat";
  MinecraftEntityTypes2["Bee"] = "minecraft:bee";
  MinecraftEntityTypes2["Blaze"] = "minecraft:blaze";
  MinecraftEntityTypes2["Boat"] = "minecraft:boat";
  MinecraftEntityTypes2["Bogged"] = "minecraft:bogged";
  MinecraftEntityTypes2["Breeze"] = "minecraft:breeze";
  MinecraftEntityTypes2["BreezeWindChargeProjectile"] = "minecraft:breeze_wind_charge_projectile";
  MinecraftEntityTypes2["Camel"] = "minecraft:camel";
  MinecraftEntityTypes2["Cat"] = "minecraft:cat";
  MinecraftEntityTypes2["CaveSpider"] = "minecraft:cave_spider";
  MinecraftEntityTypes2["ChestBoat"] = "minecraft:chest_boat";
  MinecraftEntityTypes2["ChestMinecart"] = "minecraft:chest_minecart";
  MinecraftEntityTypes2["Chicken"] = "minecraft:chicken";
  MinecraftEntityTypes2["Cod"] = "minecraft:cod";
  MinecraftEntityTypes2["CommandBlockMinecart"] = "minecraft:command_block_minecart";
  MinecraftEntityTypes2["Cow"] = "minecraft:cow";
  MinecraftEntityTypes2["Creaking"] = "minecraft:creaking";
  MinecraftEntityTypes2["Creeper"] = "minecraft:creeper";
  MinecraftEntityTypes2["Dolphin"] = "minecraft:dolphin";
  MinecraftEntityTypes2["Donkey"] = "minecraft:donkey";
  MinecraftEntityTypes2["DragonFireball"] = "minecraft:dragon_fireball";
  MinecraftEntityTypes2["Drowned"] = "minecraft:drowned";
  MinecraftEntityTypes2["Egg"] = "minecraft:egg";
  MinecraftEntityTypes2["ElderGuardian"] = "minecraft:elder_guardian";
  MinecraftEntityTypes2["EnderCrystal"] = "minecraft:ender_crystal";
  MinecraftEntityTypes2["EnderDragon"] = "minecraft:ender_dragon";
  MinecraftEntityTypes2["EnderPearl"] = "minecraft:ender_pearl";
  MinecraftEntityTypes2["Enderman"] = "minecraft:enderman";
  MinecraftEntityTypes2["Endermite"] = "minecraft:endermite";
  MinecraftEntityTypes2["EvocationIllager"] = "minecraft:evocation_illager";
  MinecraftEntityTypes2["EyeOfEnderSignal"] = "minecraft:eye_of_ender_signal";
  MinecraftEntityTypes2["Fireball"] = "minecraft:fireball";
  MinecraftEntityTypes2["FireworksRocket"] = "minecraft:fireworks_rocket";
  MinecraftEntityTypes2["FishingHook"] = "minecraft:fishing_hook";
  MinecraftEntityTypes2["Fox"] = "minecraft:fox";
  MinecraftEntityTypes2["Frog"] = "minecraft:frog";
  MinecraftEntityTypes2["Ghast"] = "minecraft:ghast";
  MinecraftEntityTypes2["GlowSquid"] = "minecraft:glow_squid";
  MinecraftEntityTypes2["Goat"] = "minecraft:goat";
  MinecraftEntityTypes2["Guardian"] = "minecraft:guardian";
  MinecraftEntityTypes2["HappyGhast"] = "minecraft:happy_ghast";
  MinecraftEntityTypes2["Hoglin"] = "minecraft:hoglin";
  MinecraftEntityTypes2["HopperMinecart"] = "minecraft:hopper_minecart";
  MinecraftEntityTypes2["Horse"] = "minecraft:horse";
  MinecraftEntityTypes2["Husk"] = "minecraft:husk";
  MinecraftEntityTypes2["IronGolem"] = "minecraft:iron_golem";
  MinecraftEntityTypes2["LightningBolt"] = "minecraft:lightning_bolt";
  MinecraftEntityTypes2["LingeringPotion"] = "minecraft:lingering_potion";
  MinecraftEntityTypes2["Llama"] = "minecraft:llama";
  MinecraftEntityTypes2["LlamaSpit"] = "minecraft:llama_spit";
  MinecraftEntityTypes2["MagmaCube"] = "minecraft:magma_cube";
  MinecraftEntityTypes2["Minecart"] = "minecraft:minecart";
  MinecraftEntityTypes2["Mooshroom"] = "minecraft:mooshroom";
  MinecraftEntityTypes2["Mule"] = "minecraft:mule";
  MinecraftEntityTypes2["Npc"] = "minecraft:npc";
  MinecraftEntityTypes2["Ocelot"] = "minecraft:ocelot";
  MinecraftEntityTypes2["OminousItemSpawner"] = "minecraft:ominous_item_spawner";
  MinecraftEntityTypes2["Panda"] = "minecraft:panda";
  MinecraftEntityTypes2["Parrot"] = "minecraft:parrot";
  MinecraftEntityTypes2["Phantom"] = "minecraft:phantom";
  MinecraftEntityTypes2["Pig"] = "minecraft:pig";
  MinecraftEntityTypes2["Piglin"] = "minecraft:piglin";
  MinecraftEntityTypes2["PiglinBrute"] = "minecraft:piglin_brute";
  MinecraftEntityTypes2["Pillager"] = "minecraft:pillager";
  MinecraftEntityTypes2["Player"] = "minecraft:player";
  MinecraftEntityTypes2["PolarBear"] = "minecraft:polar_bear";
  MinecraftEntityTypes2["Pufferfish"] = "minecraft:pufferfish";
  MinecraftEntityTypes2["Rabbit"] = "minecraft:rabbit";
  MinecraftEntityTypes2["Ravager"] = "minecraft:ravager";
  MinecraftEntityTypes2["Salmon"] = "minecraft:salmon";
  MinecraftEntityTypes2["Sheep"] = "minecraft:sheep";
  MinecraftEntityTypes2["Shulker"] = "minecraft:shulker";
  MinecraftEntityTypes2["ShulkerBullet"] = "minecraft:shulker_bullet";
  MinecraftEntityTypes2["Silverfish"] = "minecraft:silverfish";
  MinecraftEntityTypes2["Skeleton"] = "minecraft:skeleton";
  MinecraftEntityTypes2["SkeletonHorse"] = "minecraft:skeleton_horse";
  MinecraftEntityTypes2["Slime"] = "minecraft:slime";
  MinecraftEntityTypes2["SmallFireball"] = "minecraft:small_fireball";
  MinecraftEntityTypes2["Sniffer"] = "minecraft:sniffer";
  MinecraftEntityTypes2["SnowGolem"] = "minecraft:snow_golem";
  MinecraftEntityTypes2["Snowball"] = "minecraft:snowball";
  MinecraftEntityTypes2["Spider"] = "minecraft:spider";
  MinecraftEntityTypes2["SplashPotion"] = "minecraft:splash_potion";
  MinecraftEntityTypes2["Squid"] = "minecraft:squid";
  MinecraftEntityTypes2["Stray"] = "minecraft:stray";
  MinecraftEntityTypes2["Strider"] = "minecraft:strider";
  MinecraftEntityTypes2["Tadpole"] = "minecraft:tadpole";
  MinecraftEntityTypes2["ThrownTrident"] = "minecraft:thrown_trident";
  MinecraftEntityTypes2["Tnt"] = "minecraft:tnt";
  MinecraftEntityTypes2["TntMinecart"] = "minecraft:tnt_minecart";
  MinecraftEntityTypes2["TraderLlama"] = "minecraft:trader_llama";
  MinecraftEntityTypes2["TripodCamera"] = "minecraft:tripod_camera";
  MinecraftEntityTypes2["Tropicalfish"] = "minecraft:tropicalfish";
  MinecraftEntityTypes2["Turtle"] = "minecraft:turtle";
  MinecraftEntityTypes2["Vex"] = "minecraft:vex";
  MinecraftEntityTypes2["Villager"] = "minecraft:villager";
  MinecraftEntityTypes2["VillagerV2"] = "minecraft:villager_v2";
  MinecraftEntityTypes2["Vindicator"] = "minecraft:vindicator";
  MinecraftEntityTypes2["WanderingTrader"] = "minecraft:wandering_trader";
  MinecraftEntityTypes2["Warden"] = "minecraft:warden";
  MinecraftEntityTypes2["WindChargeProjectile"] = "minecraft:wind_charge_projectile";
  MinecraftEntityTypes2["Witch"] = "minecraft:witch";
  MinecraftEntityTypes2["Wither"] = "minecraft:wither";
  MinecraftEntityTypes2["WitherSkeleton"] = "minecraft:wither_skeleton";
  MinecraftEntityTypes2["WitherSkull"] = "minecraft:wither_skull";
  MinecraftEntityTypes2["WitherSkullDangerous"] = "minecraft:wither_skull_dangerous";
  MinecraftEntityTypes2["Wolf"] = "minecraft:wolf";
  MinecraftEntityTypes2["XpBottle"] = "minecraft:xp_bottle";
  MinecraftEntityTypes2["XpOrb"] = "minecraft:xp_orb";
  MinecraftEntityTypes2["Zoglin"] = "minecraft:zoglin";
  MinecraftEntityTypes2["Zombie"] = "minecraft:zombie";
  MinecraftEntityTypes2["ZombieHorse"] = "minecraft:zombie_horse";
  MinecraftEntityTypes2["ZombiePigman"] = "minecraft:zombie_pigman";
  MinecraftEntityTypes2["ZombieVillager"] = "minecraft:zombie_villager";
  MinecraftEntityTypes2["ZombieVillagerV2"] = "minecraft:zombie_villager_v2";
  return MinecraftEntityTypes2;
})(MinecraftEntityTypes || {});
var MinecraftFeatureTypes = ((MinecraftFeatureTypes2) => {
  MinecraftFeatureTypes2["AncientCity"] = "minecraft:ancient_city";
  MinecraftFeatureTypes2["BastionRemnant"] = "minecraft:bastion_remnant";
  MinecraftFeatureTypes2["BuriedTreasure"] = "minecraft:buried_treasure";
  MinecraftFeatureTypes2["EndCity"] = "minecraft:end_city";
  MinecraftFeatureTypes2["Fortress"] = "minecraft:fortress";
  MinecraftFeatureTypes2["Mansion"] = "minecraft:mansion";
  MinecraftFeatureTypes2["Mineshaft"] = "minecraft:mineshaft";
  MinecraftFeatureTypes2["Monument"] = "minecraft:monument";
  MinecraftFeatureTypes2["PillagerOutpost"] = "minecraft:pillager_outpost";
  MinecraftFeatureTypes2["RuinedPortal"] = "minecraft:ruined_portal";
  MinecraftFeatureTypes2["Ruins"] = "minecraft:ruins";
  MinecraftFeatureTypes2["Shipwreck"] = "minecraft:shipwreck";
  MinecraftFeatureTypes2["Stronghold"] = "minecraft:stronghold";
  MinecraftFeatureTypes2["Temple"] = "minecraft:temple";
  MinecraftFeatureTypes2["TrailRuins"] = "minecraft:trail_ruins";
  MinecraftFeatureTypes2["TrialChambers"] = "minecraft:trial_chambers";
  MinecraftFeatureTypes2["Village"] = "minecraft:village";
  return MinecraftFeatureTypes2;
})(MinecraftFeatureTypes || {});
var MinecraftItemTypes = ((MinecraftItemTypes2) => {
  MinecraftItemTypes2["AcaciaBoat"] = "minecraft:acacia_boat";
  MinecraftItemTypes2["AcaciaButton"] = "minecraft:acacia_button";
  MinecraftItemTypes2["AcaciaChestBoat"] = "minecraft:acacia_chest_boat";
  MinecraftItemTypes2["AcaciaDoor"] = "minecraft:acacia_door";
  MinecraftItemTypes2["AcaciaFence"] = "minecraft:acacia_fence";
  MinecraftItemTypes2["AcaciaFenceGate"] = "minecraft:acacia_fence_gate";
  MinecraftItemTypes2["AcaciaHangingSign"] = "minecraft:acacia_hanging_sign";
  MinecraftItemTypes2["AcaciaLeaves"] = "minecraft:acacia_leaves";
  MinecraftItemTypes2["AcaciaLog"] = "minecraft:acacia_log";
  MinecraftItemTypes2["AcaciaPlanks"] = "minecraft:acacia_planks";
  MinecraftItemTypes2["AcaciaPressurePlate"] = "minecraft:acacia_pressure_plate";
  MinecraftItemTypes2["AcaciaSapling"] = "minecraft:acacia_sapling";
  MinecraftItemTypes2["AcaciaSign"] = "minecraft:acacia_sign";
  MinecraftItemTypes2["AcaciaSlab"] = "minecraft:acacia_slab";
  MinecraftItemTypes2["AcaciaStairs"] = "minecraft:acacia_stairs";
  MinecraftItemTypes2["AcaciaTrapdoor"] = "minecraft:acacia_trapdoor";
  MinecraftItemTypes2["AcaciaWood"] = "minecraft:acacia_wood";
  MinecraftItemTypes2["ActivatorRail"] = "minecraft:activator_rail";
  MinecraftItemTypes2["AllaySpawnEgg"] = "minecraft:allay_spawn_egg";
  MinecraftItemTypes2["Allium"] = "minecraft:allium";
  MinecraftItemTypes2["Allow"] = "minecraft:allow";
  MinecraftItemTypes2["AmethystBlock"] = "minecraft:amethyst_block";
  MinecraftItemTypes2["AmethystCluster"] = "minecraft:amethyst_cluster";
  MinecraftItemTypes2["AmethystShard"] = "minecraft:amethyst_shard";
  MinecraftItemTypes2["AncientDebris"] = "minecraft:ancient_debris";
  MinecraftItemTypes2["Andesite"] = "minecraft:andesite";
  MinecraftItemTypes2["AndesiteSlab"] = "minecraft:andesite_slab";
  MinecraftItemTypes2["AndesiteStairs"] = "minecraft:andesite_stairs";
  MinecraftItemTypes2["AndesiteWall"] = "minecraft:andesite_wall";
  MinecraftItemTypes2["AnglerPotterySherd"] = "minecraft:angler_pottery_sherd";
  MinecraftItemTypes2["Anvil"] = "minecraft:anvil";
  MinecraftItemTypes2["Apple"] = "minecraft:apple";
  MinecraftItemTypes2["ArcherPotterySherd"] = "minecraft:archer_pottery_sherd";
  MinecraftItemTypes2["ArmadilloScute"] = "minecraft:armadillo_scute";
  MinecraftItemTypes2["ArmadilloSpawnEgg"] = "minecraft:armadillo_spawn_egg";
  MinecraftItemTypes2["ArmorStand"] = "minecraft:armor_stand";
  MinecraftItemTypes2["ArmsUpPotterySherd"] = "minecraft:arms_up_pottery_sherd";
  MinecraftItemTypes2["Arrow"] = "minecraft:arrow";
  MinecraftItemTypes2["AxolotlBucket"] = "minecraft:axolotl_bucket";
  MinecraftItemTypes2["AxolotlSpawnEgg"] = "minecraft:axolotl_spawn_egg";
  MinecraftItemTypes2["Azalea"] = "minecraft:azalea";
  MinecraftItemTypes2["AzaleaLeaves"] = "minecraft:azalea_leaves";
  MinecraftItemTypes2["AzaleaLeavesFlowered"] = "minecraft:azalea_leaves_flowered";
  MinecraftItemTypes2["AzureBluet"] = "minecraft:azure_bluet";
  MinecraftItemTypes2["BakedPotato"] = "minecraft:baked_potato";
  MinecraftItemTypes2["Bamboo"] = "minecraft:bamboo";
  MinecraftItemTypes2["BambooBlock"] = "minecraft:bamboo_block";
  MinecraftItemTypes2["BambooButton"] = "minecraft:bamboo_button";
  MinecraftItemTypes2["BambooChestRaft"] = "minecraft:bamboo_chest_raft";
  MinecraftItemTypes2["BambooDoor"] = "minecraft:bamboo_door";
  MinecraftItemTypes2["BambooFence"] = "minecraft:bamboo_fence";
  MinecraftItemTypes2["BambooFenceGate"] = "minecraft:bamboo_fence_gate";
  MinecraftItemTypes2["BambooHangingSign"] = "minecraft:bamboo_hanging_sign";
  MinecraftItemTypes2["BambooMosaic"] = "minecraft:bamboo_mosaic";
  MinecraftItemTypes2["BambooMosaicSlab"] = "minecraft:bamboo_mosaic_slab";
  MinecraftItemTypes2["BambooMosaicStairs"] = "minecraft:bamboo_mosaic_stairs";
  MinecraftItemTypes2["BambooPlanks"] = "minecraft:bamboo_planks";
  MinecraftItemTypes2["BambooPressurePlate"] = "minecraft:bamboo_pressure_plate";
  MinecraftItemTypes2["BambooRaft"] = "minecraft:bamboo_raft";
  MinecraftItemTypes2["BambooSign"] = "minecraft:bamboo_sign";
  MinecraftItemTypes2["BambooSlab"] = "minecraft:bamboo_slab";
  MinecraftItemTypes2["BambooStairs"] = "minecraft:bamboo_stairs";
  MinecraftItemTypes2["BambooTrapdoor"] = "minecraft:bamboo_trapdoor";
  MinecraftItemTypes2["Banner"] = "minecraft:banner";
  MinecraftItemTypes2["Barrel"] = "minecraft:barrel";
  MinecraftItemTypes2["Barrier"] = "minecraft:barrier";
  MinecraftItemTypes2["Basalt"] = "minecraft:basalt";
  MinecraftItemTypes2["BatSpawnEgg"] = "minecraft:bat_spawn_egg";
  MinecraftItemTypes2["Beacon"] = "minecraft:beacon";
  MinecraftItemTypes2["Bed"] = "minecraft:bed";
  MinecraftItemTypes2["Bedrock"] = "minecraft:bedrock";
  MinecraftItemTypes2["BeeNest"] = "minecraft:bee_nest";
  MinecraftItemTypes2["BeeSpawnEgg"] = "minecraft:bee_spawn_egg";
  MinecraftItemTypes2["Beef"] = "minecraft:beef";
  MinecraftItemTypes2["Beehive"] = "minecraft:beehive";
  MinecraftItemTypes2["Beetroot"] = "minecraft:beetroot";
  MinecraftItemTypes2["BeetrootSeeds"] = "minecraft:beetroot_seeds";
  MinecraftItemTypes2["BeetrootSoup"] = "minecraft:beetroot_soup";
  MinecraftItemTypes2["Bell"] = "minecraft:bell";
  MinecraftItemTypes2["BigDripleaf"] = "minecraft:big_dripleaf";
  MinecraftItemTypes2["BirchBoat"] = "minecraft:birch_boat";
  MinecraftItemTypes2["BirchButton"] = "minecraft:birch_button";
  MinecraftItemTypes2["BirchChestBoat"] = "minecraft:birch_chest_boat";
  MinecraftItemTypes2["BirchDoor"] = "minecraft:birch_door";
  MinecraftItemTypes2["BirchFence"] = "minecraft:birch_fence";
  MinecraftItemTypes2["BirchFenceGate"] = "minecraft:birch_fence_gate";
  MinecraftItemTypes2["BirchHangingSign"] = "minecraft:birch_hanging_sign";
  MinecraftItemTypes2["BirchLeaves"] = "minecraft:birch_leaves";
  MinecraftItemTypes2["BirchLog"] = "minecraft:birch_log";
  MinecraftItemTypes2["BirchPlanks"] = "minecraft:birch_planks";
  MinecraftItemTypes2["BirchPressurePlate"] = "minecraft:birch_pressure_plate";
  MinecraftItemTypes2["BirchSapling"] = "minecraft:birch_sapling";
  MinecraftItemTypes2["BirchSign"] = "minecraft:birch_sign";
  MinecraftItemTypes2["BirchSlab"] = "minecraft:birch_slab";
  MinecraftItemTypes2["BirchStairs"] = "minecraft:birch_stairs";
  MinecraftItemTypes2["BirchTrapdoor"] = "minecraft:birch_trapdoor";
  MinecraftItemTypes2["BirchWood"] = "minecraft:birch_wood";
  MinecraftItemTypes2["BlackBundle"] = "minecraft:black_bundle";
  MinecraftItemTypes2["BlackCandle"] = "minecraft:black_candle";
  MinecraftItemTypes2["BlackCarpet"] = "minecraft:black_carpet";
  MinecraftItemTypes2["BlackConcrete"] = "minecraft:black_concrete";
  MinecraftItemTypes2["BlackConcretePowder"] = "minecraft:black_concrete_powder";
  MinecraftItemTypes2["BlackDye"] = "minecraft:black_dye";
  MinecraftItemTypes2["BlackGlazedTerracotta"] = "minecraft:black_glazed_terracotta";
  MinecraftItemTypes2["BlackHarness"] = "minecraft:black_harness";
  MinecraftItemTypes2["BlackShulkerBox"] = "minecraft:black_shulker_box";
  MinecraftItemTypes2["BlackStainedGlass"] = "minecraft:black_stained_glass";
  MinecraftItemTypes2["BlackStainedGlassPane"] = "minecraft:black_stained_glass_pane";
  MinecraftItemTypes2["BlackTerracotta"] = "minecraft:black_terracotta";
  MinecraftItemTypes2["BlackWool"] = "minecraft:black_wool";
  MinecraftItemTypes2["Blackstone"] = "minecraft:blackstone";
  MinecraftItemTypes2["BlackstoneSlab"] = "minecraft:blackstone_slab";
  MinecraftItemTypes2["BlackstoneStairs"] = "minecraft:blackstone_stairs";
  MinecraftItemTypes2["BlackstoneWall"] = "minecraft:blackstone_wall";
  MinecraftItemTypes2["BladePotterySherd"] = "minecraft:blade_pottery_sherd";
  MinecraftItemTypes2["BlastFurnace"] = "minecraft:blast_furnace";
  MinecraftItemTypes2["BlazePowder"] = "minecraft:blaze_powder";
  MinecraftItemTypes2["BlazeRod"] = "minecraft:blaze_rod";
  MinecraftItemTypes2["BlazeSpawnEgg"] = "minecraft:blaze_spawn_egg";
  MinecraftItemTypes2["BlueBundle"] = "minecraft:blue_bundle";
  MinecraftItemTypes2["BlueCandle"] = "minecraft:blue_candle";
  MinecraftItemTypes2["BlueCarpet"] = "minecraft:blue_carpet";
  MinecraftItemTypes2["BlueConcrete"] = "minecraft:blue_concrete";
  MinecraftItemTypes2["BlueConcretePowder"] = "minecraft:blue_concrete_powder";
  MinecraftItemTypes2["BlueDye"] = "minecraft:blue_dye";
  MinecraftItemTypes2["BlueEgg"] = "minecraft:blue_egg";
  MinecraftItemTypes2["BlueGlazedTerracotta"] = "minecraft:blue_glazed_terracotta";
  MinecraftItemTypes2["BlueHarness"] = "minecraft:blue_harness";
  MinecraftItemTypes2["BlueIce"] = "minecraft:blue_ice";
  MinecraftItemTypes2["BlueOrchid"] = "minecraft:blue_orchid";
  MinecraftItemTypes2["BlueShulkerBox"] = "minecraft:blue_shulker_box";
  MinecraftItemTypes2["BlueStainedGlass"] = "minecraft:blue_stained_glass";
  MinecraftItemTypes2["BlueStainedGlassPane"] = "minecraft:blue_stained_glass_pane";
  MinecraftItemTypes2["BlueTerracotta"] = "minecraft:blue_terracotta";
  MinecraftItemTypes2["BlueWool"] = "minecraft:blue_wool";
  MinecraftItemTypes2["BoggedSpawnEgg"] = "minecraft:bogged_spawn_egg";
  MinecraftItemTypes2["BoltArmorTrimSmithingTemplate"] = "minecraft:bolt_armor_trim_smithing_template";
  MinecraftItemTypes2["Bone"] = "minecraft:bone";
  MinecraftItemTypes2["BoneBlock"] = "minecraft:bone_block";
  MinecraftItemTypes2["BoneMeal"] = "minecraft:bone_meal";
  MinecraftItemTypes2["Book"] = "minecraft:book";
  MinecraftItemTypes2["Bookshelf"] = "minecraft:bookshelf";
  MinecraftItemTypes2["BorderBlock"] = "minecraft:border_block";
  MinecraftItemTypes2["BordureIndentedBannerPattern"] = "minecraft:bordure_indented_banner_pattern";
  MinecraftItemTypes2["Bow"] = "minecraft:bow";
  MinecraftItemTypes2["Bowl"] = "minecraft:bowl";
  MinecraftItemTypes2["BrainCoral"] = "minecraft:brain_coral";
  MinecraftItemTypes2["BrainCoralBlock"] = "minecraft:brain_coral_block";
  MinecraftItemTypes2["BrainCoralFan"] = "minecraft:brain_coral_fan";
  MinecraftItemTypes2["Bread"] = "minecraft:bread";
  MinecraftItemTypes2["BreezeRod"] = "minecraft:breeze_rod";
  MinecraftItemTypes2["BreezeSpawnEgg"] = "minecraft:breeze_spawn_egg";
  MinecraftItemTypes2["BrewerPotterySherd"] = "minecraft:brewer_pottery_sherd";
  MinecraftItemTypes2["BrewingStand"] = "minecraft:brewing_stand";
  MinecraftItemTypes2["Brick"] = "minecraft:brick";
  MinecraftItemTypes2["BrickBlock"] = "minecraft:brick_block";
  MinecraftItemTypes2["BrickSlab"] = "minecraft:brick_slab";
  MinecraftItemTypes2["BrickStairs"] = "minecraft:brick_stairs";
  MinecraftItemTypes2["BrickWall"] = "minecraft:brick_wall";
  MinecraftItemTypes2["BrownBundle"] = "minecraft:brown_bundle";
  MinecraftItemTypes2["BrownCandle"] = "minecraft:brown_candle";
  MinecraftItemTypes2["BrownCarpet"] = "minecraft:brown_carpet";
  MinecraftItemTypes2["BrownConcrete"] = "minecraft:brown_concrete";
  MinecraftItemTypes2["BrownConcretePowder"] = "minecraft:brown_concrete_powder";
  MinecraftItemTypes2["BrownDye"] = "minecraft:brown_dye";
  MinecraftItemTypes2["BrownEgg"] = "minecraft:brown_egg";
  MinecraftItemTypes2["BrownGlazedTerracotta"] = "minecraft:brown_glazed_terracotta";
  MinecraftItemTypes2["BrownHarness"] = "minecraft:brown_harness";
  MinecraftItemTypes2["BrownMushroom"] = "minecraft:brown_mushroom";
  MinecraftItemTypes2["BrownMushroomBlock"] = "minecraft:brown_mushroom_block";
  MinecraftItemTypes2["BrownShulkerBox"] = "minecraft:brown_shulker_box";
  MinecraftItemTypes2["BrownStainedGlass"] = "minecraft:brown_stained_glass";
  MinecraftItemTypes2["BrownStainedGlassPane"] = "minecraft:brown_stained_glass_pane";
  MinecraftItemTypes2["BrownTerracotta"] = "minecraft:brown_terracotta";
  MinecraftItemTypes2["BrownWool"] = "minecraft:brown_wool";
  MinecraftItemTypes2["Brush"] = "minecraft:brush";
  MinecraftItemTypes2["BubbleCoral"] = "minecraft:bubble_coral";
  MinecraftItemTypes2["BubbleCoralBlock"] = "minecraft:bubble_coral_block";
  MinecraftItemTypes2["BubbleCoralFan"] = "minecraft:bubble_coral_fan";
  MinecraftItemTypes2["Bucket"] = "minecraft:bucket";
  MinecraftItemTypes2["BuddingAmethyst"] = "minecraft:budding_amethyst";
  MinecraftItemTypes2["Bundle"] = "minecraft:bundle";
  MinecraftItemTypes2["BurnPotterySherd"] = "minecraft:burn_pottery_sherd";
  MinecraftItemTypes2["Bush"] = "minecraft:bush";
  MinecraftItemTypes2["Cactus"] = "minecraft:cactus";
  MinecraftItemTypes2["CactusFlower"] = "minecraft:cactus_flower";
  MinecraftItemTypes2["Cake"] = "minecraft:cake";
  MinecraftItemTypes2["Calcite"] = "minecraft:calcite";
  MinecraftItemTypes2["CalibratedSculkSensor"] = "minecraft:calibrated_sculk_sensor";
  MinecraftItemTypes2["CamelSpawnEgg"] = "minecraft:camel_spawn_egg";
  MinecraftItemTypes2["Campfire"] = "minecraft:campfire";
  MinecraftItemTypes2["Candle"] = "minecraft:candle";
  MinecraftItemTypes2["Carrot"] = "minecraft:carrot";
  MinecraftItemTypes2["CarrotOnAStick"] = "minecraft:carrot_on_a_stick";
  MinecraftItemTypes2["CartographyTable"] = "minecraft:cartography_table";
  MinecraftItemTypes2["CarvedPumpkin"] = "minecraft:carved_pumpkin";
  MinecraftItemTypes2["CatSpawnEgg"] = "minecraft:cat_spawn_egg";
  MinecraftItemTypes2["Cauldron"] = "minecraft:cauldron";
  MinecraftItemTypes2["CaveSpiderSpawnEgg"] = "minecraft:cave_spider_spawn_egg";
  MinecraftItemTypes2["Chain"] = "minecraft:chain";
  MinecraftItemTypes2["ChainCommandBlock"] = "minecraft:chain_command_block";
  MinecraftItemTypes2["ChainmailBoots"] = "minecraft:chainmail_boots";
  MinecraftItemTypes2["ChainmailChestplate"] = "minecraft:chainmail_chestplate";
  MinecraftItemTypes2["ChainmailHelmet"] = "minecraft:chainmail_helmet";
  MinecraftItemTypes2["ChainmailLeggings"] = "minecraft:chainmail_leggings";
  MinecraftItemTypes2["Charcoal"] = "minecraft:charcoal";
  MinecraftItemTypes2["CherryBoat"] = "minecraft:cherry_boat";
  MinecraftItemTypes2["CherryButton"] = "minecraft:cherry_button";
  MinecraftItemTypes2["CherryChestBoat"] = "minecraft:cherry_chest_boat";
  MinecraftItemTypes2["CherryDoor"] = "minecraft:cherry_door";
  MinecraftItemTypes2["CherryFence"] = "minecraft:cherry_fence";
  MinecraftItemTypes2["CherryFenceGate"] = "minecraft:cherry_fence_gate";
  MinecraftItemTypes2["CherryHangingSign"] = "minecraft:cherry_hanging_sign";
  MinecraftItemTypes2["CherryLeaves"] = "minecraft:cherry_leaves";
  MinecraftItemTypes2["CherryLog"] = "minecraft:cherry_log";
  MinecraftItemTypes2["CherryPlanks"] = "minecraft:cherry_planks";
  MinecraftItemTypes2["CherryPressurePlate"] = "minecraft:cherry_pressure_plate";
  MinecraftItemTypes2["CherrySapling"] = "minecraft:cherry_sapling";
  MinecraftItemTypes2["CherrySign"] = "minecraft:cherry_sign";
  MinecraftItemTypes2["CherrySlab"] = "minecraft:cherry_slab";
  MinecraftItemTypes2["CherryStairs"] = "minecraft:cherry_stairs";
  MinecraftItemTypes2["CherryTrapdoor"] = "minecraft:cherry_trapdoor";
  MinecraftItemTypes2["CherryWood"] = "minecraft:cherry_wood";
  MinecraftItemTypes2["Chest"] = "minecraft:chest";
  MinecraftItemTypes2["ChestMinecart"] = "minecraft:chest_minecart";
  MinecraftItemTypes2["Chicken"] = "minecraft:chicken";
  MinecraftItemTypes2["ChickenSpawnEgg"] = "minecraft:chicken_spawn_egg";
  MinecraftItemTypes2["ChippedAnvil"] = "minecraft:chipped_anvil";
  MinecraftItemTypes2["ChiseledBookshelf"] = "minecraft:chiseled_bookshelf";
  MinecraftItemTypes2["ChiseledCopper"] = "minecraft:chiseled_copper";
  MinecraftItemTypes2["ChiseledDeepslate"] = "minecraft:chiseled_deepslate";
  MinecraftItemTypes2["ChiseledNetherBricks"] = "minecraft:chiseled_nether_bricks";
  MinecraftItemTypes2["ChiseledPolishedBlackstone"] = "minecraft:chiseled_polished_blackstone";
  MinecraftItemTypes2["ChiseledQuartzBlock"] = "minecraft:chiseled_quartz_block";
  MinecraftItemTypes2["ChiseledRedSandstone"] = "minecraft:chiseled_red_sandstone";
  MinecraftItemTypes2["ChiseledResinBricks"] = "minecraft:chiseled_resin_bricks";
  MinecraftItemTypes2["ChiseledSandstone"] = "minecraft:chiseled_sandstone";
  MinecraftItemTypes2["ChiseledStoneBricks"] = "minecraft:chiseled_stone_bricks";
  MinecraftItemTypes2["ChiseledTuff"] = "minecraft:chiseled_tuff";
  MinecraftItemTypes2["ChiseledTuffBricks"] = "minecraft:chiseled_tuff_bricks";
  MinecraftItemTypes2["ChorusFlower"] = "minecraft:chorus_flower";
  MinecraftItemTypes2["ChorusFruit"] = "minecraft:chorus_fruit";
  MinecraftItemTypes2["ChorusPlant"] = "minecraft:chorus_plant";
  MinecraftItemTypes2["Clay"] = "minecraft:clay";
  MinecraftItemTypes2["ClayBall"] = "minecraft:clay_ball";
  MinecraftItemTypes2["Clock"] = "minecraft:clock";
  MinecraftItemTypes2["ClosedEyeblossom"] = "minecraft:closed_eyeblossom";
  MinecraftItemTypes2["Coal"] = "minecraft:coal";
  MinecraftItemTypes2["CoalBlock"] = "minecraft:coal_block";
  MinecraftItemTypes2["CoalOre"] = "minecraft:coal_ore";
  MinecraftItemTypes2["CoarseDirt"] = "minecraft:coarse_dirt";
  MinecraftItemTypes2["CoastArmorTrimSmithingTemplate"] = "minecraft:coast_armor_trim_smithing_template";
  MinecraftItemTypes2["CobbledDeepslate"] = "minecraft:cobbled_deepslate";
  MinecraftItemTypes2["CobbledDeepslateSlab"] = "minecraft:cobbled_deepslate_slab";
  MinecraftItemTypes2["CobbledDeepslateStairs"] = "minecraft:cobbled_deepslate_stairs";
  MinecraftItemTypes2["CobbledDeepslateWall"] = "minecraft:cobbled_deepslate_wall";
  MinecraftItemTypes2["Cobblestone"] = "minecraft:cobblestone";
  MinecraftItemTypes2["CobblestoneSlab"] = "minecraft:cobblestone_slab";
  MinecraftItemTypes2["CobblestoneWall"] = "minecraft:cobblestone_wall";
  MinecraftItemTypes2["CocoaBeans"] = "minecraft:cocoa_beans";
  MinecraftItemTypes2["Cod"] = "minecraft:cod";
  MinecraftItemTypes2["CodBucket"] = "minecraft:cod_bucket";
  MinecraftItemTypes2["CodSpawnEgg"] = "minecraft:cod_spawn_egg";
  MinecraftItemTypes2["CommandBlock"] = "minecraft:command_block";
  MinecraftItemTypes2["CommandBlockMinecart"] = "minecraft:command_block_minecart";
  MinecraftItemTypes2["Comparator"] = "minecraft:comparator";
  MinecraftItemTypes2["Compass"] = "minecraft:compass";
  MinecraftItemTypes2["Composter"] = "minecraft:composter";
  MinecraftItemTypes2["Conduit"] = "minecraft:conduit";
  MinecraftItemTypes2["CookedBeef"] = "minecraft:cooked_beef";
  MinecraftItemTypes2["CookedChicken"] = "minecraft:cooked_chicken";
  MinecraftItemTypes2["CookedCod"] = "minecraft:cooked_cod";
  MinecraftItemTypes2["CookedMutton"] = "minecraft:cooked_mutton";
  MinecraftItemTypes2["CookedPorkchop"] = "minecraft:cooked_porkchop";
  MinecraftItemTypes2["CookedRabbit"] = "minecraft:cooked_rabbit";
  MinecraftItemTypes2["CookedSalmon"] = "minecraft:cooked_salmon";
  MinecraftItemTypes2["Cookie"] = "minecraft:cookie";
  MinecraftItemTypes2["CopperBlock"] = "minecraft:copper_block";
  MinecraftItemTypes2["CopperBulb"] = "minecraft:copper_bulb";
  MinecraftItemTypes2["CopperDoor"] = "minecraft:copper_door";
  MinecraftItemTypes2["CopperGrate"] = "minecraft:copper_grate";
  MinecraftItemTypes2["CopperIngot"] = "minecraft:copper_ingot";
  MinecraftItemTypes2["CopperOre"] = "minecraft:copper_ore";
  MinecraftItemTypes2["CopperTrapdoor"] = "minecraft:copper_trapdoor";
  MinecraftItemTypes2["Cornflower"] = "minecraft:cornflower";
  MinecraftItemTypes2["CowSpawnEgg"] = "minecraft:cow_spawn_egg";
  MinecraftItemTypes2["CrackedDeepslateBricks"] = "minecraft:cracked_deepslate_bricks";
  MinecraftItemTypes2["CrackedDeepslateTiles"] = "minecraft:cracked_deepslate_tiles";
  MinecraftItemTypes2["CrackedNetherBricks"] = "minecraft:cracked_nether_bricks";
  MinecraftItemTypes2["CrackedPolishedBlackstoneBricks"] = "minecraft:cracked_polished_blackstone_bricks";
  MinecraftItemTypes2["CrackedStoneBricks"] = "minecraft:cracked_stone_bricks";
  MinecraftItemTypes2["Crafter"] = "minecraft:crafter";
  MinecraftItemTypes2["CraftingTable"] = "minecraft:crafting_table";
  MinecraftItemTypes2["CreakingHeart"] = "minecraft:creaking_heart";
  MinecraftItemTypes2["CreakingSpawnEgg"] = "minecraft:creaking_spawn_egg";
  MinecraftItemTypes2["CreeperBannerPattern"] = "minecraft:creeper_banner_pattern";
  MinecraftItemTypes2["CreeperHead"] = "minecraft:creeper_head";
  MinecraftItemTypes2["CreeperSpawnEgg"] = "minecraft:creeper_spawn_egg";
  MinecraftItemTypes2["CrimsonButton"] = "minecraft:crimson_button";
  MinecraftItemTypes2["CrimsonDoor"] = "minecraft:crimson_door";
  MinecraftItemTypes2["CrimsonFence"] = "minecraft:crimson_fence";
  MinecraftItemTypes2["CrimsonFenceGate"] = "minecraft:crimson_fence_gate";
  MinecraftItemTypes2["CrimsonFungus"] = "minecraft:crimson_fungus";
  MinecraftItemTypes2["CrimsonHangingSign"] = "minecraft:crimson_hanging_sign";
  MinecraftItemTypes2["CrimsonHyphae"] = "minecraft:crimson_hyphae";
  MinecraftItemTypes2["CrimsonNylium"] = "minecraft:crimson_nylium";
  MinecraftItemTypes2["CrimsonPlanks"] = "minecraft:crimson_planks";
  MinecraftItemTypes2["CrimsonPressurePlate"] = "minecraft:crimson_pressure_plate";
  MinecraftItemTypes2["CrimsonRoots"] = "minecraft:crimson_roots";
  MinecraftItemTypes2["CrimsonSign"] = "minecraft:crimson_sign";
  MinecraftItemTypes2["CrimsonSlab"] = "minecraft:crimson_slab";
  MinecraftItemTypes2["CrimsonStairs"] = "minecraft:crimson_stairs";
  MinecraftItemTypes2["CrimsonStem"] = "minecraft:crimson_stem";
  MinecraftItemTypes2["CrimsonTrapdoor"] = "minecraft:crimson_trapdoor";
  MinecraftItemTypes2["Crossbow"] = "minecraft:crossbow";
  MinecraftItemTypes2["CryingObsidian"] = "minecraft:crying_obsidian";
  MinecraftItemTypes2["CutCopper"] = "minecraft:cut_copper";
  MinecraftItemTypes2["CutCopperSlab"] = "minecraft:cut_copper_slab";
  MinecraftItemTypes2["CutCopperStairs"] = "minecraft:cut_copper_stairs";
  MinecraftItemTypes2["CutRedSandstone"] = "minecraft:cut_red_sandstone";
  MinecraftItemTypes2["CutRedSandstoneSlab"] = "minecraft:cut_red_sandstone_slab";
  MinecraftItemTypes2["CutSandstone"] = "minecraft:cut_sandstone";
  MinecraftItemTypes2["CutSandstoneSlab"] = "minecraft:cut_sandstone_slab";
  MinecraftItemTypes2["CyanBundle"] = "minecraft:cyan_bundle";
  MinecraftItemTypes2["CyanCandle"] = "minecraft:cyan_candle";
  MinecraftItemTypes2["CyanCarpet"] = "minecraft:cyan_carpet";
  MinecraftItemTypes2["CyanConcrete"] = "minecraft:cyan_concrete";
  MinecraftItemTypes2["CyanConcretePowder"] = "minecraft:cyan_concrete_powder";
  MinecraftItemTypes2["CyanDye"] = "minecraft:cyan_dye";
  MinecraftItemTypes2["CyanGlazedTerracotta"] = "minecraft:cyan_glazed_terracotta";
  MinecraftItemTypes2["CyanHarness"] = "minecraft:cyan_harness";
  MinecraftItemTypes2["CyanShulkerBox"] = "minecraft:cyan_shulker_box";
  MinecraftItemTypes2["CyanStainedGlass"] = "minecraft:cyan_stained_glass";
  MinecraftItemTypes2["CyanStainedGlassPane"] = "minecraft:cyan_stained_glass_pane";
  MinecraftItemTypes2["CyanTerracotta"] = "minecraft:cyan_terracotta";
  MinecraftItemTypes2["CyanWool"] = "minecraft:cyan_wool";
  MinecraftItemTypes2["DamagedAnvil"] = "minecraft:damaged_anvil";
  MinecraftItemTypes2["Dandelion"] = "minecraft:dandelion";
  MinecraftItemTypes2["DangerPotterySherd"] = "minecraft:danger_pottery_sherd";
  MinecraftItemTypes2["DarkOakBoat"] = "minecraft:dark_oak_boat";
  MinecraftItemTypes2["DarkOakButton"] = "minecraft:dark_oak_button";
  MinecraftItemTypes2["DarkOakChestBoat"] = "minecraft:dark_oak_chest_boat";
  MinecraftItemTypes2["DarkOakDoor"] = "minecraft:dark_oak_door";
  MinecraftItemTypes2["DarkOakFence"] = "minecraft:dark_oak_fence";
  MinecraftItemTypes2["DarkOakFenceGate"] = "minecraft:dark_oak_fence_gate";
  MinecraftItemTypes2["DarkOakHangingSign"] = "minecraft:dark_oak_hanging_sign";
  MinecraftItemTypes2["DarkOakLeaves"] = "minecraft:dark_oak_leaves";
  MinecraftItemTypes2["DarkOakLog"] = "minecraft:dark_oak_log";
  MinecraftItemTypes2["DarkOakPlanks"] = "minecraft:dark_oak_planks";
  MinecraftItemTypes2["DarkOakPressurePlate"] = "minecraft:dark_oak_pressure_plate";
  MinecraftItemTypes2["DarkOakSapling"] = "minecraft:dark_oak_sapling";
  MinecraftItemTypes2["DarkOakSign"] = "minecraft:dark_oak_sign";
  MinecraftItemTypes2["DarkOakSlab"] = "minecraft:dark_oak_slab";
  MinecraftItemTypes2["DarkOakStairs"] = "minecraft:dark_oak_stairs";
  MinecraftItemTypes2["DarkOakTrapdoor"] = "minecraft:dark_oak_trapdoor";
  MinecraftItemTypes2["DarkOakWood"] = "minecraft:dark_oak_wood";
  MinecraftItemTypes2["DarkPrismarine"] = "minecraft:dark_prismarine";
  MinecraftItemTypes2["DarkPrismarineSlab"] = "minecraft:dark_prismarine_slab";
  MinecraftItemTypes2["DarkPrismarineStairs"] = "minecraft:dark_prismarine_stairs";
  MinecraftItemTypes2["DaylightDetector"] = "minecraft:daylight_detector";
  MinecraftItemTypes2["DeadBrainCoral"] = "minecraft:dead_brain_coral";
  MinecraftItemTypes2["DeadBrainCoralBlock"] = "minecraft:dead_brain_coral_block";
  MinecraftItemTypes2["DeadBrainCoralFan"] = "minecraft:dead_brain_coral_fan";
  MinecraftItemTypes2["DeadBubbleCoral"] = "minecraft:dead_bubble_coral";
  MinecraftItemTypes2["DeadBubbleCoralBlock"] = "minecraft:dead_bubble_coral_block";
  MinecraftItemTypes2["DeadBubbleCoralFan"] = "minecraft:dead_bubble_coral_fan";
  MinecraftItemTypes2["DeadFireCoral"] = "minecraft:dead_fire_coral";
  MinecraftItemTypes2["DeadFireCoralBlock"] = "minecraft:dead_fire_coral_block";
  MinecraftItemTypes2["DeadFireCoralFan"] = "minecraft:dead_fire_coral_fan";
  MinecraftItemTypes2["DeadHornCoral"] = "minecraft:dead_horn_coral";
  MinecraftItemTypes2["DeadHornCoralBlock"] = "minecraft:dead_horn_coral_block";
  MinecraftItemTypes2["DeadHornCoralFan"] = "minecraft:dead_horn_coral_fan";
  MinecraftItemTypes2["DeadTubeCoral"] = "minecraft:dead_tube_coral";
  MinecraftItemTypes2["DeadTubeCoralBlock"] = "minecraft:dead_tube_coral_block";
  MinecraftItemTypes2["DeadTubeCoralFan"] = "minecraft:dead_tube_coral_fan";
  MinecraftItemTypes2["Deadbush"] = "minecraft:deadbush";
  MinecraftItemTypes2["DecoratedPot"] = "minecraft:decorated_pot";
  MinecraftItemTypes2["Deepslate"] = "minecraft:deepslate";
  MinecraftItemTypes2["DeepslateBrickSlab"] = "minecraft:deepslate_brick_slab";
  MinecraftItemTypes2["DeepslateBrickStairs"] = "minecraft:deepslate_brick_stairs";
  MinecraftItemTypes2["DeepslateBrickWall"] = "minecraft:deepslate_brick_wall";
  MinecraftItemTypes2["DeepslateBricks"] = "minecraft:deepslate_bricks";
  MinecraftItemTypes2["DeepslateCoalOre"] = "minecraft:deepslate_coal_ore";
  MinecraftItemTypes2["DeepslateCopperOre"] = "minecraft:deepslate_copper_ore";
  MinecraftItemTypes2["DeepslateDiamondOre"] = "minecraft:deepslate_diamond_ore";
  MinecraftItemTypes2["DeepslateEmeraldOre"] = "minecraft:deepslate_emerald_ore";
  MinecraftItemTypes2["DeepslateGoldOre"] = "minecraft:deepslate_gold_ore";
  MinecraftItemTypes2["DeepslateIronOre"] = "minecraft:deepslate_iron_ore";
  MinecraftItemTypes2["DeepslateLapisOre"] = "minecraft:deepslate_lapis_ore";
  MinecraftItemTypes2["DeepslateRedstoneOre"] = "minecraft:deepslate_redstone_ore";
  MinecraftItemTypes2["DeepslateTileSlab"] = "minecraft:deepslate_tile_slab";
  MinecraftItemTypes2["DeepslateTileStairs"] = "minecraft:deepslate_tile_stairs";
  MinecraftItemTypes2["DeepslateTileWall"] = "minecraft:deepslate_tile_wall";
  MinecraftItemTypes2["DeepslateTiles"] = "minecraft:deepslate_tiles";
  MinecraftItemTypes2["Deny"] = "minecraft:deny";
  MinecraftItemTypes2["DetectorRail"] = "minecraft:detector_rail";
  MinecraftItemTypes2["Diamond"] = "minecraft:diamond";
  MinecraftItemTypes2["DiamondAxe"] = "minecraft:diamond_axe";
  MinecraftItemTypes2["DiamondBlock"] = "minecraft:diamond_block";
  MinecraftItemTypes2["DiamondBoots"] = "minecraft:diamond_boots";
  MinecraftItemTypes2["DiamondChestplate"] = "minecraft:diamond_chestplate";
  MinecraftItemTypes2["DiamondHelmet"] = "minecraft:diamond_helmet";
  MinecraftItemTypes2["DiamondHoe"] = "minecraft:diamond_hoe";
  MinecraftItemTypes2["DiamondHorseArmor"] = "minecraft:diamond_horse_armor";
  MinecraftItemTypes2["DiamondLeggings"] = "minecraft:diamond_leggings";
  MinecraftItemTypes2["DiamondOre"] = "minecraft:diamond_ore";
  MinecraftItemTypes2["DiamondPickaxe"] = "minecraft:diamond_pickaxe";
  MinecraftItemTypes2["DiamondShovel"] = "minecraft:diamond_shovel";
  MinecraftItemTypes2["DiamondSword"] = "minecraft:diamond_sword";
  MinecraftItemTypes2["Diorite"] = "minecraft:diorite";
  MinecraftItemTypes2["DioriteSlab"] = "minecraft:diorite_slab";
  MinecraftItemTypes2["DioriteStairs"] = "minecraft:diorite_stairs";
  MinecraftItemTypes2["DioriteWall"] = "minecraft:diorite_wall";
  MinecraftItemTypes2["Dirt"] = "minecraft:dirt";
  MinecraftItemTypes2["DirtWithRoots"] = "minecraft:dirt_with_roots";
  MinecraftItemTypes2["DiscFragment5"] = "minecraft:disc_fragment_5";
  MinecraftItemTypes2["Dispenser"] = "minecraft:dispenser";
  MinecraftItemTypes2["DolphinSpawnEgg"] = "minecraft:dolphin_spawn_egg";
  MinecraftItemTypes2["DonkeySpawnEgg"] = "minecraft:donkey_spawn_egg";
  MinecraftItemTypes2["DragonBreath"] = "minecraft:dragon_breath";
  MinecraftItemTypes2["DragonEgg"] = "minecraft:dragon_egg";
  MinecraftItemTypes2["DragonHead"] = "minecraft:dragon_head";
  MinecraftItemTypes2["DriedGhast"] = "minecraft:dried_ghast";
  MinecraftItemTypes2["DriedKelp"] = "minecraft:dried_kelp";
  MinecraftItemTypes2["DriedKelpBlock"] = "minecraft:dried_kelp_block";
  MinecraftItemTypes2["DripstoneBlock"] = "minecraft:dripstone_block";
  MinecraftItemTypes2["Dropper"] = "minecraft:dropper";
  MinecraftItemTypes2["DrownedSpawnEgg"] = "minecraft:drowned_spawn_egg";
  MinecraftItemTypes2["DuneArmorTrimSmithingTemplate"] = "minecraft:dune_armor_trim_smithing_template";
  MinecraftItemTypes2["EchoShard"] = "minecraft:echo_shard";
  MinecraftItemTypes2["Egg"] = "minecraft:egg";
  MinecraftItemTypes2["ElderGuardianSpawnEgg"] = "minecraft:elder_guardian_spawn_egg";
  MinecraftItemTypes2["Elytra"] = "minecraft:elytra";
  MinecraftItemTypes2["Emerald"] = "minecraft:emerald";
  MinecraftItemTypes2["EmeraldBlock"] = "minecraft:emerald_block";
  MinecraftItemTypes2["EmeraldOre"] = "minecraft:emerald_ore";
  MinecraftItemTypes2["EmptyMap"] = "minecraft:empty_map";
  MinecraftItemTypes2["EnchantedBook"] = "minecraft:enchanted_book";
  MinecraftItemTypes2["EnchantedGoldenApple"] = "minecraft:enchanted_golden_apple";
  MinecraftItemTypes2["EnchantingTable"] = "minecraft:enchanting_table";
  MinecraftItemTypes2["EndBrickStairs"] = "minecraft:end_brick_stairs";
  MinecraftItemTypes2["EndBricks"] = "minecraft:end_bricks";
  MinecraftItemTypes2["EndCrystal"] = "minecraft:end_crystal";
  MinecraftItemTypes2["EndPortalFrame"] = "minecraft:end_portal_frame";
  MinecraftItemTypes2["EndRod"] = "minecraft:end_rod";
  MinecraftItemTypes2["EndStone"] = "minecraft:end_stone";
  MinecraftItemTypes2["EndStoneBrickSlab"] = "minecraft:end_stone_brick_slab";
  MinecraftItemTypes2["EndStoneBrickWall"] = "minecraft:end_stone_brick_wall";
  MinecraftItemTypes2["EnderChest"] = "minecraft:ender_chest";
  MinecraftItemTypes2["EnderDragonSpawnEgg"] = "minecraft:ender_dragon_spawn_egg";
  MinecraftItemTypes2["EnderEye"] = "minecraft:ender_eye";
  MinecraftItemTypes2["EnderPearl"] = "minecraft:ender_pearl";
  MinecraftItemTypes2["EndermanSpawnEgg"] = "minecraft:enderman_spawn_egg";
  MinecraftItemTypes2["EndermiteSpawnEgg"] = "minecraft:endermite_spawn_egg";
  MinecraftItemTypes2["EvokerSpawnEgg"] = "minecraft:evoker_spawn_egg";
  MinecraftItemTypes2["ExperienceBottle"] = "minecraft:experience_bottle";
  MinecraftItemTypes2["ExplorerPotterySherd"] = "minecraft:explorer_pottery_sherd";
  MinecraftItemTypes2["ExposedChiseledCopper"] = "minecraft:exposed_chiseled_copper";
  MinecraftItemTypes2["ExposedCopper"] = "minecraft:exposed_copper";
  MinecraftItemTypes2["ExposedCopperBulb"] = "minecraft:exposed_copper_bulb";
  MinecraftItemTypes2["ExposedCopperDoor"] = "minecraft:exposed_copper_door";
  MinecraftItemTypes2["ExposedCopperGrate"] = "minecraft:exposed_copper_grate";
  MinecraftItemTypes2["ExposedCopperTrapdoor"] = "minecraft:exposed_copper_trapdoor";
  MinecraftItemTypes2["ExposedCutCopper"] = "minecraft:exposed_cut_copper";
  MinecraftItemTypes2["ExposedCutCopperSlab"] = "minecraft:exposed_cut_copper_slab";
  MinecraftItemTypes2["ExposedCutCopperStairs"] = "minecraft:exposed_cut_copper_stairs";
  MinecraftItemTypes2["EyeArmorTrimSmithingTemplate"] = "minecraft:eye_armor_trim_smithing_template";
  MinecraftItemTypes2["Farmland"] = "minecraft:farmland";
  MinecraftItemTypes2["Feather"] = "minecraft:feather";
  MinecraftItemTypes2["FenceGate"] = "minecraft:fence_gate";
  MinecraftItemTypes2["FermentedSpiderEye"] = "minecraft:fermented_spider_eye";
  MinecraftItemTypes2["Fern"] = "minecraft:fern";
  MinecraftItemTypes2["FieldMasonedBannerPattern"] = "minecraft:field_masoned_banner_pattern";
  MinecraftItemTypes2["FilledMap"] = "minecraft:filled_map";
  MinecraftItemTypes2["FireCharge"] = "minecraft:fire_charge";
  MinecraftItemTypes2["FireCoral"] = "minecraft:fire_coral";
  MinecraftItemTypes2["FireCoralBlock"] = "minecraft:fire_coral_block";
  MinecraftItemTypes2["FireCoralFan"] = "minecraft:fire_coral_fan";
  MinecraftItemTypes2["FireflyBush"] = "minecraft:firefly_bush";
  MinecraftItemTypes2["FireworkRocket"] = "minecraft:firework_rocket";
  MinecraftItemTypes2["FireworkStar"] = "minecraft:firework_star";
  MinecraftItemTypes2["FishingRod"] = "minecraft:fishing_rod";
  MinecraftItemTypes2["FletchingTable"] = "minecraft:fletching_table";
  MinecraftItemTypes2["Flint"] = "minecraft:flint";
  MinecraftItemTypes2["FlintAndSteel"] = "minecraft:flint_and_steel";
  MinecraftItemTypes2["FlowArmorTrimSmithingTemplate"] = "minecraft:flow_armor_trim_smithing_template";
  MinecraftItemTypes2["FlowBannerPattern"] = "minecraft:flow_banner_pattern";
  MinecraftItemTypes2["FlowPotterySherd"] = "minecraft:flow_pottery_sherd";
  MinecraftItemTypes2["FlowerBannerPattern"] = "minecraft:flower_banner_pattern";
  MinecraftItemTypes2["FlowerPot"] = "minecraft:flower_pot";
  MinecraftItemTypes2["FloweringAzalea"] = "minecraft:flowering_azalea";
  MinecraftItemTypes2["FoxSpawnEgg"] = "minecraft:fox_spawn_egg";
  MinecraftItemTypes2["Frame"] = "minecraft:frame";
  MinecraftItemTypes2["FriendPotterySherd"] = "minecraft:friend_pottery_sherd";
  MinecraftItemTypes2["FrogSpawn"] = "minecraft:frog_spawn";
  MinecraftItemTypes2["FrogSpawnEgg"] = "minecraft:frog_spawn_egg";
  MinecraftItemTypes2["FrostedIce"] = "minecraft:frosted_ice";
  MinecraftItemTypes2["Furnace"] = "minecraft:furnace";
  MinecraftItemTypes2["GhastSpawnEgg"] = "minecraft:ghast_spawn_egg";
  MinecraftItemTypes2["GhastTear"] = "minecraft:ghast_tear";
  MinecraftItemTypes2["GildedBlackstone"] = "minecraft:gilded_blackstone";
  MinecraftItemTypes2["Glass"] = "minecraft:glass";
  MinecraftItemTypes2["GlassBottle"] = "minecraft:glass_bottle";
  MinecraftItemTypes2["GlassPane"] = "minecraft:glass_pane";
  MinecraftItemTypes2["GlisteringMelonSlice"] = "minecraft:glistering_melon_slice";
  MinecraftItemTypes2["GlobeBannerPattern"] = "minecraft:globe_banner_pattern";
  MinecraftItemTypes2["GlowBerries"] = "minecraft:glow_berries";
  MinecraftItemTypes2["GlowFrame"] = "minecraft:glow_frame";
  MinecraftItemTypes2["GlowInkSac"] = "minecraft:glow_ink_sac";
  MinecraftItemTypes2["GlowLichen"] = "minecraft:glow_lichen";
  MinecraftItemTypes2["GlowSquidSpawnEgg"] = "minecraft:glow_squid_spawn_egg";
  MinecraftItemTypes2["Glowstone"] = "minecraft:glowstone";
  MinecraftItemTypes2["GlowstoneDust"] = "minecraft:glowstone_dust";
  MinecraftItemTypes2["GoatHorn"] = "minecraft:goat_horn";
  MinecraftItemTypes2["GoatSpawnEgg"] = "minecraft:goat_spawn_egg";
  MinecraftItemTypes2["GoldBlock"] = "minecraft:gold_block";
  MinecraftItemTypes2["GoldIngot"] = "minecraft:gold_ingot";
  MinecraftItemTypes2["GoldNugget"] = "minecraft:gold_nugget";
  MinecraftItemTypes2["GoldOre"] = "minecraft:gold_ore";
  MinecraftItemTypes2["GoldenApple"] = "minecraft:golden_apple";
  MinecraftItemTypes2["GoldenAxe"] = "minecraft:golden_axe";
  MinecraftItemTypes2["GoldenBoots"] = "minecraft:golden_boots";
  MinecraftItemTypes2["GoldenCarrot"] = "minecraft:golden_carrot";
  MinecraftItemTypes2["GoldenChestplate"] = "minecraft:golden_chestplate";
  MinecraftItemTypes2["GoldenHelmet"] = "minecraft:golden_helmet";
  MinecraftItemTypes2["GoldenHoe"] = "minecraft:golden_hoe";
  MinecraftItemTypes2["GoldenHorseArmor"] = "minecraft:golden_horse_armor";
  MinecraftItemTypes2["GoldenLeggings"] = "minecraft:golden_leggings";
  MinecraftItemTypes2["GoldenPickaxe"] = "minecraft:golden_pickaxe";
  MinecraftItemTypes2["GoldenRail"] = "minecraft:golden_rail";
  MinecraftItemTypes2["GoldenShovel"] = "minecraft:golden_shovel";
  MinecraftItemTypes2["GoldenSword"] = "minecraft:golden_sword";
  MinecraftItemTypes2["Granite"] = "minecraft:granite";
  MinecraftItemTypes2["GraniteSlab"] = "minecraft:granite_slab";
  MinecraftItemTypes2["GraniteStairs"] = "minecraft:granite_stairs";
  MinecraftItemTypes2["GraniteWall"] = "minecraft:granite_wall";
  MinecraftItemTypes2["GrassBlock"] = "minecraft:grass_block";
  MinecraftItemTypes2["GrassPath"] = "minecraft:grass_path";
  MinecraftItemTypes2["Gravel"] = "minecraft:gravel";
  MinecraftItemTypes2["GrayBundle"] = "minecraft:gray_bundle";
  MinecraftItemTypes2["GrayCandle"] = "minecraft:gray_candle";
  MinecraftItemTypes2["GrayCarpet"] = "minecraft:gray_carpet";
  MinecraftItemTypes2["GrayConcrete"] = "minecraft:gray_concrete";
  MinecraftItemTypes2["GrayConcretePowder"] = "minecraft:gray_concrete_powder";
  MinecraftItemTypes2["GrayDye"] = "minecraft:gray_dye";
  MinecraftItemTypes2["GrayGlazedTerracotta"] = "minecraft:gray_glazed_terracotta";
  MinecraftItemTypes2["GrayHarness"] = "minecraft:gray_harness";
  MinecraftItemTypes2["GrayShulkerBox"] = "minecraft:gray_shulker_box";
  MinecraftItemTypes2["GrayStainedGlass"] = "minecraft:gray_stained_glass";
  MinecraftItemTypes2["GrayStainedGlassPane"] = "minecraft:gray_stained_glass_pane";
  MinecraftItemTypes2["GrayTerracotta"] = "minecraft:gray_terracotta";
  MinecraftItemTypes2["GrayWool"] = "minecraft:gray_wool";
  MinecraftItemTypes2["GreenBundle"] = "minecraft:green_bundle";
  MinecraftItemTypes2["GreenCandle"] = "minecraft:green_candle";
  MinecraftItemTypes2["GreenCarpet"] = "minecraft:green_carpet";
  MinecraftItemTypes2["GreenConcrete"] = "minecraft:green_concrete";
  MinecraftItemTypes2["GreenConcretePowder"] = "minecraft:green_concrete_powder";
  MinecraftItemTypes2["GreenDye"] = "minecraft:green_dye";
  MinecraftItemTypes2["GreenGlazedTerracotta"] = "minecraft:green_glazed_terracotta";
  MinecraftItemTypes2["GreenHarness"] = "minecraft:green_harness";
  MinecraftItemTypes2["GreenShulkerBox"] = "minecraft:green_shulker_box";
  MinecraftItemTypes2["GreenStainedGlass"] = "minecraft:green_stained_glass";
  MinecraftItemTypes2["GreenStainedGlassPane"] = "minecraft:green_stained_glass_pane";
  MinecraftItemTypes2["GreenTerracotta"] = "minecraft:green_terracotta";
  MinecraftItemTypes2["GreenWool"] = "minecraft:green_wool";
  MinecraftItemTypes2["Grindstone"] = "minecraft:grindstone";
  MinecraftItemTypes2["GuardianSpawnEgg"] = "minecraft:guardian_spawn_egg";
  MinecraftItemTypes2["Gunpowder"] = "minecraft:gunpowder";
  MinecraftItemTypes2["GusterBannerPattern"] = "minecraft:guster_banner_pattern";
  MinecraftItemTypes2["GusterPotterySherd"] = "minecraft:guster_pottery_sherd";
  MinecraftItemTypes2["HangingRoots"] = "minecraft:hanging_roots";
  MinecraftItemTypes2["HappyGhastSpawnEgg"] = "minecraft:happy_ghast_spawn_egg";
  MinecraftItemTypes2["HardenedClay"] = "minecraft:hardened_clay";
  MinecraftItemTypes2["HayBlock"] = "minecraft:hay_block";
  MinecraftItemTypes2["HeartOfTheSea"] = "minecraft:heart_of_the_sea";
  MinecraftItemTypes2["HeartPotterySherd"] = "minecraft:heart_pottery_sherd";
  MinecraftItemTypes2["HeartbreakPotterySherd"] = "minecraft:heartbreak_pottery_sherd";
  MinecraftItemTypes2["HeavyCore"] = "minecraft:heavy_core";
  MinecraftItemTypes2["HeavyWeightedPressurePlate"] = "minecraft:heavy_weighted_pressure_plate";
  MinecraftItemTypes2["HoglinSpawnEgg"] = "minecraft:hoglin_spawn_egg";
  MinecraftItemTypes2["HoneyBlock"] = "minecraft:honey_block";
  MinecraftItemTypes2["HoneyBottle"] = "minecraft:honey_bottle";
  MinecraftItemTypes2["Honeycomb"] = "minecraft:honeycomb";
  MinecraftItemTypes2["HoneycombBlock"] = "minecraft:honeycomb_block";
  MinecraftItemTypes2["Hopper"] = "minecraft:hopper";
  MinecraftItemTypes2["HopperMinecart"] = "minecraft:hopper_minecart";
  MinecraftItemTypes2["HornCoral"] = "minecraft:horn_coral";
  MinecraftItemTypes2["HornCoralBlock"] = "minecraft:horn_coral_block";
  MinecraftItemTypes2["HornCoralFan"] = "minecraft:horn_coral_fan";
  MinecraftItemTypes2["HorseSpawnEgg"] = "minecraft:horse_spawn_egg";
  MinecraftItemTypes2["HostArmorTrimSmithingTemplate"] = "minecraft:host_armor_trim_smithing_template";
  MinecraftItemTypes2["HowlPotterySherd"] = "minecraft:howl_pottery_sherd";
  MinecraftItemTypes2["HuskSpawnEgg"] = "minecraft:husk_spawn_egg";
  MinecraftItemTypes2["Ice"] = "minecraft:ice";
  MinecraftItemTypes2["InfestedChiseledStoneBricks"] = "minecraft:infested_chiseled_stone_bricks";
  MinecraftItemTypes2["InfestedCobblestone"] = "minecraft:infested_cobblestone";
  MinecraftItemTypes2["InfestedCrackedStoneBricks"] = "minecraft:infested_cracked_stone_bricks";
  MinecraftItemTypes2["InfestedDeepslate"] = "minecraft:infested_deepslate";
  MinecraftItemTypes2["InfestedMossyStoneBricks"] = "minecraft:infested_mossy_stone_bricks";
  MinecraftItemTypes2["InfestedStone"] = "minecraft:infested_stone";
  MinecraftItemTypes2["InfestedStoneBricks"] = "minecraft:infested_stone_bricks";
  MinecraftItemTypes2["InkSac"] = "minecraft:ink_sac";
  MinecraftItemTypes2["IronAxe"] = "minecraft:iron_axe";
  MinecraftItemTypes2["IronBars"] = "minecraft:iron_bars";
  MinecraftItemTypes2["IronBlock"] = "minecraft:iron_block";
  MinecraftItemTypes2["IronBoots"] = "minecraft:iron_boots";
  MinecraftItemTypes2["IronChestplate"] = "minecraft:iron_chestplate";
  MinecraftItemTypes2["IronDoor"] = "minecraft:iron_door";
  MinecraftItemTypes2["IronGolemSpawnEgg"] = "minecraft:iron_golem_spawn_egg";
  MinecraftItemTypes2["IronHelmet"] = "minecraft:iron_helmet";
  MinecraftItemTypes2["IronHoe"] = "minecraft:iron_hoe";
  MinecraftItemTypes2["IronHorseArmor"] = "minecraft:iron_horse_armor";
  MinecraftItemTypes2["IronIngot"] = "minecraft:iron_ingot";
  MinecraftItemTypes2["IronLeggings"] = "minecraft:iron_leggings";
  MinecraftItemTypes2["IronNugget"] = "minecraft:iron_nugget";
  MinecraftItemTypes2["IronOre"] = "minecraft:iron_ore";
  MinecraftItemTypes2["IronPickaxe"] = "minecraft:iron_pickaxe";
  MinecraftItemTypes2["IronShovel"] = "minecraft:iron_shovel";
  MinecraftItemTypes2["IronSword"] = "minecraft:iron_sword";
  MinecraftItemTypes2["IronTrapdoor"] = "minecraft:iron_trapdoor";
  MinecraftItemTypes2["Jigsaw"] = "minecraft:jigsaw";
  MinecraftItemTypes2["Jukebox"] = "minecraft:jukebox";
  MinecraftItemTypes2["JungleBoat"] = "minecraft:jungle_boat";
  MinecraftItemTypes2["JungleButton"] = "minecraft:jungle_button";
  MinecraftItemTypes2["JungleChestBoat"] = "minecraft:jungle_chest_boat";
  MinecraftItemTypes2["JungleDoor"] = "minecraft:jungle_door";
  MinecraftItemTypes2["JungleFence"] = "minecraft:jungle_fence";
  MinecraftItemTypes2["JungleFenceGate"] = "minecraft:jungle_fence_gate";
  MinecraftItemTypes2["JungleHangingSign"] = "minecraft:jungle_hanging_sign";
  MinecraftItemTypes2["JungleLeaves"] = "minecraft:jungle_leaves";
  MinecraftItemTypes2["JungleLog"] = "minecraft:jungle_log";
  MinecraftItemTypes2["JunglePlanks"] = "minecraft:jungle_planks";
  MinecraftItemTypes2["JunglePressurePlate"] = "minecraft:jungle_pressure_plate";
  MinecraftItemTypes2["JungleSapling"] = "minecraft:jungle_sapling";
  MinecraftItemTypes2["JungleSign"] = "minecraft:jungle_sign";
  MinecraftItemTypes2["JungleSlab"] = "minecraft:jungle_slab";
  MinecraftItemTypes2["JungleStairs"] = "minecraft:jungle_stairs";
  MinecraftItemTypes2["JungleTrapdoor"] = "minecraft:jungle_trapdoor";
  MinecraftItemTypes2["JungleWood"] = "minecraft:jungle_wood";
  MinecraftItemTypes2["Kelp"] = "minecraft:kelp";
  MinecraftItemTypes2["Ladder"] = "minecraft:ladder";
  MinecraftItemTypes2["Lantern"] = "minecraft:lantern";
  MinecraftItemTypes2["LapisBlock"] = "minecraft:lapis_block";
  MinecraftItemTypes2["LapisLazuli"] = "minecraft:lapis_lazuli";
  MinecraftItemTypes2["LapisOre"] = "minecraft:lapis_ore";
  MinecraftItemTypes2["LargeAmethystBud"] = "minecraft:large_amethyst_bud";
  MinecraftItemTypes2["LargeFern"] = "minecraft:large_fern";
  MinecraftItemTypes2["LavaBucket"] = "minecraft:lava_bucket";
  MinecraftItemTypes2["Lead"] = "minecraft:lead";
  MinecraftItemTypes2["LeafLitter"] = "minecraft:leaf_litter";
  MinecraftItemTypes2["Leather"] = "minecraft:leather";
  MinecraftItemTypes2["LeatherBoots"] = "minecraft:leather_boots";
  MinecraftItemTypes2["LeatherChestplate"] = "minecraft:leather_chestplate";
  MinecraftItemTypes2["LeatherHelmet"] = "minecraft:leather_helmet";
  MinecraftItemTypes2["LeatherHorseArmor"] = "minecraft:leather_horse_armor";
  MinecraftItemTypes2["LeatherLeggings"] = "minecraft:leather_leggings";
  MinecraftItemTypes2["Lectern"] = "minecraft:lectern";
  MinecraftItemTypes2["Lever"] = "minecraft:lever";
  MinecraftItemTypes2["LightBlock0"] = "minecraft:light_block_0";
  MinecraftItemTypes2["LightBlock1"] = "minecraft:light_block_1";
  MinecraftItemTypes2["LightBlock10"] = "minecraft:light_block_10";
  MinecraftItemTypes2["LightBlock11"] = "minecraft:light_block_11";
  MinecraftItemTypes2["LightBlock12"] = "minecraft:light_block_12";
  MinecraftItemTypes2["LightBlock13"] = "minecraft:light_block_13";
  MinecraftItemTypes2["LightBlock14"] = "minecraft:light_block_14";
  MinecraftItemTypes2["LightBlock15"] = "minecraft:light_block_15";
  MinecraftItemTypes2["LightBlock2"] = "minecraft:light_block_2";
  MinecraftItemTypes2["LightBlock3"] = "minecraft:light_block_3";
  MinecraftItemTypes2["LightBlock4"] = "minecraft:light_block_4";
  MinecraftItemTypes2["LightBlock5"] = "minecraft:light_block_5";
  MinecraftItemTypes2["LightBlock6"] = "minecraft:light_block_6";
  MinecraftItemTypes2["LightBlock7"] = "minecraft:light_block_7";
  MinecraftItemTypes2["LightBlock8"] = "minecraft:light_block_8";
  MinecraftItemTypes2["LightBlock9"] = "minecraft:light_block_9";
  MinecraftItemTypes2["LightBlueBundle"] = "minecraft:light_blue_bundle";
  MinecraftItemTypes2["LightBlueCandle"] = "minecraft:light_blue_candle";
  MinecraftItemTypes2["LightBlueCarpet"] = "minecraft:light_blue_carpet";
  MinecraftItemTypes2["LightBlueConcrete"] = "minecraft:light_blue_concrete";
  MinecraftItemTypes2["LightBlueConcretePowder"] = "minecraft:light_blue_concrete_powder";
  MinecraftItemTypes2["LightBlueDye"] = "minecraft:light_blue_dye";
  MinecraftItemTypes2["LightBlueGlazedTerracotta"] = "minecraft:light_blue_glazed_terracotta";
  MinecraftItemTypes2["LightBlueHarness"] = "minecraft:light_blue_harness";
  MinecraftItemTypes2["LightBlueShulkerBox"] = "minecraft:light_blue_shulker_box";
  MinecraftItemTypes2["LightBlueStainedGlass"] = "minecraft:light_blue_stained_glass";
  MinecraftItemTypes2["LightBlueStainedGlassPane"] = "minecraft:light_blue_stained_glass_pane";
  MinecraftItemTypes2["LightBlueTerracotta"] = "minecraft:light_blue_terracotta";
  MinecraftItemTypes2["LightBlueWool"] = "minecraft:light_blue_wool";
  MinecraftItemTypes2["LightGrayBundle"] = "minecraft:light_gray_bundle";
  MinecraftItemTypes2["LightGrayCandle"] = "minecraft:light_gray_candle";
  MinecraftItemTypes2["LightGrayCarpet"] = "minecraft:light_gray_carpet";
  MinecraftItemTypes2["LightGrayConcrete"] = "minecraft:light_gray_concrete";
  MinecraftItemTypes2["LightGrayConcretePowder"] = "minecraft:light_gray_concrete_powder";
  MinecraftItemTypes2["LightGrayDye"] = "minecraft:light_gray_dye";
  MinecraftItemTypes2["LightGrayHarness"] = "minecraft:light_gray_harness";
  MinecraftItemTypes2["LightGrayShulkerBox"] = "minecraft:light_gray_shulker_box";
  MinecraftItemTypes2["LightGrayStainedGlass"] = "minecraft:light_gray_stained_glass";
  MinecraftItemTypes2["LightGrayStainedGlassPane"] = "minecraft:light_gray_stained_glass_pane";
  MinecraftItemTypes2["LightGrayTerracotta"] = "minecraft:light_gray_terracotta";
  MinecraftItemTypes2["LightGrayWool"] = "minecraft:light_gray_wool";
  MinecraftItemTypes2["LightWeightedPressurePlate"] = "minecraft:light_weighted_pressure_plate";
  MinecraftItemTypes2["LightningRod"] = "minecraft:lightning_rod";
  MinecraftItemTypes2["Lilac"] = "minecraft:lilac";
  MinecraftItemTypes2["LilyOfTheValley"] = "minecraft:lily_of_the_valley";
  MinecraftItemTypes2["LimeBundle"] = "minecraft:lime_bundle";
  MinecraftItemTypes2["LimeCandle"] = "minecraft:lime_candle";
  MinecraftItemTypes2["LimeCarpet"] = "minecraft:lime_carpet";
  MinecraftItemTypes2["LimeConcrete"] = "minecraft:lime_concrete";
  MinecraftItemTypes2["LimeConcretePowder"] = "minecraft:lime_concrete_powder";
  MinecraftItemTypes2["LimeDye"] = "minecraft:lime_dye";
  MinecraftItemTypes2["LimeGlazedTerracotta"] = "minecraft:lime_glazed_terracotta";
  MinecraftItemTypes2["LimeHarness"] = "minecraft:lime_harness";
  MinecraftItemTypes2["LimeShulkerBox"] = "minecraft:lime_shulker_box";
  MinecraftItemTypes2["LimeStainedGlass"] = "minecraft:lime_stained_glass";
  MinecraftItemTypes2["LimeStainedGlassPane"] = "minecraft:lime_stained_glass_pane";
  MinecraftItemTypes2["LimeTerracotta"] = "minecraft:lime_terracotta";
  MinecraftItemTypes2["LimeWool"] = "minecraft:lime_wool";
  MinecraftItemTypes2["LingeringPotion"] = "minecraft:lingering_potion";
  MinecraftItemTypes2["LitPumpkin"] = "minecraft:lit_pumpkin";
  MinecraftItemTypes2["LlamaSpawnEgg"] = "minecraft:llama_spawn_egg";
  MinecraftItemTypes2["Lodestone"] = "minecraft:lodestone";
  MinecraftItemTypes2["LodestoneCompass"] = "minecraft:lodestone_compass";
  MinecraftItemTypes2["Loom"] = "minecraft:loom";
  MinecraftItemTypes2["Mace"] = "minecraft:mace";
  MinecraftItemTypes2["MagentaBundle"] = "minecraft:magenta_bundle";
  MinecraftItemTypes2["MagentaCandle"] = "minecraft:magenta_candle";
  MinecraftItemTypes2["MagentaCarpet"] = "minecraft:magenta_carpet";
  MinecraftItemTypes2["MagentaConcrete"] = "minecraft:magenta_concrete";
  MinecraftItemTypes2["MagentaConcretePowder"] = "minecraft:magenta_concrete_powder";
  MinecraftItemTypes2["MagentaDye"] = "minecraft:magenta_dye";
  MinecraftItemTypes2["MagentaGlazedTerracotta"] = "minecraft:magenta_glazed_terracotta";
  MinecraftItemTypes2["MagentaHarness"] = "minecraft:magenta_harness";
  MinecraftItemTypes2["MagentaShulkerBox"] = "minecraft:magenta_shulker_box";
  MinecraftItemTypes2["MagentaStainedGlass"] = "minecraft:magenta_stained_glass";
  MinecraftItemTypes2["MagentaStainedGlassPane"] = "minecraft:magenta_stained_glass_pane";
  MinecraftItemTypes2["MagentaTerracotta"] = "minecraft:magenta_terracotta";
  MinecraftItemTypes2["MagentaWool"] = "minecraft:magenta_wool";
  MinecraftItemTypes2["Magma"] = "minecraft:magma";
  MinecraftItemTypes2["MagmaCream"] = "minecraft:magma_cream";
  MinecraftItemTypes2["MagmaCubeSpawnEgg"] = "minecraft:magma_cube_spawn_egg";
  MinecraftItemTypes2["MangroveBoat"] = "minecraft:mangrove_boat";
  MinecraftItemTypes2["MangroveButton"] = "minecraft:mangrove_button";
  MinecraftItemTypes2["MangroveChestBoat"] = "minecraft:mangrove_chest_boat";
  MinecraftItemTypes2["MangroveDoor"] = "minecraft:mangrove_door";
  MinecraftItemTypes2["MangroveFence"] = "minecraft:mangrove_fence";
  MinecraftItemTypes2["MangroveFenceGate"] = "minecraft:mangrove_fence_gate";
  MinecraftItemTypes2["MangroveHangingSign"] = "minecraft:mangrove_hanging_sign";
  MinecraftItemTypes2["MangroveLeaves"] = "minecraft:mangrove_leaves";
  MinecraftItemTypes2["MangroveLog"] = "minecraft:mangrove_log";
  MinecraftItemTypes2["MangrovePlanks"] = "minecraft:mangrove_planks";
  MinecraftItemTypes2["MangrovePressurePlate"] = "minecraft:mangrove_pressure_plate";
  MinecraftItemTypes2["MangrovePropagule"] = "minecraft:mangrove_propagule";
  MinecraftItemTypes2["MangroveRoots"] = "minecraft:mangrove_roots";
  MinecraftItemTypes2["MangroveSign"] = "minecraft:mangrove_sign";
  MinecraftItemTypes2["MangroveSlab"] = "minecraft:mangrove_slab";
  MinecraftItemTypes2["MangroveStairs"] = "minecraft:mangrove_stairs";
  MinecraftItemTypes2["MangroveTrapdoor"] = "minecraft:mangrove_trapdoor";
  MinecraftItemTypes2["MangroveWood"] = "minecraft:mangrove_wood";
  MinecraftItemTypes2["MediumAmethystBud"] = "minecraft:medium_amethyst_bud";
  MinecraftItemTypes2["MelonBlock"] = "minecraft:melon_block";
  MinecraftItemTypes2["MelonSeeds"] = "minecraft:melon_seeds";
  MinecraftItemTypes2["MelonSlice"] = "minecraft:melon_slice";
  MinecraftItemTypes2["MilkBucket"] = "minecraft:milk_bucket";
  MinecraftItemTypes2["Minecart"] = "minecraft:minecart";
  MinecraftItemTypes2["MinerPotterySherd"] = "minecraft:miner_pottery_sherd";
  MinecraftItemTypes2["MobSpawner"] = "minecraft:mob_spawner";
  MinecraftItemTypes2["MojangBannerPattern"] = "minecraft:mojang_banner_pattern";
  MinecraftItemTypes2["MooshroomSpawnEgg"] = "minecraft:mooshroom_spawn_egg";
  MinecraftItemTypes2["MossBlock"] = "minecraft:moss_block";
  MinecraftItemTypes2["MossCarpet"] = "minecraft:moss_carpet";
  MinecraftItemTypes2["MossyCobblestone"] = "minecraft:mossy_cobblestone";
  MinecraftItemTypes2["MossyCobblestoneSlab"] = "minecraft:mossy_cobblestone_slab";
  MinecraftItemTypes2["MossyCobblestoneStairs"] = "minecraft:mossy_cobblestone_stairs";
  MinecraftItemTypes2["MossyCobblestoneWall"] = "minecraft:mossy_cobblestone_wall";
  MinecraftItemTypes2["MossyStoneBrickSlab"] = "minecraft:mossy_stone_brick_slab";
  MinecraftItemTypes2["MossyStoneBrickStairs"] = "minecraft:mossy_stone_brick_stairs";
  MinecraftItemTypes2["MossyStoneBrickWall"] = "minecraft:mossy_stone_brick_wall";
  MinecraftItemTypes2["MossyStoneBricks"] = "minecraft:mossy_stone_bricks";
  MinecraftItemTypes2["MournerPotterySherd"] = "minecraft:mourner_pottery_sherd";
  MinecraftItemTypes2["Mud"] = "minecraft:mud";
  MinecraftItemTypes2["MudBrickSlab"] = "minecraft:mud_brick_slab";
  MinecraftItemTypes2["MudBrickStairs"] = "minecraft:mud_brick_stairs";
  MinecraftItemTypes2["MudBrickWall"] = "minecraft:mud_brick_wall";
  MinecraftItemTypes2["MudBricks"] = "minecraft:mud_bricks";
  MinecraftItemTypes2["MuddyMangroveRoots"] = "minecraft:muddy_mangrove_roots";
  MinecraftItemTypes2["MuleSpawnEgg"] = "minecraft:mule_spawn_egg";
  MinecraftItemTypes2["MushroomStem"] = "minecraft:mushroom_stem";
  MinecraftItemTypes2["MushroomStew"] = "minecraft:mushroom_stew";
  MinecraftItemTypes2["MusicDisc11"] = "minecraft:music_disc_11";
  MinecraftItemTypes2["MusicDisc13"] = "minecraft:music_disc_13";
  MinecraftItemTypes2["MusicDisc5"] = "minecraft:music_disc_5";
  MinecraftItemTypes2["MusicDiscBlocks"] = "minecraft:music_disc_blocks";
  MinecraftItemTypes2["MusicDiscCat"] = "minecraft:music_disc_cat";
  MinecraftItemTypes2["MusicDiscChirp"] = "minecraft:music_disc_chirp";
  MinecraftItemTypes2["MusicDiscCreator"] = "minecraft:music_disc_creator";
  MinecraftItemTypes2["MusicDiscCreatorMusicBox"] = "minecraft:music_disc_creator_music_box";
  MinecraftItemTypes2["MusicDiscFar"] = "minecraft:music_disc_far";
  MinecraftItemTypes2["MusicDiscMall"] = "minecraft:music_disc_mall";
  MinecraftItemTypes2["MusicDiscMellohi"] = "minecraft:music_disc_mellohi";
  MinecraftItemTypes2["MusicDiscOtherside"] = "minecraft:music_disc_otherside";
  MinecraftItemTypes2["MusicDiscPigstep"] = "minecraft:music_disc_pigstep";
  MinecraftItemTypes2["MusicDiscPrecipice"] = "minecraft:music_disc_precipice";
  MinecraftItemTypes2["MusicDiscRelic"] = "minecraft:music_disc_relic";
  MinecraftItemTypes2["MusicDiscStal"] = "minecraft:music_disc_stal";
  MinecraftItemTypes2["MusicDiscStrad"] = "minecraft:music_disc_strad";
  MinecraftItemTypes2["MusicDiscWait"] = "minecraft:music_disc_wait";
  MinecraftItemTypes2["MusicDiscWard"] = "minecraft:music_disc_ward";
  MinecraftItemTypes2["Mutton"] = "minecraft:mutton";
  MinecraftItemTypes2["Mycelium"] = "minecraft:mycelium";
  MinecraftItemTypes2["NameTag"] = "minecraft:name_tag";
  MinecraftItemTypes2["NautilusShell"] = "minecraft:nautilus_shell";
  MinecraftItemTypes2["NetherBrick"] = "minecraft:nether_brick";
  MinecraftItemTypes2["NetherBrickFence"] = "minecraft:nether_brick_fence";
  MinecraftItemTypes2["NetherBrickSlab"] = "minecraft:nether_brick_slab";
  MinecraftItemTypes2["NetherBrickStairs"] = "minecraft:nether_brick_stairs";
  MinecraftItemTypes2["NetherBrickWall"] = "minecraft:nether_brick_wall";
  MinecraftItemTypes2["NetherGoldOre"] = "minecraft:nether_gold_ore";
  MinecraftItemTypes2["NetherSprouts"] = "minecraft:nether_sprouts";
  MinecraftItemTypes2["NetherStar"] = "minecraft:nether_star";
  MinecraftItemTypes2["NetherWart"] = "minecraft:nether_wart";
  MinecraftItemTypes2["NetherWartBlock"] = "minecraft:nether_wart_block";
  MinecraftItemTypes2["Netherbrick"] = "minecraft:netherbrick";
  MinecraftItemTypes2["NetheriteAxe"] = "minecraft:netherite_axe";
  MinecraftItemTypes2["NetheriteBlock"] = "minecraft:netherite_block";
  MinecraftItemTypes2["NetheriteBoots"] = "minecraft:netherite_boots";
  MinecraftItemTypes2["NetheriteChestplate"] = "minecraft:netherite_chestplate";
  MinecraftItemTypes2["NetheriteHelmet"] = "minecraft:netherite_helmet";
  MinecraftItemTypes2["NetheriteHoe"] = "minecraft:netherite_hoe";
  MinecraftItemTypes2["NetheriteIngot"] = "minecraft:netherite_ingot";
  MinecraftItemTypes2["NetheriteLeggings"] = "minecraft:netherite_leggings";
  MinecraftItemTypes2["NetheritePickaxe"] = "minecraft:netherite_pickaxe";
  MinecraftItemTypes2["NetheriteScrap"] = "minecraft:netherite_scrap";
  MinecraftItemTypes2["NetheriteShovel"] = "minecraft:netherite_shovel";
  MinecraftItemTypes2["NetheriteSword"] = "minecraft:netherite_sword";
  MinecraftItemTypes2["NetheriteUpgradeSmithingTemplate"] = "minecraft:netherite_upgrade_smithing_template";
  MinecraftItemTypes2["Netherrack"] = "minecraft:netherrack";
  MinecraftItemTypes2["NormalStoneSlab"] = "minecraft:normal_stone_slab";
  MinecraftItemTypes2["NormalStoneStairs"] = "minecraft:normal_stone_stairs";
  MinecraftItemTypes2["Noteblock"] = "minecraft:noteblock";
  MinecraftItemTypes2["OakBoat"] = "minecraft:oak_boat";
  MinecraftItemTypes2["OakChestBoat"] = "minecraft:oak_chest_boat";
  MinecraftItemTypes2["OakFence"] = "minecraft:oak_fence";
  MinecraftItemTypes2["OakHangingSign"] = "minecraft:oak_hanging_sign";
  MinecraftItemTypes2["OakLeaves"] = "minecraft:oak_leaves";
  MinecraftItemTypes2["OakLog"] = "minecraft:oak_log";
  MinecraftItemTypes2["OakPlanks"] = "minecraft:oak_planks";
  MinecraftItemTypes2["OakSapling"] = "minecraft:oak_sapling";
  MinecraftItemTypes2["OakSign"] = "minecraft:oak_sign";
  MinecraftItemTypes2["OakSlab"] = "minecraft:oak_slab";
  MinecraftItemTypes2["OakStairs"] = "minecraft:oak_stairs";
  MinecraftItemTypes2["OakWood"] = "minecraft:oak_wood";
  MinecraftItemTypes2["Observer"] = "minecraft:observer";
  MinecraftItemTypes2["Obsidian"] = "minecraft:obsidian";
  MinecraftItemTypes2["OcelotSpawnEgg"] = "minecraft:ocelot_spawn_egg";
  MinecraftItemTypes2["OchreFroglight"] = "minecraft:ochre_froglight";
  MinecraftItemTypes2["OminousBottle"] = "minecraft:ominous_bottle";
  MinecraftItemTypes2["OminousTrialKey"] = "minecraft:ominous_trial_key";
  MinecraftItemTypes2["OpenEyeblossom"] = "minecraft:open_eyeblossom";
  MinecraftItemTypes2["OrangeBundle"] = "minecraft:orange_bundle";
  MinecraftItemTypes2["OrangeCandle"] = "minecraft:orange_candle";
  MinecraftItemTypes2["OrangeCarpet"] = "minecraft:orange_carpet";
  MinecraftItemTypes2["OrangeConcrete"] = "minecraft:orange_concrete";
  MinecraftItemTypes2["OrangeConcretePowder"] = "minecraft:orange_concrete_powder";
  MinecraftItemTypes2["OrangeDye"] = "minecraft:orange_dye";
  MinecraftItemTypes2["OrangeGlazedTerracotta"] = "minecraft:orange_glazed_terracotta";
  MinecraftItemTypes2["OrangeHarness"] = "minecraft:orange_harness";
  MinecraftItemTypes2["OrangeShulkerBox"] = "minecraft:orange_shulker_box";
  MinecraftItemTypes2["OrangeStainedGlass"] = "minecraft:orange_stained_glass";
  MinecraftItemTypes2["OrangeStainedGlassPane"] = "minecraft:orange_stained_glass_pane";
  MinecraftItemTypes2["OrangeTerracotta"] = "minecraft:orange_terracotta";
  MinecraftItemTypes2["OrangeTulip"] = "minecraft:orange_tulip";
  MinecraftItemTypes2["OrangeWool"] = "minecraft:orange_wool";
  MinecraftItemTypes2["OxeyeDaisy"] = "minecraft:oxeye_daisy";
  MinecraftItemTypes2["OxidizedChiseledCopper"] = "minecraft:oxidized_chiseled_copper";
  MinecraftItemTypes2["OxidizedCopper"] = "minecraft:oxidized_copper";
  MinecraftItemTypes2["OxidizedCopperBulb"] = "minecraft:oxidized_copper_bulb";
  MinecraftItemTypes2["OxidizedCopperDoor"] = "minecraft:oxidized_copper_door";
  MinecraftItemTypes2["OxidizedCopperGrate"] = "minecraft:oxidized_copper_grate";
  MinecraftItemTypes2["OxidizedCopperTrapdoor"] = "minecraft:oxidized_copper_trapdoor";
  MinecraftItemTypes2["OxidizedCutCopper"] = "minecraft:oxidized_cut_copper";
  MinecraftItemTypes2["OxidizedCutCopperSlab"] = "minecraft:oxidized_cut_copper_slab";
  MinecraftItemTypes2["OxidizedCutCopperStairs"] = "minecraft:oxidized_cut_copper_stairs";
  MinecraftItemTypes2["PackedIce"] = "minecraft:packed_ice";
  MinecraftItemTypes2["PackedMud"] = "minecraft:packed_mud";
  MinecraftItemTypes2["Painting"] = "minecraft:painting";
  MinecraftItemTypes2["PaleHangingMoss"] = "minecraft:pale_hanging_moss";
  MinecraftItemTypes2["PaleMossBlock"] = "minecraft:pale_moss_block";
  MinecraftItemTypes2["PaleMossCarpet"] = "minecraft:pale_moss_carpet";
  MinecraftItemTypes2["PaleOakBoat"] = "minecraft:pale_oak_boat";
  MinecraftItemTypes2["PaleOakButton"] = "minecraft:pale_oak_button";
  MinecraftItemTypes2["PaleOakChestBoat"] = "minecraft:pale_oak_chest_boat";
  MinecraftItemTypes2["PaleOakDoor"] = "minecraft:pale_oak_door";
  MinecraftItemTypes2["PaleOakFence"] = "minecraft:pale_oak_fence";
  MinecraftItemTypes2["PaleOakFenceGate"] = "minecraft:pale_oak_fence_gate";
  MinecraftItemTypes2["PaleOakHangingSign"] = "minecraft:pale_oak_hanging_sign";
  MinecraftItemTypes2["PaleOakLeaves"] = "minecraft:pale_oak_leaves";
  MinecraftItemTypes2["PaleOakLog"] = "minecraft:pale_oak_log";
  MinecraftItemTypes2["PaleOakPlanks"] = "minecraft:pale_oak_planks";
  MinecraftItemTypes2["PaleOakPressurePlate"] = "minecraft:pale_oak_pressure_plate";
  MinecraftItemTypes2["PaleOakSapling"] = "minecraft:pale_oak_sapling";
  MinecraftItemTypes2["PaleOakSign"] = "minecraft:pale_oak_sign";
  MinecraftItemTypes2["PaleOakSlab"] = "minecraft:pale_oak_slab";
  MinecraftItemTypes2["PaleOakStairs"] = "minecraft:pale_oak_stairs";
  MinecraftItemTypes2["PaleOakTrapdoor"] = "minecraft:pale_oak_trapdoor";
  MinecraftItemTypes2["PaleOakWood"] = "minecraft:pale_oak_wood";
  MinecraftItemTypes2["PandaSpawnEgg"] = "minecraft:panda_spawn_egg";
  MinecraftItemTypes2["Paper"] = "minecraft:paper";
  MinecraftItemTypes2["ParrotSpawnEgg"] = "minecraft:parrot_spawn_egg";
  MinecraftItemTypes2["PearlescentFroglight"] = "minecraft:pearlescent_froglight";
  MinecraftItemTypes2["Peony"] = "minecraft:peony";
  MinecraftItemTypes2["PetrifiedOakSlab"] = "minecraft:petrified_oak_slab";
  MinecraftItemTypes2["PhantomMembrane"] = "minecraft:phantom_membrane";
  MinecraftItemTypes2["PhantomSpawnEgg"] = "minecraft:phantom_spawn_egg";
  MinecraftItemTypes2["PigSpawnEgg"] = "minecraft:pig_spawn_egg";
  MinecraftItemTypes2["PiglinBannerPattern"] = "minecraft:piglin_banner_pattern";
  MinecraftItemTypes2["PiglinBruteSpawnEgg"] = "minecraft:piglin_brute_spawn_egg";
  MinecraftItemTypes2["PiglinHead"] = "minecraft:piglin_head";
  MinecraftItemTypes2["PiglinSpawnEgg"] = "minecraft:piglin_spawn_egg";
  MinecraftItemTypes2["PillagerSpawnEgg"] = "minecraft:pillager_spawn_egg";
  MinecraftItemTypes2["PinkBundle"] = "minecraft:pink_bundle";
  MinecraftItemTypes2["PinkCandle"] = "minecraft:pink_candle";
  MinecraftItemTypes2["PinkCarpet"] = "minecraft:pink_carpet";
  MinecraftItemTypes2["PinkConcrete"] = "minecraft:pink_concrete";
  MinecraftItemTypes2["PinkConcretePowder"] = "minecraft:pink_concrete_powder";
  MinecraftItemTypes2["PinkDye"] = "minecraft:pink_dye";
  MinecraftItemTypes2["PinkGlazedTerracotta"] = "minecraft:pink_glazed_terracotta";
  MinecraftItemTypes2["PinkHarness"] = "minecraft:pink_harness";
  MinecraftItemTypes2["PinkPetals"] = "minecraft:pink_petals";
  MinecraftItemTypes2["PinkShulkerBox"] = "minecraft:pink_shulker_box";
  MinecraftItemTypes2["PinkStainedGlass"] = "minecraft:pink_stained_glass";
  MinecraftItemTypes2["PinkStainedGlassPane"] = "minecraft:pink_stained_glass_pane";
  MinecraftItemTypes2["PinkTerracotta"] = "minecraft:pink_terracotta";
  MinecraftItemTypes2["PinkTulip"] = "minecraft:pink_tulip";
  MinecraftItemTypes2["PinkWool"] = "minecraft:pink_wool";
  MinecraftItemTypes2["Piston"] = "minecraft:piston";
  MinecraftItemTypes2["PitcherPlant"] = "minecraft:pitcher_plant";
  MinecraftItemTypes2["PitcherPod"] = "minecraft:pitcher_pod";
  MinecraftItemTypes2["PlayerHead"] = "minecraft:player_head";
  MinecraftItemTypes2["PlentyPotterySherd"] = "minecraft:plenty_pottery_sherd";
  MinecraftItemTypes2["Podzol"] = "minecraft:podzol";
  MinecraftItemTypes2["PointedDripstone"] = "minecraft:pointed_dripstone";
  MinecraftItemTypes2["PoisonousPotato"] = "minecraft:poisonous_potato";
  MinecraftItemTypes2["PolarBearSpawnEgg"] = "minecraft:polar_bear_spawn_egg";
  MinecraftItemTypes2["PolishedAndesite"] = "minecraft:polished_andesite";
  MinecraftItemTypes2["PolishedAndesiteSlab"] = "minecraft:polished_andesite_slab";
  MinecraftItemTypes2["PolishedAndesiteStairs"] = "minecraft:polished_andesite_stairs";
  MinecraftItemTypes2["PolishedBasalt"] = "minecraft:polished_basalt";
  MinecraftItemTypes2["PolishedBlackstone"] = "minecraft:polished_blackstone";
  MinecraftItemTypes2["PolishedBlackstoneBrickSlab"] = "minecraft:polished_blackstone_brick_slab";
  MinecraftItemTypes2["PolishedBlackstoneBrickStairs"] = "minecraft:polished_blackstone_brick_stairs";
  MinecraftItemTypes2["PolishedBlackstoneBrickWall"] = "minecraft:polished_blackstone_brick_wall";
  MinecraftItemTypes2["PolishedBlackstoneBricks"] = "minecraft:polished_blackstone_bricks";
  MinecraftItemTypes2["PolishedBlackstoneButton"] = "minecraft:polished_blackstone_button";
  MinecraftItemTypes2["PolishedBlackstonePressurePlate"] = "minecraft:polished_blackstone_pressure_plate";
  MinecraftItemTypes2["PolishedBlackstoneSlab"] = "minecraft:polished_blackstone_slab";
  MinecraftItemTypes2["PolishedBlackstoneStairs"] = "minecraft:polished_blackstone_stairs";
  MinecraftItemTypes2["PolishedBlackstoneWall"] = "minecraft:polished_blackstone_wall";
  MinecraftItemTypes2["PolishedDeepslate"] = "minecraft:polished_deepslate";
  MinecraftItemTypes2["PolishedDeepslateSlab"] = "minecraft:polished_deepslate_slab";
  MinecraftItemTypes2["PolishedDeepslateStairs"] = "minecraft:polished_deepslate_stairs";
  MinecraftItemTypes2["PolishedDeepslateWall"] = "minecraft:polished_deepslate_wall";
  MinecraftItemTypes2["PolishedDiorite"] = "minecraft:polished_diorite";
  MinecraftItemTypes2["PolishedDioriteSlab"] = "minecraft:polished_diorite_slab";
  MinecraftItemTypes2["PolishedDioriteStairs"] = "minecraft:polished_diorite_stairs";
  MinecraftItemTypes2["PolishedGranite"] = "minecraft:polished_granite";
  MinecraftItemTypes2["PolishedGraniteSlab"] = "minecraft:polished_granite_slab";
  MinecraftItemTypes2["PolishedGraniteStairs"] = "minecraft:polished_granite_stairs";
  MinecraftItemTypes2["PolishedTuff"] = "minecraft:polished_tuff";
  MinecraftItemTypes2["PolishedTuffSlab"] = "minecraft:polished_tuff_slab";
  MinecraftItemTypes2["PolishedTuffStairs"] = "minecraft:polished_tuff_stairs";
  MinecraftItemTypes2["PolishedTuffWall"] = "minecraft:polished_tuff_wall";
  MinecraftItemTypes2["PoppedChorusFruit"] = "minecraft:popped_chorus_fruit";
  MinecraftItemTypes2["Poppy"] = "minecraft:poppy";
  MinecraftItemTypes2["Porkchop"] = "minecraft:porkchop";
  MinecraftItemTypes2["Potato"] = "minecraft:potato";
  MinecraftItemTypes2["Potion"] = "minecraft:potion";
  MinecraftItemTypes2["PowderSnowBucket"] = "minecraft:powder_snow_bucket";
  MinecraftItemTypes2["Prismarine"] = "minecraft:prismarine";
  MinecraftItemTypes2["PrismarineBrickSlab"] = "minecraft:prismarine_brick_slab";
  MinecraftItemTypes2["PrismarineBricks"] = "minecraft:prismarine_bricks";
  MinecraftItemTypes2["PrismarineBricksStairs"] = "minecraft:prismarine_bricks_stairs";
  MinecraftItemTypes2["PrismarineCrystals"] = "minecraft:prismarine_crystals";
  MinecraftItemTypes2["PrismarineShard"] = "minecraft:prismarine_shard";
  MinecraftItemTypes2["PrismarineSlab"] = "minecraft:prismarine_slab";
  MinecraftItemTypes2["PrismarineStairs"] = "minecraft:prismarine_stairs";
  MinecraftItemTypes2["PrismarineWall"] = "minecraft:prismarine_wall";
  MinecraftItemTypes2["PrizePotterySherd"] = "minecraft:prize_pottery_sherd";
  MinecraftItemTypes2["Pufferfish"] = "minecraft:pufferfish";
  MinecraftItemTypes2["PufferfishBucket"] = "minecraft:pufferfish_bucket";
  MinecraftItemTypes2["PufferfishSpawnEgg"] = "minecraft:pufferfish_spawn_egg";
  MinecraftItemTypes2["Pumpkin"] = "minecraft:pumpkin";
  MinecraftItemTypes2["PumpkinPie"] = "minecraft:pumpkin_pie";
  MinecraftItemTypes2["PumpkinSeeds"] = "minecraft:pumpkin_seeds";
  MinecraftItemTypes2["PurpleBundle"] = "minecraft:purple_bundle";
  MinecraftItemTypes2["PurpleCandle"] = "minecraft:purple_candle";
  MinecraftItemTypes2["PurpleCarpet"] = "minecraft:purple_carpet";
  MinecraftItemTypes2["PurpleConcrete"] = "minecraft:purple_concrete";
  MinecraftItemTypes2["PurpleConcretePowder"] = "minecraft:purple_concrete_powder";
  MinecraftItemTypes2["PurpleDye"] = "minecraft:purple_dye";
  MinecraftItemTypes2["PurpleGlazedTerracotta"] = "minecraft:purple_glazed_terracotta";
  MinecraftItemTypes2["PurpleHarness"] = "minecraft:purple_harness";
  MinecraftItemTypes2["PurpleShulkerBox"] = "minecraft:purple_shulker_box";
  MinecraftItemTypes2["PurpleStainedGlass"] = "minecraft:purple_stained_glass";
  MinecraftItemTypes2["PurpleStainedGlassPane"] = "minecraft:purple_stained_glass_pane";
  MinecraftItemTypes2["PurpleTerracotta"] = "minecraft:purple_terracotta";
  MinecraftItemTypes2["PurpleWool"] = "minecraft:purple_wool";
  MinecraftItemTypes2["PurpurBlock"] = "minecraft:purpur_block";
  MinecraftItemTypes2["PurpurPillar"] = "minecraft:purpur_pillar";
  MinecraftItemTypes2["PurpurSlab"] = "minecraft:purpur_slab";
  MinecraftItemTypes2["PurpurStairs"] = "minecraft:purpur_stairs";
  MinecraftItemTypes2["Quartz"] = "minecraft:quartz";
  MinecraftItemTypes2["QuartzBlock"] = "minecraft:quartz_block";
  MinecraftItemTypes2["QuartzBricks"] = "minecraft:quartz_bricks";
  MinecraftItemTypes2["QuartzOre"] = "minecraft:quartz_ore";
  MinecraftItemTypes2["QuartzPillar"] = "minecraft:quartz_pillar";
  MinecraftItemTypes2["QuartzSlab"] = "minecraft:quartz_slab";
  MinecraftItemTypes2["QuartzStairs"] = "minecraft:quartz_stairs";
  MinecraftItemTypes2["Rabbit"] = "minecraft:rabbit";
  MinecraftItemTypes2["RabbitFoot"] = "minecraft:rabbit_foot";
  MinecraftItemTypes2["RabbitHide"] = "minecraft:rabbit_hide";
  MinecraftItemTypes2["RabbitSpawnEgg"] = "minecraft:rabbit_spawn_egg";
  MinecraftItemTypes2["RabbitStew"] = "minecraft:rabbit_stew";
  MinecraftItemTypes2["Rail"] = "minecraft:rail";
  MinecraftItemTypes2["RaiserArmorTrimSmithingTemplate"] = "minecraft:raiser_armor_trim_smithing_template";
  MinecraftItemTypes2["RavagerSpawnEgg"] = "minecraft:ravager_spawn_egg";
  MinecraftItemTypes2["RawCopper"] = "minecraft:raw_copper";
  MinecraftItemTypes2["RawCopperBlock"] = "minecraft:raw_copper_block";
  MinecraftItemTypes2["RawGold"] = "minecraft:raw_gold";
  MinecraftItemTypes2["RawGoldBlock"] = "minecraft:raw_gold_block";
  MinecraftItemTypes2["RawIron"] = "minecraft:raw_iron";
  MinecraftItemTypes2["RawIronBlock"] = "minecraft:raw_iron_block";
  MinecraftItemTypes2["RecoveryCompass"] = "minecraft:recovery_compass";
  MinecraftItemTypes2["RedBundle"] = "minecraft:red_bundle";
  MinecraftItemTypes2["RedCandle"] = "minecraft:red_candle";
  MinecraftItemTypes2["RedCarpet"] = "minecraft:red_carpet";
  MinecraftItemTypes2["RedConcrete"] = "minecraft:red_concrete";
  MinecraftItemTypes2["RedConcretePowder"] = "minecraft:red_concrete_powder";
  MinecraftItemTypes2["RedDye"] = "minecraft:red_dye";
  MinecraftItemTypes2["RedGlazedTerracotta"] = "minecraft:red_glazed_terracotta";
  MinecraftItemTypes2["RedHarness"] = "minecraft:red_harness";
  MinecraftItemTypes2["RedMushroom"] = "minecraft:red_mushroom";
  MinecraftItemTypes2["RedMushroomBlock"] = "minecraft:red_mushroom_block";
  MinecraftItemTypes2["RedNetherBrick"] = "minecraft:red_nether_brick";
  MinecraftItemTypes2["RedNetherBrickSlab"] = "minecraft:red_nether_brick_slab";
  MinecraftItemTypes2["RedNetherBrickStairs"] = "minecraft:red_nether_brick_stairs";
  MinecraftItemTypes2["RedNetherBrickWall"] = "minecraft:red_nether_brick_wall";
  MinecraftItemTypes2["RedSand"] = "minecraft:red_sand";
  MinecraftItemTypes2["RedSandstone"] = "minecraft:red_sandstone";
  MinecraftItemTypes2["RedSandstoneSlab"] = "minecraft:red_sandstone_slab";
  MinecraftItemTypes2["RedSandstoneStairs"] = "minecraft:red_sandstone_stairs";
  MinecraftItemTypes2["RedSandstoneWall"] = "minecraft:red_sandstone_wall";
  MinecraftItemTypes2["RedShulkerBox"] = "minecraft:red_shulker_box";
  MinecraftItemTypes2["RedStainedGlass"] = "minecraft:red_stained_glass";
  MinecraftItemTypes2["RedStainedGlassPane"] = "minecraft:red_stained_glass_pane";
  MinecraftItemTypes2["RedTerracotta"] = "minecraft:red_terracotta";
  MinecraftItemTypes2["RedTulip"] = "minecraft:red_tulip";
  MinecraftItemTypes2["RedWool"] = "minecraft:red_wool";
  MinecraftItemTypes2["Redstone"] = "minecraft:redstone";
  MinecraftItemTypes2["RedstoneBlock"] = "minecraft:redstone_block";
  MinecraftItemTypes2["RedstoneLamp"] = "minecraft:redstone_lamp";
  MinecraftItemTypes2["RedstoneOre"] = "minecraft:redstone_ore";
  MinecraftItemTypes2["RedstoneTorch"] = "minecraft:redstone_torch";
  MinecraftItemTypes2["ReinforcedDeepslate"] = "minecraft:reinforced_deepslate";
  MinecraftItemTypes2["Repeater"] = "minecraft:repeater";
  MinecraftItemTypes2["RepeatingCommandBlock"] = "minecraft:repeating_command_block";
  MinecraftItemTypes2["ResinBlock"] = "minecraft:resin_block";
  MinecraftItemTypes2["ResinBrick"] = "minecraft:resin_brick";
  MinecraftItemTypes2["ResinBrickSlab"] = "minecraft:resin_brick_slab";
  MinecraftItemTypes2["ResinBrickStairs"] = "minecraft:resin_brick_stairs";
  MinecraftItemTypes2["ResinBrickWall"] = "minecraft:resin_brick_wall";
  MinecraftItemTypes2["ResinBricks"] = "minecraft:resin_bricks";
  MinecraftItemTypes2["ResinClump"] = "minecraft:resin_clump";
  MinecraftItemTypes2["RespawnAnchor"] = "minecraft:respawn_anchor";
  MinecraftItemTypes2["RibArmorTrimSmithingTemplate"] = "minecraft:rib_armor_trim_smithing_template";
  MinecraftItemTypes2["RoseBush"] = "minecraft:rose_bush";
  MinecraftItemTypes2["RottenFlesh"] = "minecraft:rotten_flesh";
  MinecraftItemTypes2["Saddle"] = "minecraft:saddle";
  MinecraftItemTypes2["Salmon"] = "minecraft:salmon";
  MinecraftItemTypes2["SalmonBucket"] = "minecraft:salmon_bucket";
  MinecraftItemTypes2["SalmonSpawnEgg"] = "minecraft:salmon_spawn_egg";
  MinecraftItemTypes2["Sand"] = "minecraft:sand";
  MinecraftItemTypes2["Sandstone"] = "minecraft:sandstone";
  MinecraftItemTypes2["SandstoneSlab"] = "minecraft:sandstone_slab";
  MinecraftItemTypes2["SandstoneStairs"] = "minecraft:sandstone_stairs";
  MinecraftItemTypes2["SandstoneWall"] = "minecraft:sandstone_wall";
  MinecraftItemTypes2["Scaffolding"] = "minecraft:scaffolding";
  MinecraftItemTypes2["ScrapePotterySherd"] = "minecraft:scrape_pottery_sherd";
  MinecraftItemTypes2["Sculk"] = "minecraft:sculk";
  MinecraftItemTypes2["SculkCatalyst"] = "minecraft:sculk_catalyst";
  MinecraftItemTypes2["SculkSensor"] = "minecraft:sculk_sensor";
  MinecraftItemTypes2["SculkShrieker"] = "minecraft:sculk_shrieker";
  MinecraftItemTypes2["SculkVein"] = "minecraft:sculk_vein";
  MinecraftItemTypes2["SeaLantern"] = "minecraft:sea_lantern";
  MinecraftItemTypes2["SeaPickle"] = "minecraft:sea_pickle";
  MinecraftItemTypes2["Seagrass"] = "minecraft:seagrass";
  MinecraftItemTypes2["SentryArmorTrimSmithingTemplate"] = "minecraft:sentry_armor_trim_smithing_template";
  MinecraftItemTypes2["ShaperArmorTrimSmithingTemplate"] = "minecraft:shaper_armor_trim_smithing_template";
  MinecraftItemTypes2["SheafPotterySherd"] = "minecraft:sheaf_pottery_sherd";
  MinecraftItemTypes2["Shears"] = "minecraft:shears";
  MinecraftItemTypes2["SheepSpawnEgg"] = "minecraft:sheep_spawn_egg";
  MinecraftItemTypes2["ShelterPotterySherd"] = "minecraft:shelter_pottery_sherd";
  MinecraftItemTypes2["Shield"] = "minecraft:shield";
  MinecraftItemTypes2["ShortDryGrass"] = "minecraft:short_dry_grass";
  MinecraftItemTypes2["ShortGrass"] = "minecraft:short_grass";
  MinecraftItemTypes2["Shroomlight"] = "minecraft:shroomlight";
  MinecraftItemTypes2["ShulkerShell"] = "minecraft:shulker_shell";
  MinecraftItemTypes2["ShulkerSpawnEgg"] = "minecraft:shulker_spawn_egg";
  MinecraftItemTypes2["SilenceArmorTrimSmithingTemplate"] = "minecraft:silence_armor_trim_smithing_template";
  MinecraftItemTypes2["SilverGlazedTerracotta"] = "minecraft:silver_glazed_terracotta";
  MinecraftItemTypes2["SilverfishSpawnEgg"] = "minecraft:silverfish_spawn_egg";
  MinecraftItemTypes2["SkeletonHorseSpawnEgg"] = "minecraft:skeleton_horse_spawn_egg";
  MinecraftItemTypes2["SkeletonSkull"] = "minecraft:skeleton_skull";
  MinecraftItemTypes2["SkeletonSpawnEgg"] = "minecraft:skeleton_spawn_egg";
  MinecraftItemTypes2["SkullBannerPattern"] = "minecraft:skull_banner_pattern";
  MinecraftItemTypes2["SkullPotterySherd"] = "minecraft:skull_pottery_sherd";
  MinecraftItemTypes2["Slime"] = "minecraft:slime";
  MinecraftItemTypes2["SlimeBall"] = "minecraft:slime_ball";
  MinecraftItemTypes2["SlimeSpawnEgg"] = "minecraft:slime_spawn_egg";
  MinecraftItemTypes2["SmallAmethystBud"] = "minecraft:small_amethyst_bud";
  MinecraftItemTypes2["SmallDripleafBlock"] = "minecraft:small_dripleaf_block";
  MinecraftItemTypes2["SmithingTable"] = "minecraft:smithing_table";
  MinecraftItemTypes2["Smoker"] = "minecraft:smoker";
  MinecraftItemTypes2["SmoothBasalt"] = "minecraft:smooth_basalt";
  MinecraftItemTypes2["SmoothQuartz"] = "minecraft:smooth_quartz";
  MinecraftItemTypes2["SmoothQuartzSlab"] = "minecraft:smooth_quartz_slab";
  MinecraftItemTypes2["SmoothQuartzStairs"] = "minecraft:smooth_quartz_stairs";
  MinecraftItemTypes2["SmoothRedSandstone"] = "minecraft:smooth_red_sandstone";
  MinecraftItemTypes2["SmoothRedSandstoneSlab"] = "minecraft:smooth_red_sandstone_slab";
  MinecraftItemTypes2["SmoothRedSandstoneStairs"] = "minecraft:smooth_red_sandstone_stairs";
  MinecraftItemTypes2["SmoothSandstone"] = "minecraft:smooth_sandstone";
  MinecraftItemTypes2["SmoothSandstoneSlab"] = "minecraft:smooth_sandstone_slab";
  MinecraftItemTypes2["SmoothSandstoneStairs"] = "minecraft:smooth_sandstone_stairs";
  MinecraftItemTypes2["SmoothStone"] = "minecraft:smooth_stone";
  MinecraftItemTypes2["SmoothStoneSlab"] = "minecraft:smooth_stone_slab";
  MinecraftItemTypes2["SnifferEgg"] = "minecraft:sniffer_egg";
  MinecraftItemTypes2["SnifferSpawnEgg"] = "minecraft:sniffer_spawn_egg";
  MinecraftItemTypes2["SnortPotterySherd"] = "minecraft:snort_pottery_sherd";
  MinecraftItemTypes2["SnoutArmorTrimSmithingTemplate"] = "minecraft:snout_armor_trim_smithing_template";
  MinecraftItemTypes2["Snow"] = "minecraft:snow";
  MinecraftItemTypes2["SnowGolemSpawnEgg"] = "minecraft:snow_golem_spawn_egg";
  MinecraftItemTypes2["SnowLayer"] = "minecraft:snow_layer";
  MinecraftItemTypes2["Snowball"] = "minecraft:snowball";
  MinecraftItemTypes2["SoulCampfire"] = "minecraft:soul_campfire";
  MinecraftItemTypes2["SoulLantern"] = "minecraft:soul_lantern";
  MinecraftItemTypes2["SoulSand"] = "minecraft:soul_sand";
  MinecraftItemTypes2["SoulSoil"] = "minecraft:soul_soil";
  MinecraftItemTypes2["SoulTorch"] = "minecraft:soul_torch";
  MinecraftItemTypes2["SpiderEye"] = "minecraft:spider_eye";
  MinecraftItemTypes2["SpiderSpawnEgg"] = "minecraft:spider_spawn_egg";
  MinecraftItemTypes2["SpireArmorTrimSmithingTemplate"] = "minecraft:spire_armor_trim_smithing_template";
  MinecraftItemTypes2["SplashPotion"] = "minecraft:splash_potion";
  MinecraftItemTypes2["Sponge"] = "minecraft:sponge";
  MinecraftItemTypes2["SporeBlossom"] = "minecraft:spore_blossom";
  MinecraftItemTypes2["SpruceBoat"] = "minecraft:spruce_boat";
  MinecraftItemTypes2["SpruceButton"] = "minecraft:spruce_button";
  MinecraftItemTypes2["SpruceChestBoat"] = "minecraft:spruce_chest_boat";
  MinecraftItemTypes2["SpruceDoor"] = "minecraft:spruce_door";
  MinecraftItemTypes2["SpruceFence"] = "minecraft:spruce_fence";
  MinecraftItemTypes2["SpruceFenceGate"] = "minecraft:spruce_fence_gate";
  MinecraftItemTypes2["SpruceHangingSign"] = "minecraft:spruce_hanging_sign";
  MinecraftItemTypes2["SpruceLeaves"] = "minecraft:spruce_leaves";
  MinecraftItemTypes2["SpruceLog"] = "minecraft:spruce_log";
  MinecraftItemTypes2["SprucePlanks"] = "minecraft:spruce_planks";
  MinecraftItemTypes2["SprucePressurePlate"] = "minecraft:spruce_pressure_plate";
  MinecraftItemTypes2["SpruceSapling"] = "minecraft:spruce_sapling";
  MinecraftItemTypes2["SpruceSign"] = "minecraft:spruce_sign";
  MinecraftItemTypes2["SpruceSlab"] = "minecraft:spruce_slab";
  MinecraftItemTypes2["SpruceStairs"] = "minecraft:spruce_stairs";
  MinecraftItemTypes2["SpruceTrapdoor"] = "minecraft:spruce_trapdoor";
  MinecraftItemTypes2["SpruceWood"] = "minecraft:spruce_wood";
  MinecraftItemTypes2["Spyglass"] = "minecraft:spyglass";
  MinecraftItemTypes2["SquidSpawnEgg"] = "minecraft:squid_spawn_egg";
  MinecraftItemTypes2["Stick"] = "minecraft:stick";
  MinecraftItemTypes2["StickyPiston"] = "minecraft:sticky_piston";
  MinecraftItemTypes2["Stone"] = "minecraft:stone";
  MinecraftItemTypes2["StoneAxe"] = "minecraft:stone_axe";
  MinecraftItemTypes2["StoneBrickSlab"] = "minecraft:stone_brick_slab";
  MinecraftItemTypes2["StoneBrickStairs"] = "minecraft:stone_brick_stairs";
  MinecraftItemTypes2["StoneBrickWall"] = "minecraft:stone_brick_wall";
  MinecraftItemTypes2["StoneBricks"] = "minecraft:stone_bricks";
  MinecraftItemTypes2["StoneButton"] = "minecraft:stone_button";
  MinecraftItemTypes2["StoneHoe"] = "minecraft:stone_hoe";
  MinecraftItemTypes2["StonePickaxe"] = "minecraft:stone_pickaxe";
  MinecraftItemTypes2["StonePressurePlate"] = "minecraft:stone_pressure_plate";
  MinecraftItemTypes2["StoneShovel"] = "minecraft:stone_shovel";
  MinecraftItemTypes2["StoneStairs"] = "minecraft:stone_stairs";
  MinecraftItemTypes2["StoneSword"] = "minecraft:stone_sword";
  MinecraftItemTypes2["StonecutterBlock"] = "minecraft:stonecutter_block";
  MinecraftItemTypes2["StraySpawnEgg"] = "minecraft:stray_spawn_egg";
  MinecraftItemTypes2["StriderSpawnEgg"] = "minecraft:strider_spawn_egg";
  MinecraftItemTypes2["String"] = "minecraft:string";
  MinecraftItemTypes2["StrippedAcaciaLog"] = "minecraft:stripped_acacia_log";
  MinecraftItemTypes2["StrippedAcaciaWood"] = "minecraft:stripped_acacia_wood";
  MinecraftItemTypes2["StrippedBambooBlock"] = "minecraft:stripped_bamboo_block";
  MinecraftItemTypes2["StrippedBirchLog"] = "minecraft:stripped_birch_log";
  MinecraftItemTypes2["StrippedBirchWood"] = "minecraft:stripped_birch_wood";
  MinecraftItemTypes2["StrippedCherryLog"] = "minecraft:stripped_cherry_log";
  MinecraftItemTypes2["StrippedCherryWood"] = "minecraft:stripped_cherry_wood";
  MinecraftItemTypes2["StrippedCrimsonHyphae"] = "minecraft:stripped_crimson_hyphae";
  MinecraftItemTypes2["StrippedCrimsonStem"] = "minecraft:stripped_crimson_stem";
  MinecraftItemTypes2["StrippedDarkOakLog"] = "minecraft:stripped_dark_oak_log";
  MinecraftItemTypes2["StrippedDarkOakWood"] = "minecraft:stripped_dark_oak_wood";
  MinecraftItemTypes2["StrippedJungleLog"] = "minecraft:stripped_jungle_log";
  MinecraftItemTypes2["StrippedJungleWood"] = "minecraft:stripped_jungle_wood";
  MinecraftItemTypes2["StrippedMangroveLog"] = "minecraft:stripped_mangrove_log";
  MinecraftItemTypes2["StrippedMangroveWood"] = "minecraft:stripped_mangrove_wood";
  MinecraftItemTypes2["StrippedOakLog"] = "minecraft:stripped_oak_log";
  MinecraftItemTypes2["StrippedOakWood"] = "minecraft:stripped_oak_wood";
  MinecraftItemTypes2["StrippedPaleOakLog"] = "minecraft:stripped_pale_oak_log";
  MinecraftItemTypes2["StrippedPaleOakWood"] = "minecraft:stripped_pale_oak_wood";
  MinecraftItemTypes2["StrippedSpruceLog"] = "minecraft:stripped_spruce_log";
  MinecraftItemTypes2["StrippedSpruceWood"] = "minecraft:stripped_spruce_wood";
  MinecraftItemTypes2["StrippedWarpedHyphae"] = "minecraft:stripped_warped_hyphae";
  MinecraftItemTypes2["StrippedWarpedStem"] = "minecraft:stripped_warped_stem";
  MinecraftItemTypes2["StructureBlock"] = "minecraft:structure_block";
  MinecraftItemTypes2["StructureVoid"] = "minecraft:structure_void";
  MinecraftItemTypes2["Sugar"] = "minecraft:sugar";
  MinecraftItemTypes2["SugarCane"] = "minecraft:sugar_cane";
  MinecraftItemTypes2["Sunflower"] = "minecraft:sunflower";
  MinecraftItemTypes2["SuspiciousGravel"] = "minecraft:suspicious_gravel";
  MinecraftItemTypes2["SuspiciousSand"] = "minecraft:suspicious_sand";
  MinecraftItemTypes2["SuspiciousStew"] = "minecraft:suspicious_stew";
  MinecraftItemTypes2["SweetBerries"] = "minecraft:sweet_berries";
  MinecraftItemTypes2["TadpoleBucket"] = "minecraft:tadpole_bucket";
  MinecraftItemTypes2["TadpoleSpawnEgg"] = "minecraft:tadpole_spawn_egg";
  MinecraftItemTypes2["TallDryGrass"] = "minecraft:tall_dry_grass";
  MinecraftItemTypes2["TallGrass"] = "minecraft:tall_grass";
  MinecraftItemTypes2["Target"] = "minecraft:target";
  MinecraftItemTypes2["TideArmorTrimSmithingTemplate"] = "minecraft:tide_armor_trim_smithing_template";
  MinecraftItemTypes2["TintedGlass"] = "minecraft:tinted_glass";
  MinecraftItemTypes2["Tnt"] = "minecraft:tnt";
  MinecraftItemTypes2["TntMinecart"] = "minecraft:tnt_minecart";
  MinecraftItemTypes2["Torch"] = "minecraft:torch";
  MinecraftItemTypes2["Torchflower"] = "minecraft:torchflower";
  MinecraftItemTypes2["TorchflowerSeeds"] = "minecraft:torchflower_seeds";
  MinecraftItemTypes2["TotemOfUndying"] = "minecraft:totem_of_undying";
  MinecraftItemTypes2["TraderLlamaSpawnEgg"] = "minecraft:trader_llama_spawn_egg";
  MinecraftItemTypes2["Trapdoor"] = "minecraft:trapdoor";
  MinecraftItemTypes2["TrappedChest"] = "minecraft:trapped_chest";
  MinecraftItemTypes2["TrialKey"] = "minecraft:trial_key";
  MinecraftItemTypes2["TrialSpawner"] = "minecraft:trial_spawner";
  MinecraftItemTypes2["Trident"] = "minecraft:trident";
  MinecraftItemTypes2["TripwireHook"] = "minecraft:tripwire_hook";
  MinecraftItemTypes2["TropicalFish"] = "minecraft:tropical_fish";
  MinecraftItemTypes2["TropicalFishBucket"] = "minecraft:tropical_fish_bucket";
  MinecraftItemTypes2["TropicalFishSpawnEgg"] = "minecraft:tropical_fish_spawn_egg";
  MinecraftItemTypes2["TubeCoral"] = "minecraft:tube_coral";
  MinecraftItemTypes2["TubeCoralBlock"] = "minecraft:tube_coral_block";
  MinecraftItemTypes2["TubeCoralFan"] = "minecraft:tube_coral_fan";
  MinecraftItemTypes2["Tuff"] = "minecraft:tuff";
  MinecraftItemTypes2["TuffBrickSlab"] = "minecraft:tuff_brick_slab";
  MinecraftItemTypes2["TuffBrickStairs"] = "minecraft:tuff_brick_stairs";
  MinecraftItemTypes2["TuffBrickWall"] = "minecraft:tuff_brick_wall";
  MinecraftItemTypes2["TuffBricks"] = "minecraft:tuff_bricks";
  MinecraftItemTypes2["TuffSlab"] = "minecraft:tuff_slab";
  MinecraftItemTypes2["TuffStairs"] = "minecraft:tuff_stairs";
  MinecraftItemTypes2["TuffWall"] = "minecraft:tuff_wall";
  MinecraftItemTypes2["TurtleEgg"] = "minecraft:turtle_egg";
  MinecraftItemTypes2["TurtleHelmet"] = "minecraft:turtle_helmet";
  MinecraftItemTypes2["TurtleScute"] = "minecraft:turtle_scute";
  MinecraftItemTypes2["TurtleSpawnEgg"] = "minecraft:turtle_spawn_egg";
  MinecraftItemTypes2["TwistingVines"] = "minecraft:twisting_vines";
  MinecraftItemTypes2["UndyedShulkerBox"] = "minecraft:undyed_shulker_box";
  MinecraftItemTypes2["Vault"] = "minecraft:vault";
  MinecraftItemTypes2["VerdantFroglight"] = "minecraft:verdant_froglight";
  MinecraftItemTypes2["VexArmorTrimSmithingTemplate"] = "minecraft:vex_armor_trim_smithing_template";
  MinecraftItemTypes2["VexSpawnEgg"] = "minecraft:vex_spawn_egg";
  MinecraftItemTypes2["VillagerSpawnEgg"] = "minecraft:villager_spawn_egg";
  MinecraftItemTypes2["VindicatorSpawnEgg"] = "minecraft:vindicator_spawn_egg";
  MinecraftItemTypes2["Vine"] = "minecraft:vine";
  MinecraftItemTypes2["WanderingTraderSpawnEgg"] = "minecraft:wandering_trader_spawn_egg";
  MinecraftItemTypes2["WardArmorTrimSmithingTemplate"] = "minecraft:ward_armor_trim_smithing_template";
  MinecraftItemTypes2["WardenSpawnEgg"] = "minecraft:warden_spawn_egg";
  MinecraftItemTypes2["WarpedButton"] = "minecraft:warped_button";
  MinecraftItemTypes2["WarpedDoor"] = "minecraft:warped_door";
  MinecraftItemTypes2["WarpedFence"] = "minecraft:warped_fence";
  MinecraftItemTypes2["WarpedFenceGate"] = "minecraft:warped_fence_gate";
  MinecraftItemTypes2["WarpedFungus"] = "minecraft:warped_fungus";
  MinecraftItemTypes2["WarpedFungusOnAStick"] = "minecraft:warped_fungus_on_a_stick";
  MinecraftItemTypes2["WarpedHangingSign"] = "minecraft:warped_hanging_sign";
  MinecraftItemTypes2["WarpedHyphae"] = "minecraft:warped_hyphae";
  MinecraftItemTypes2["WarpedNylium"] = "minecraft:warped_nylium";
  MinecraftItemTypes2["WarpedPlanks"] = "minecraft:warped_planks";
  MinecraftItemTypes2["WarpedPressurePlate"] = "minecraft:warped_pressure_plate";
  MinecraftItemTypes2["WarpedRoots"] = "minecraft:warped_roots";
  MinecraftItemTypes2["WarpedSign"] = "minecraft:warped_sign";
  MinecraftItemTypes2["WarpedSlab"] = "minecraft:warped_slab";
  MinecraftItemTypes2["WarpedStairs"] = "minecraft:warped_stairs";
  MinecraftItemTypes2["WarpedStem"] = "minecraft:warped_stem";
  MinecraftItemTypes2["WarpedTrapdoor"] = "minecraft:warped_trapdoor";
  MinecraftItemTypes2["WarpedWartBlock"] = "minecraft:warped_wart_block";
  MinecraftItemTypes2["WaterBucket"] = "minecraft:water_bucket";
  MinecraftItemTypes2["Waterlily"] = "minecraft:waterlily";
  MinecraftItemTypes2["WaxedChiseledCopper"] = "minecraft:waxed_chiseled_copper";
  MinecraftItemTypes2["WaxedCopper"] = "minecraft:waxed_copper";
  MinecraftItemTypes2["WaxedCopperBulb"] = "minecraft:waxed_copper_bulb";
  MinecraftItemTypes2["WaxedCopperDoor"] = "minecraft:waxed_copper_door";
  MinecraftItemTypes2["WaxedCopperGrate"] = "minecraft:waxed_copper_grate";
  MinecraftItemTypes2["WaxedCopperTrapdoor"] = "minecraft:waxed_copper_trapdoor";
  MinecraftItemTypes2["WaxedCutCopper"] = "minecraft:waxed_cut_copper";
  MinecraftItemTypes2["WaxedCutCopperSlab"] = "minecraft:waxed_cut_copper_slab";
  MinecraftItemTypes2["WaxedCutCopperStairs"] = "minecraft:waxed_cut_copper_stairs";
  MinecraftItemTypes2["WaxedExposedChiseledCopper"] = "minecraft:waxed_exposed_chiseled_copper";
  MinecraftItemTypes2["WaxedExposedCopper"] = "minecraft:waxed_exposed_copper";
  MinecraftItemTypes2["WaxedExposedCopperBulb"] = "minecraft:waxed_exposed_copper_bulb";
  MinecraftItemTypes2["WaxedExposedCopperDoor"] = "minecraft:waxed_exposed_copper_door";
  MinecraftItemTypes2["WaxedExposedCopperGrate"] = "minecraft:waxed_exposed_copper_grate";
  MinecraftItemTypes2["WaxedExposedCopperTrapdoor"] = "minecraft:waxed_exposed_copper_trapdoor";
  MinecraftItemTypes2["WaxedExposedCutCopper"] = "minecraft:waxed_exposed_cut_copper";
  MinecraftItemTypes2["WaxedExposedCutCopperSlab"] = "minecraft:waxed_exposed_cut_copper_slab";
  MinecraftItemTypes2["WaxedExposedCutCopperStairs"] = "minecraft:waxed_exposed_cut_copper_stairs";
  MinecraftItemTypes2["WaxedOxidizedChiseledCopper"] = "minecraft:waxed_oxidized_chiseled_copper";
  MinecraftItemTypes2["WaxedOxidizedCopper"] = "minecraft:waxed_oxidized_copper";
  MinecraftItemTypes2["WaxedOxidizedCopperBulb"] = "minecraft:waxed_oxidized_copper_bulb";
  MinecraftItemTypes2["WaxedOxidizedCopperDoor"] = "minecraft:waxed_oxidized_copper_door";
  MinecraftItemTypes2["WaxedOxidizedCopperGrate"] = "minecraft:waxed_oxidized_copper_grate";
  MinecraftItemTypes2["WaxedOxidizedCopperTrapdoor"] = "minecraft:waxed_oxidized_copper_trapdoor";
  MinecraftItemTypes2["WaxedOxidizedCutCopper"] = "minecraft:waxed_oxidized_cut_copper";
  MinecraftItemTypes2["WaxedOxidizedCutCopperSlab"] = "minecraft:waxed_oxidized_cut_copper_slab";
  MinecraftItemTypes2["WaxedOxidizedCutCopperStairs"] = "minecraft:waxed_oxidized_cut_copper_stairs";
  MinecraftItemTypes2["WaxedWeatheredChiseledCopper"] = "minecraft:waxed_weathered_chiseled_copper";
  MinecraftItemTypes2["WaxedWeatheredCopper"] = "minecraft:waxed_weathered_copper";
  MinecraftItemTypes2["WaxedWeatheredCopperBulb"] = "minecraft:waxed_weathered_copper_bulb";
  MinecraftItemTypes2["WaxedWeatheredCopperDoor"] = "minecraft:waxed_weathered_copper_door";
  MinecraftItemTypes2["WaxedWeatheredCopperGrate"] = "minecraft:waxed_weathered_copper_grate";
  MinecraftItemTypes2["WaxedWeatheredCopperTrapdoor"] = "minecraft:waxed_weathered_copper_trapdoor";
  MinecraftItemTypes2["WaxedWeatheredCutCopper"] = "minecraft:waxed_weathered_cut_copper";
  MinecraftItemTypes2["WaxedWeatheredCutCopperSlab"] = "minecraft:waxed_weathered_cut_copper_slab";
  MinecraftItemTypes2["WaxedWeatheredCutCopperStairs"] = "minecraft:waxed_weathered_cut_copper_stairs";
  MinecraftItemTypes2["WayfinderArmorTrimSmithingTemplate"] = "minecraft:wayfinder_armor_trim_smithing_template";
  MinecraftItemTypes2["WeatheredChiseledCopper"] = "minecraft:weathered_chiseled_copper";
  MinecraftItemTypes2["WeatheredCopper"] = "minecraft:weathered_copper";
  MinecraftItemTypes2["WeatheredCopperBulb"] = "minecraft:weathered_copper_bulb";
  MinecraftItemTypes2["WeatheredCopperDoor"] = "minecraft:weathered_copper_door";
  MinecraftItemTypes2["WeatheredCopperGrate"] = "minecraft:weathered_copper_grate";
  MinecraftItemTypes2["WeatheredCopperTrapdoor"] = "minecraft:weathered_copper_trapdoor";
  MinecraftItemTypes2["WeatheredCutCopper"] = "minecraft:weathered_cut_copper";
  MinecraftItemTypes2["WeatheredCutCopperSlab"] = "minecraft:weathered_cut_copper_slab";
  MinecraftItemTypes2["WeatheredCutCopperStairs"] = "minecraft:weathered_cut_copper_stairs";
  MinecraftItemTypes2["Web"] = "minecraft:web";
  MinecraftItemTypes2["WeepingVines"] = "minecraft:weeping_vines";
  MinecraftItemTypes2["WetSponge"] = "minecraft:wet_sponge";
  MinecraftItemTypes2["Wheat"] = "minecraft:wheat";
  MinecraftItemTypes2["WheatSeeds"] = "minecraft:wheat_seeds";
  MinecraftItemTypes2["WhiteBundle"] = "minecraft:white_bundle";
  MinecraftItemTypes2["WhiteCandle"] = "minecraft:white_candle";
  MinecraftItemTypes2["WhiteCarpet"] = "minecraft:white_carpet";
  MinecraftItemTypes2["WhiteConcrete"] = "minecraft:white_concrete";
  MinecraftItemTypes2["WhiteConcretePowder"] = "minecraft:white_concrete_powder";
  MinecraftItemTypes2["WhiteDye"] = "minecraft:white_dye";
  MinecraftItemTypes2["WhiteGlazedTerracotta"] = "minecraft:white_glazed_terracotta";
  MinecraftItemTypes2["WhiteHarness"] = "minecraft:white_harness";
  MinecraftItemTypes2["WhiteShulkerBox"] = "minecraft:white_shulker_box";
  MinecraftItemTypes2["WhiteStainedGlass"] = "minecraft:white_stained_glass";
  MinecraftItemTypes2["WhiteStainedGlassPane"] = "minecraft:white_stained_glass_pane";
  MinecraftItemTypes2["WhiteTerracotta"] = "minecraft:white_terracotta";
  MinecraftItemTypes2["WhiteTulip"] = "minecraft:white_tulip";
  MinecraftItemTypes2["WhiteWool"] = "minecraft:white_wool";
  MinecraftItemTypes2["WildArmorTrimSmithingTemplate"] = "minecraft:wild_armor_trim_smithing_template";
  MinecraftItemTypes2["Wildflowers"] = "minecraft:wildflowers";
  MinecraftItemTypes2["WindCharge"] = "minecraft:wind_charge";
  MinecraftItemTypes2["WitchSpawnEgg"] = "minecraft:witch_spawn_egg";
  MinecraftItemTypes2["WitherRose"] = "minecraft:wither_rose";
  MinecraftItemTypes2["WitherSkeletonSkull"] = "minecraft:wither_skeleton_skull";
  MinecraftItemTypes2["WitherSkeletonSpawnEgg"] = "minecraft:wither_skeleton_spawn_egg";
  MinecraftItemTypes2["WitherSpawnEgg"] = "minecraft:wither_spawn_egg";
  MinecraftItemTypes2["WolfArmor"] = "minecraft:wolf_armor";
  MinecraftItemTypes2["WolfSpawnEgg"] = "minecraft:wolf_spawn_egg";
  MinecraftItemTypes2["WoodenAxe"] = "minecraft:wooden_axe";
  MinecraftItemTypes2["WoodenButton"] = "minecraft:wooden_button";
  MinecraftItemTypes2["WoodenDoor"] = "minecraft:wooden_door";
  MinecraftItemTypes2["WoodenHoe"] = "minecraft:wooden_hoe";
  MinecraftItemTypes2["WoodenPickaxe"] = "minecraft:wooden_pickaxe";
  MinecraftItemTypes2["WoodenPressurePlate"] = "minecraft:wooden_pressure_plate";
  MinecraftItemTypes2["WoodenShovel"] = "minecraft:wooden_shovel";
  MinecraftItemTypes2["WoodenSword"] = "minecraft:wooden_sword";
  MinecraftItemTypes2["WritableBook"] = "minecraft:writable_book";
  MinecraftItemTypes2["YellowBundle"] = "minecraft:yellow_bundle";
  MinecraftItemTypes2["YellowCandle"] = "minecraft:yellow_candle";
  MinecraftItemTypes2["YellowCarpet"] = "minecraft:yellow_carpet";
  MinecraftItemTypes2["YellowConcrete"] = "minecraft:yellow_concrete";
  MinecraftItemTypes2["YellowConcretePowder"] = "minecraft:yellow_concrete_powder";
  MinecraftItemTypes2["YellowDye"] = "minecraft:yellow_dye";
  MinecraftItemTypes2["YellowGlazedTerracotta"] = "minecraft:yellow_glazed_terracotta";
  MinecraftItemTypes2["YellowHarness"] = "minecraft:yellow_harness";
  MinecraftItemTypes2["YellowShulkerBox"] = "minecraft:yellow_shulker_box";
  MinecraftItemTypes2["YellowStainedGlass"] = "minecraft:yellow_stained_glass";
  MinecraftItemTypes2["YellowStainedGlassPane"] = "minecraft:yellow_stained_glass_pane";
  MinecraftItemTypes2["YellowTerracotta"] = "minecraft:yellow_terracotta";
  MinecraftItemTypes2["YellowWool"] = "minecraft:yellow_wool";
  MinecraftItemTypes2["ZoglinSpawnEgg"] = "minecraft:zoglin_spawn_egg";
  MinecraftItemTypes2["ZombieHead"] = "minecraft:zombie_head";
  MinecraftItemTypes2["ZombieHorseSpawnEgg"] = "minecraft:zombie_horse_spawn_egg";
  MinecraftItemTypes2["ZombiePigmanSpawnEgg"] = "minecraft:zombie_pigman_spawn_egg";
  MinecraftItemTypes2["ZombieSpawnEgg"] = "minecraft:zombie_spawn_egg";
  MinecraftItemTypes2["ZombieVillagerSpawnEgg"] = "minecraft:zombie_villager_spawn_egg";
  return MinecraftItemTypes2;
})(MinecraftItemTypes || {});
var MinecraftPotionEffectTypes = ((MinecraftPotionEffectTypes2) => {
  MinecraftPotionEffectTypes2["FireResistance"] = "FireResistance";
  MinecraftPotionEffectTypes2["Harming"] = "Harming";
  MinecraftPotionEffectTypes2["Healing"] = "Healing";
  MinecraftPotionEffectTypes2["Infested"] = "Infested";
  MinecraftPotionEffectTypes2["Invisibility"] = "Invisibility";
  MinecraftPotionEffectTypes2["Leaping"] = "Leaping";
  MinecraftPotionEffectTypes2["NightVision"] = "NightVision";
  MinecraftPotionEffectTypes2["None"] = "None";
  MinecraftPotionEffectTypes2["Oozing"] = "Oozing";
  MinecraftPotionEffectTypes2["Poison"] = "Poison";
  MinecraftPotionEffectTypes2["SlowFalling"] = "SlowFalling";
  MinecraftPotionEffectTypes2["Slowing"] = "Slowing";
  MinecraftPotionEffectTypes2["Strength"] = "Strength";
  MinecraftPotionEffectTypes2["Swiftness"] = "Swiftness";
  MinecraftPotionEffectTypes2["TurtleMaster"] = "TurtleMaster";
  MinecraftPotionEffectTypes2["WaterBreath"] = "WaterBreath";
  MinecraftPotionEffectTypes2["Weakness"] = "Weakness";
  MinecraftPotionEffectTypes2["Weaving"] = "Weaving";
  MinecraftPotionEffectTypes2["WindCharged"] = "WindCharged";
  MinecraftPotionEffectTypes2["Wither"] = "Wither";
  return MinecraftPotionEffectTypes2;
})(MinecraftPotionEffectTypes || {});
var MinecraftPotionLiquidTypes = ((MinecraftPotionLiquidTypes2) => {
  MinecraftPotionLiquidTypes2["Lingering"] = "Lingering";
  MinecraftPotionLiquidTypes2["Regular"] = "Regular";
  MinecraftPotionLiquidTypes2["Splash"] = "Splash";
  return MinecraftPotionLiquidTypes2;
})(MinecraftPotionLiquidTypes || {});
var MinecraftPotionModifierTypes = ((MinecraftPotionModifierTypes2) => {
  MinecraftPotionModifierTypes2["Long"] = "Long";
  MinecraftPotionModifierTypes2["Normal"] = "Normal";
  MinecraftPotionModifierTypes2["Strong"] = "Strong";
  return MinecraftPotionModifierTypes2;
})(MinecraftPotionModifierTypes || {});

// data/gametests/src/items/bubble_blower/utils/bubbleSoundProperties.ts
function bubbleSoundProperties(pitch) {
  const _pitch = pitch + Math.random() * 0.2 - 0.1;
  const _volume = 1;
  return { volume: _volume, pitch: _pitch };
}

// data/gametests/src/items/bubble_blower/utils/clamp.ts
function clamp(value, min, max) {
  return Math.min(Math.max(value, min), max);
}

// data/gametests/src/items/bubble_blower/BubbleBlowerManager.ts
var bubbleBlowerCooldown = /* @__PURE__ */ new Map();
var _bubbleSoundLastTick = {};
var _blowSoundLastTick = /* @__PURE__ */ new Map();
var BubbleBlowerManager = class _BubbleBlowerManager {
  constructor() {
    // Persist animation state for riders across ticks
    this.playerRidingAnimationState = /* @__PURE__ */ new Map();
    this.BUBBLE_BLOWER_ITEM_ID = "mco_nom:bubble_blower";
    this.playerUsingStates = /* @__PURE__ */ new Map();
    // Track player usage states
    this.playerAnimationStates = /* @__PURE__ */ new Map();
    // Track current animation state per player
    this.playerChargeStates = /* @__PURE__ */ new Map();
    // Track charging states
    // Bubble configuration
    this.MAX_CHARGE_TIME = 20;
    // 1 second = 20 ticks for large bubble
    this.BUBBLE_ENTITY_ID = "mco_nom:bubble";
    this.BUBBLE_CONFIGS = {
      SMALL: {
        spawnEvent: "mco_nom:small_bubble",
        minCharge: 0,
        maxCharge: 10,
        power: 3,
        soundPitch: 1.5
      },
      LARGE: {
        spawnEvent: "mco_nom:large_bubble",
        minCharge: 11,
        maxCharge: 20,
        power: 1,
        soundPitch: 1
      }
    };
    // Animation IDs and durations (in ticks)
    this.ANIMATIONS = {
      BLANK: { id: "animation.mco_nom.player.init", duration: 2, looping: false },
      // 0.1 seconds = 2 ticks
      IDLE: { id: "animation.mco_nom.player.idle", duration: 72, looping: true },
      // 3.6 seconds = 72 ticks
      USE: { id: "animation.mco_nom.player.use", duration: 41, looping: false },
      // 2.04 seconds = ~41 ticks
      FLOAT: { id: "animation.mco_nom.player.bubble_float", duration: 288, looping: true }
      // 14.4 seconds = 288 ticks
    };
    this.actionBarManager = ActionBarManager.getInstance();
    this.setupEventListeners();
    this.startAnimationSystem();
    this.startChargeSystem();
    this.setupEntityCapture();
  }
  static getInstance() {
    if (!_BubbleBlowerManager.instance) {
      _BubbleBlowerManager.instance = new _BubbleBlowerManager();
    }
    return _BubbleBlowerManager.instance;
  }
  // #endregion Singleton instance
  // #region Setups
  setupEventListeners() {
    world13.afterEvents.itemUse.subscribe((event) => {
      const { source, itemStack } = event;
      if (itemStack.typeId === this.BUBBLE_BLOWER_ITEM_ID && source instanceof Player10) {
        const cooldownComponent = itemStack.getComponent("cooldown");
        if (cooldownComponent && cooldownComponent.getCooldownTicksRemaining(source) <= 0) {
          bubbleBlowerCooldown.delete(source.id);
        }
        if (bubbleBlowerCooldown.has(source.id))
          return;
        this.startCharging(source);
      }
    });
    world13.afterEvents.itemReleaseUse.subscribe((event) => {
      const { source, itemStack, useDuration } = event;
      if (itemStack && itemStack.typeId === this.BUBBLE_BLOWER_ITEM_ID && source instanceof Player10) {
        this.releaseCharge(source, useDuration);
      }
    });
    world13.beforeEvents.entityRemove.subscribe((event) => {
      const dieEntity = event.removedEntity;
      if (dieEntity.typeId !== this.BUBBLE_ENTITY_ID)
        return;
      const bubble = dieEntity;
      bubble.dimension.getPlayers({
        location: bubble.location,
        maxDistance: 3
      }).forEach((player) => {
        system14.runTimeout(() => {
          player.playAnimation(this.ANIMATIONS.BLANK.id, {
            controller: "controller.mco_nom.player.bubble_float",
            nextState: this.ANIMATIONS.BLANK.id,
            blendOutTime: 0.1
          });
          this.playerRidingAnimationState.set(player.id, {
            animation: this.ANIMATIONS.BLANK.id,
            startTime: system14.currentTick
          });
        }, 1);
      });
    });
  }
  setupEntityCapture() {
    const bubbleLastRider = /* @__PURE__ */ new Map();
    system14.runInterval(() => {
      try {
        const bubbles = world13.getDimension("overworld").getEntities({
          type: "mco_nom:bubble"
        });
        for (const bubble of bubbles) {
          if (!bubble)
            continue;
          try {
            const type = bubble.getComponent(EntityComponentTypes.TypeFamily);
            const rideable = bubble.getComponent(EntityComponentTypes.Rideable);
            const hasRiderProp = bubble.getProperty("mco_nom:has_rider");
            const hasRiderOnceProp = bubble.getProperty("mco_nom:has_rider_once");
            let hadRider = hasRiderProp === true;
            let hadRiderOnce = hasRiderOnceProp === true;
            const riders = rideable ? rideable.getRiders() : [];
            const hasRiderNow = riders.length > 0;
            if (hasRiderNow && riders[0] instanceof Entity2) {
              bubbleLastRider.set(bubble.id, riders[0]);
            }
            bubble.setProperty("mco_nom:has_rider", hasRiderNow);
            if (hasRiderNow && !hadRiderOnce) {
              bubble.setProperty("mco_nom:has_rider_once", true);
            }
            let isDragon = false;
            if (riders[0]) {
              const variantComponent = riders[0].getComponent(EntityComponentTypes.Variant);
              const typeFamily = riders[0].getComponent(EntityComponentTypes.TypeFamily);
              if (typeFamily?.hasTypeFamily("om_nom") && variantComponent?.value === 8) {
                isDragon = true;
              }
            }
            bubble.triggerEvent(isDragon ? "mco_nom:dragon_inside_bubble" : "mco_nom:dragon_not_inside_bubble");
            if (hadRiderOnce && hadRider && !hasRiderNow) {
              try {
                const lastRider = bubbleLastRider.get(bubble.id);
                if (lastRider) {
                  try {
                    lastRider.playAnimation(this.ANIMATIONS.BLANK.id, {
                      controller: "controller.mco_nom.player.bubble_float",
                      nextState: this.ANIMATIONS.BLANK.id,
                      blendOutTime: 0.1
                    });
                    if (!bubble.getProperty("mco_nom:has_touched_ground")) {
                      lastRider.addEffect("minecraft:slow_falling", 240, {
                        amplifier: 0,
                        showParticles: false
                      });
                      if (lastRider instanceof Player10) {
                        let randPitch = Math.random() * (1.1 - 0.9) + 0.9;
                        lastRider.playSound(
                          "mco_nom.bubble_blower.smooth_falling" /* McoNomBubbleBlowerSmoothFalling */,
                          { volume: 0.5, pitch: randPitch }
                        );
                      }
                    }
                  } catch (e) {
                    "Error applying slow falling to last rider:", e;
                  }
                }
                bubble.removeEffect("minecraft:levitation");
                system14.runTimeout(() => {
                  try {
                    bubble.resetProperty("mco_nom:has_rider");
                    bubble.resetProperty("mco_nom:has_rider_once");
                    bubbleLastRider.delete(bubble.id);
                  } catch (error2) {
                  }
                }, 80);
              } catch (error2) {
              }
            }
            if (hasRiderNow && riders[0] instanceof Player10) {
              const riderId = riders[0].id;
              const animState = this.playerRidingAnimationState.get(riderId);
              const isFloatPlaying = animState && animState.animation === this.ANIMATIONS.FLOAT.id && (this.ANIMATIONS.FLOAT.looping || system14.currentTick - animState.startTime < this.ANIMATIONS.FLOAT.duration);
              if (!isFloatPlaying) {
                riders[0].playAnimation(this.ANIMATIONS.FLOAT.id, {
                  controller: "controller.mco_nom.player.bubble_float",
                  nextState: this.ANIMATIONS.FLOAT.id,
                  blendOutTime: 0.1
                });
                this.playerRidingAnimationState.set(riderId, {
                  animation: this.ANIMATIONS.FLOAT.id,
                  startTime: system14.currentTick
                });
              }
              let currTick = system14.currentTick;
              if (currTick - (_bubbleSoundLastTick[riders[0].id] ?? 0) >= 4) {
                _bubbleSoundLastTick[riders[0].id] = currTick;
                let pitchCorrection = 0;
                if (!bubble.getEffect(MinecraftEffectTypes.Levitation)) {
                  pitchCorrection = -0.3;
                }
                const randPitch = Math.random() * (1.2 - 0.8) + 0.8;
                riders[0].playSound("mco_nom.bubble_blower.bubble_inside" /* McoNomBubbleBlowerBubbleInside */, { volume: 0.2, pitch: randPitch + pitchCorrection });
              }
            } else if (riders[0] instanceof Player10) {
              this.playerRidingAnimationState.delete(riders[0].id);
            }
            if (type && type.hasTypeFamily("small_bubble") && rideable) {
              const nearbyEntities = bubble.dimension.getEntities({
                location: bubble.location,
                maxDistance: 1.75,
                excludeTypes: ["mco_nom:bubble", "minecraft:player"]
              });
              for (const entity of nearbyEntities) {
                if (this.isSmallEntity(entity) && !this.hasRider(rideable)) {
                  try {
                    rideable.addRider(entity);
                    bubbleLastRider.set(bubble.id, entity);
                    break;
                  } catch (error2) {
                  }
                }
              }
            }
            if (type && type.hasTypeFamily("large_bubble") && rideable && !hadRiderOnce) {
              const nearbyEntities = bubble.dimension.getEntities({
                location: bubble.location,
                maxDistance: 1.75,
                excludeTypes: ["mco_nom:bubble"],
                families: ["player"]
              });
              for (const entity of nearbyEntities) {
                if (!this.hasRider(rideable)) {
                  try {
                    rideable.addRider(entity);
                    break;
                  } catch (error2) {
                  }
                }
              }
            }
          } catch (error2) {
            continue;
          }
        }
      } catch (error2) {
        "Error in entity capture system:", error2;
      }
    }, 5);
  }
  // #end region Setups
  // #region Main Logic
  startCharging(player) {
    this.playerUsingStates.set(player.id, true);
    this.playerChargeStates.set(player.id, {
      chargeLevel: 0,
      isCharging: true
    });
  }
  releaseCharge(player, useDuration) {
    this.playerUsingStates.set(player.id, false);
    const chargeState = this.playerChargeStates.get(player.id);
    if (chargeState && chargeState.isCharging) {
      const chargeTime = Math.min(chargeState.chargeLevel, this.MAX_CHARGE_TIME);
      system14.runTimeout(() => {
        this.shootBubble(player, chargeTime);
      }, 8);
      this.actionBarManager.clearBubbleMessages(player);
    }
    this.playerChargeStates.set(player.id, {
      chargeLevel: 0,
      isCharging: false
    });
  }
  shootBubble(player, chargeTime) {
    let bubbleConfig;
    let selectedType = "";
    const sortedConfigs = Object.entries(this.BUBBLE_CONFIGS).sort(
      ([, a], [, b]) => b.minCharge - a.minCharge
    );
    for (const [type, config] of sortedConfigs) {
      if (chargeTime >= config.minCharge && chargeTime <= config.maxCharge) {
        bubbleConfig = config;
        selectedType = type;
        break;
      }
    }
    if (!bubbleConfig) {
      bubbleConfig = this.BUBBLE_CONFIGS.SMALL;
      selectedType = "SMALL";
    }
    try {
      const bubbleLocation = {
        x: player.getHeadLocation().x + player.getViewDirection().x * 2.5,
        y: player.getHeadLocation().y,
        z: player.getHeadLocation().z + player.getViewDirection().z * 2.5
      };
      player.dimension.playSound(
        "mco_nom.bubble_blower.bubble_appear" /* McoNomBubbleBlowerBubbleAppear */,
        bubbleLocation,
        bubbleSoundProperties(bubbleConfig.soundPitch)
      );
      player.dimension.spawnEntity(
        this.BUBBLE_ENTITY_ID,
        bubbleLocation,
        {
          spawnEvent: bubbleConfig.spawnEvent
        }
      );
      const molang = new MolangVariableMap();
      const particleLoc = {
        x: player.getHeadLocation().x,
        y: player.getHeadLocation().y + 0.3,
        z: player.getHeadLocation().z
      };
      molang.setSpeedAndDirection("bubble", 1, {
        x: player.getViewDirection().x * -1,
        y: player.getViewDirection().y * -1,
        z: player.getViewDirection().z * -1
      });
      try {
        player.spawnParticle("mco_nom:bubble_blow", particleLoc, molang);
        player.spawnParticle("mco_nom:bubble_blow2", particleLoc, molang);
      } catch {
      }
      const chargePercentage = Math.floor(chargeTime / this.MAX_CHARGE_TIME * 100);
      this.actionBarManager.showBubbleShot(player, selectedType, chargePercentage);
      try {
        const equippable = player.getComponent(
          "equippable"
        );
        if (equippable) {
          const mainhandItem = equippable.getEquipment(EquipmentSlot3.Mainhand);
          if (mainhandItem && mainhandItem.typeId === this.BUBBLE_BLOWER_ITEM_ID) {
            const cooldownComponent = mainhandItem.getComponent("cooldown");
            if (cooldownComponent) {
              cooldownComponent.startCooldown(player);
              bubbleBlowerCooldown.set(player.id, true);
              system14.runTimeout(() => {
                bubbleBlowerCooldown.delete(player.id);
              }, cooldownComponent.getCooldownTicksRemaining(player) || 100);
            }
          }
        }
      } catch (error2) {
        "Error applying cooldown:", error2;
      }
    } catch (error2) {
      "Error shooting bubble:", error2;
    }
  }
  startAnimationSystem() {
    this.animationInterval = system14.runInterval(() => {
      this.updatePlayerAnimations();
    });
  }
  startChargeSystem() {
    system14.runInterval(() => {
      this.updateChargeStates();
    });
  }
  updateChargeStates() {
    for (const [playerId, chargeState] of this.playerChargeStates.entries()) {
      if (chargeState.isCharging && chargeState.chargeLevel <= this.MAX_CHARGE_TIME) {
        chargeState.chargeLevel++;
        this.playerChargeStates.set(playerId, chargeState);
        const player = [...world13.getAllPlayers()].find((p) => p.id === playerId);
        if (player) {
          this.showChargingProgress(player, chargeState.chargeLevel);
          let currTick = system14.currentTick;
          if (currTick - (_blowSoundLastTick.get(playerId) ?? 0) >= 2) {
            _blowSoundLastTick.set(playerId, currTick);
            let increment = chargeState.chargeLevel / 25;
            player.dimension.playSound(
              "mco_nom.bubble_blower.blow" /* McoNomBubbleBlowerBlow */,
              player.location,
              {
                volume: 0.3 + increment,
                pitch: clamp(0.4 + increment, 0.3, 1.8)
              }
            );
          }
        }
      }
    }
  }
  getBubbleTypeForCharge(chargeLevel) {
    if (chargeLevel > this.BUBBLE_CONFIGS.LARGE.minCharge) {
      return "LARGE";
    }
    if (chargeLevel < this.BUBBLE_CONFIGS.SMALL.maxCharge && chargeLevel > this.BUBBLE_CONFIGS.SMALL.minCharge) {
      return "SMALL";
    }
    return "LARGE";
  }
  // #endregion Main Logic
  // region UI/UX
  showChargingProgress(player, chargeLevel) {
    const bubbleType = this.getBubbleTypeForCharge(chargeLevel);
    this.actionBarManager.showBubbleCharging(
      player,
      chargeLevel,
      this.MAX_CHARGE_TIME,
      bubbleType
    );
  }
  updatePlayerAnimations() {
    const players = world13.getPlayers();
    for (const player of players) {
      try {
        const hasBubbleBlower = this.hasBubbleBlower(player);
        const isUsing = this.isPlayerUsingItem(player);
        const currentTime = system14.currentTick;
        let targetAnimation;
        if (hasBubbleBlower) {
          targetAnimation = isUsing ? "USE" : "IDLE";
        } else {
          targetAnimation = "BLANK";
        }
        const currentState = this.playerAnimationStates.get(player.id);
        let shouldChangeAnimation = false;
        if (!currentState) {
          shouldChangeAnimation = true;
        } else if (currentState.animation === "USE") {
          const useAnim = this.ANIMATIONS.USE;
          if (currentTime - currentState.startTime >= useAnim.duration) {
            shouldChangeAnimation = true;
          }
        } else if (currentState.animation !== targetAnimation) {
          shouldChangeAnimation = true;
        } else if (!this.ANIMATIONS[currentState.animation].looping && currentTime - currentState.startTime >= this.ANIMATIONS[currentState.animation].duration) {
          shouldChangeAnimation = true;
        }
        if (shouldChangeAnimation) {
          try {
            const animConfig = this.ANIMATIONS[targetAnimation];
            const animationOptions = {
              controller: "controller.animation.mco_nom.bubble_blower",
              nextState: animConfig.id,
              blendOutTime: 0.1
            };
            player.playAnimation(animConfig.id, animationOptions);
            this.playerAnimationStates.set(player.id, {
              animation: targetAnimation,
              startTime: currentTime
            });
          } catch (animError) {
          }
        }
      } catch (error2) {
        continue;
      }
    }
  }
  // #endregion UI/UX
  // #region filters
  hasBubbleBlower(player) {
    try {
      const equippable = player.getComponent("equippable");
      if (!equippable)
        return false;
      const mainhandItem = equippable.getEquipment(EquipmentSlot3.Mainhand);
      return mainhandItem?.typeId === this.BUBBLE_BLOWER_ITEM_ID;
    } catch (error2) {
      return false;
    }
  }
  isPlayerUsingItem(player) {
    try {
      return this.playerUsingStates.get(player.id) || false;
    } catch (error2) {
      return false;
    }
  }
  isSmallEntity(entity) {
    try {
      const smallEntityTypes = [
        "minecraft:chicken",
        "minecraft:item",
        "minecraft:xp_orb",
        "mco_nom:om_nom"
      ];
      if (smallEntityTypes.includes(entity.typeId)) {
        return true;
      }
      try {
        const isBaby = entity.getComponent("minecraft:is_baby");
        if (isBaby) {
          return true;
        }
      } catch (error2) {
      }
      const smallMobPatterns = ["chicken", "rabbit", "silverfish", "endermite", "bee", "axolotl"];
      for (const pattern of smallMobPatterns) {
        if (entity.typeId.toLowerCase().includes(pattern)) {
          return true;
        }
      }
      return false;
    } catch (error2) {
      return false;
    }
  }
  hasRider(rideable) {
    try {
      return rideable.getRiders().length > 0;
    } catch (error2) {
      return false;
    }
  }
  // #endregion filters
  cleanup() {
    if (this.animationInterval !== void 0) {
      system14.clearRun(this.animationInterval);
      this.animationInterval = void 0;
    }
  }
};
var bubbleBlowerManager = BubbleBlowerManager.getInstance();

// data/gametests/src/items/minigame/minigame_menu.ts
import { world as world21, Player as Player17 } from "@minecraft/server";
import { ActionFormData as ActionFormData2, ModalFormData as ModalFormData2 } from "@minecraft/server-ui";

// data/gametests/src/systems/Minigame/Minigame.ts
import {
  world as world15,
  Player as Player12,
  InputPermissionCategory as InputPermissionCategory2,
  ItemStack as ItemStack6,
  system as system16,
  BlockVolume,
  TicksPerSecond as TicksPerSecond2
} from "@minecraft/server";

// data/gametests/src/systems/InventoryManager.ts
import {
  EntityComponentTypes as EntityComponentTypes2,
  EquipmentSlot as EquipmentSlot4,
  Player as Player11,
  system as system15
} from "@minecraft/server";
var log4 = Logger.getLogger("InventoryManager");
var InventoryManager = class {
  /**
   * Creates a new InventoryManager instance.
   *
   * @param location - The world coordinates where buffer entities will be created
   * @param id - The manager id, to be reused by reloading parties
   */
  constructor(location, id) {
    this.location = location;
    this.id = id ?? `${Date.now()}:${Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}`;
  }
  /**
   * Removes buffers from player.
   *
   * @param dimension - The dimension to clean up buffer entities from
   */
  playerCleanUp(player, dimension) {
    const entities = this.getAllBufferEntities(player.dimension).filter((e) => e.getDynamicProperty("mco_nom:buffer_owner") === player.id);
    entities.forEach((e) => {
      e.remove();
    });
  }
  /**
   * Transfers all items and equipment from a player's inventory to buffer entities.
   * This effectively "stores" the player's inventory in temporary entities.
   *
   * @param player - The player whose inventory will be transferred to buffers
   * @throws Error if the player lacks required inventory or equippable components
   */
  transferFromPlayer(player) {
    const buffer_container = this.retrieveBufferContainers(player);
    const player_container = player.getComponent(EntityComponentTypes2.Inventory)?.container;
    if (player_container === void 0) {
      error(`Player ${player.name} does not have an inventory component.`);
      throw new Error(`Player ${player.name} does not have an inventory component.`);
    }
    for (let i = 0; i < player_container.size; i++) {
      const item = player_container.getItem(i);
      if (item && !this.isForbiddenItem(item.typeId)) {
        player_container.moveItem(i, i, buffer_container.inventory);
      } else if (item) {
        player_container.setItem(i, void 0);
      }
    }
    const equippable = player.getComponent(EntityComponentTypes2.Equippable);
    if (equippable === void 0) {
      error(`Player ${player.name} does not have an equippable component.`);
      throw new Error(`Player ${player.name} does not have an equippable component.`);
    }
    buffer_container.equipment.setItem(0, equippable.getEquipment(EquipmentSlot4.Feet));
    buffer_container.equipment.setItem(1, equippable.getEquipment(EquipmentSlot4.Legs));
    buffer_container.equipment.setItem(2, equippable.getEquipment(EquipmentSlot4.Chest));
    buffer_container.equipment.setItem(3, equippable.getEquipment(EquipmentSlot4.Head));
    buffer_container.equipment.setItem(4, equippable.getEquipment(EquipmentSlot4.Offhand));
    equippable.setEquipment(EquipmentSlot4.Feet);
    equippable.setEquipment(EquipmentSlot4.Legs);
    equippable.setEquipment(EquipmentSlot4.Chest);
    equippable.setEquipment(EquipmentSlot4.Head);
    equippable.setEquipment(EquipmentSlot4.Offhand);
  }
  /**
   * Transfers all items and equipment from buffer entities back to a player's inventory.
   * This "restores" a previously stored inventory to the player.
   *
   * @param player - The player who will receive the buffered inventory
   * @throws Error if the player lacks required inventory or equippable components
   */
  transferToPlayer(player) {
    const buffer_container = this.retrieveBufferContainers(player);
    const player_container = player.getComponent(EntityComponentTypes2.Inventory)?.container;
    if (player_container === void 0) {
      error(`Player ${player.name} does not have an inventory component.`);
      throw new Error(`Player ${player.name} does not have an inventory component.`);
    }
    for (let i = 0; i < player_container.size; i++) {
      buffer_container.inventory.moveItem(i, i, player_container);
    }
    const equippable = player.getComponent(EntityComponentTypes2.Equippable);
    if (equippable === void 0) {
      error(`Player ${player.name} does not have an equippable component.`);
      throw new Error(`Player ${player.name} does not have an equippable component.`);
    }
    equippable.setEquipment(EquipmentSlot4.Feet, buffer_container.equipment.getItem(0));
    equippable.setEquipment(EquipmentSlot4.Legs, buffer_container.equipment.getItem(1));
    equippable.setEquipment(EquipmentSlot4.Chest, buffer_container.equipment.getItem(2));
    equippable.setEquipment(EquipmentSlot4.Head, buffer_container.equipment.getItem(3));
    equippable.setEquipment(EquipmentSlot4.Offhand, buffer_container.equipment.getItem(4));
    buffer_container.equipment.setItem(0);
    buffer_container.equipment.setItem(1);
    buffer_container.equipment.setItem(2);
    buffer_container.equipment.setItem(3);
    buffer_container.equipment.setItem(4);
  }
  /**
   * Making sure that the item is not forbidden.
   * List of forbidden items: mco_nom:minigame_menu.
   *
   * @param itemId - item.typeId
   */
  isForbiddenItem(itemId) {
    return itemId == "mco_nom:minigame_menu";
  }
  /**
   * Retrieves all buffer entities associated with this InventoryManager instance
   * from the specified dimension.
   *
   * @param dimension - The dimension to search for buffer entities
   * @returns Array of all buffer entities at this manager's location
   */
  getAllBufferEntities(dimension) {
    return dimension.getEntities({
      type: "mco_nom:inventory_buffer" /* InventoryBuffer */,
      location: this.location,
      maxDistance: 5
    });
  }
  /**
   * Retrieves the specific buffer entities (inventory and equipment) for a given player.
   * These entities are filtered by player ID and this manager's unique ID.
   *
   * @param player - The player whose buffer entities to retrieve
   * @returns Object containing the inventory and equipment buffer entities
   * @throws Error if required buffer entities are not found
   */
  getBufferEntities(player) {
    const entities = this.getAllBufferEntities(player.dimension).filter((e) => e.getDynamicProperty("mco_nom:buffer_owner") === player.id).filter((e) => e.getDynamicProperty("mco_nom:buffer_inv_id") === this.id);
    const inventory = entities.find(
      (e) => e.getDynamicProperty("mco_nom:buffer_type") === "inventory"
    );
    const equipment = entities.find(
      (e) => e.getDynamicProperty("mco_nom:buffer_type") === "equipment"
    );
    if (inventory === void 0 || equipment === void 0) {
      throw new Error(`Player ${player.name} does not have a valid buffer entity.`);
    }
    return { inventory, equipment };
  }
  /**
   * Creates new buffer entities for a player's inventory and equipment storage.
   * Sets up dynamic properties to track ownership and purpose of each entity.
   *
   * @param player - The player for whom to create buffer entities
   * @returns Object containing the newly created inventory and equipment buffer entities
   */
  createBufferEntities(player) {
    const existingEntities = player.dimension.getEntities({
      type: "mco_nom:inventory_buffer" /* InventoryBuffer */,
      location: this.location,
      maxDistance: 0.1
    }).filter(
      (e) => e.getDynamicProperty("mco_nom:buffer_owner") === player.id && e.getDynamicProperty("mco_nom:buffer_inv_id") === this.id
    );
    existingEntities.forEach((e) => e.remove());
    const inventory = player.dimension.spawnEntity("mco_nom:inventory_buffer" /* InventoryBuffer */, this.location);
    inventory.setDynamicProperty("mco_nom:buffer_owner", player.id);
    inventory.setDynamicProperty("mco_nom:buffer_inv_id", this.id);
    inventory.setDynamicProperty("mco_nom:buffer_type", "inventory");
    const equipment = player.dimension.spawnEntity("mco_nom:inventory_buffer" /* InventoryBuffer */, this.location);
    equipment.setDynamicProperty("mco_nom:buffer_owner", player.id);
    equipment.setDynamicProperty("mco_nom:buffer_inv_id", this.id);
    equipment.setDynamicProperty("mco_nom:buffer_type", "equipment");
    player.setDynamicProperty("mco_nom:has_buffer_container", true);
    player.setDynamicProperty("mco_nom:buffer_inv_id", this.id);
    return { inventory, equipment };
  }
  /**
   * Retrieves or creates buffer containers for a player's inventory management.
   * This method handles the logic of determining whether to create new buffers
   * or retrieve existing ones based on the player's current state.
   *
   * @param player - The player for whom to retrieve/create buffer containers
   * @returns Object containing the inventory and equipment container components
   * @throws Error if buffer entities lack required inventory components
   */
  retrieveBufferContainers(player) {
    let has_buffer = player.getDynamicProperty("mco_nom:has_buffer_container");
    if (typeof has_buffer !== "boolean" && typeof has_buffer !== "undefined") {
      warn(
        `Player ${player.name} has an invalid buffer container property: ${has_buffer}, resetting to undefined.`
      );
      player.setDynamicProperty("mco_nom:has_buffer_container", void 0);
      has_buffer = void 0;
    }
    let buffer_entities = void 0;
    if (has_buffer === true) {
      try {
        buffer_entities = this.getBufferEntities(player);
        const inv = buffer_entities.inventory.getComponent(
          EntityComponentTypes2.Inventory
        )?.container;
        const eq = buffer_entities.equipment.getComponent(
          EntityComponentTypes2.Inventory
        )?.container;
        if (!inv || !eq)
          throw new Error("Missing inventory component");
      } catch (e) {
        buffer_entities = this.createBufferEntities(player);
      }
    } else {
      buffer_entities = this.createBufferEntities(player);
    }
    if (buffer_entities === void 0) {
      throw Error(
        `Failed to retrieve or create buffer entities for player ${player.name}`
      );
    }
    const buffer_inventory = buffer_entities.inventory.getComponent(
      EntityComponentTypes2.Inventory
    )?.container;
    const buffer_equipment = buffer_entities.equipment.getComponent(
      EntityComponentTypes2.Inventory
    )?.container;
    if (buffer_inventory === void 0 || buffer_equipment === void 0) {
      throw new Error(
        `Player ${player.name} has buffer container entities, but they do not have inventory components.`
      );
    }
    return { inventory: buffer_inventory, equipment: buffer_equipment };
  }
};
DEBUG: {
  let inventoryManager = void 0;
  system15.afterEvents.scriptEventReceive.subscribe(({ sourceEntity, id }) => {
    if (sourceEntity === void 0 || sourceEntity instanceof Player11 === false)
      return;
    const player = sourceEntity;
    if (inventoryManager === void 0) {
      inventoryManager = new InventoryManager(player.location);
    }
    if (id === "nom:transfer_inv_from_player")
      inventoryManager.transferFromPlayer(player);
    if (id === "nom:transfer_inv_to_player")
      inventoryManager.transferToPlayer(player);
  });
}

// data/gametests/src/systems/Minigame/MinigameStructures.ts
var MinigameTypes = {
  ParkourMinigame: "ParkourMinigame",
  CauldronMinigame: "CauldronMinigame",
  SpiderDefenseMinigame: "SpiderDefenseMinigame"
};
var LevelTitles = {
  1: "Sweet & Simple",
  2: "Tasty Challenge",
  3: "Hard Candy Mode",
  4: "Experimental Mode"
};
var ParkourStructures = {
  1: "mco_nom:parkour_lv1",
  2: "mco_nom:parkour_lv2",
  3: "mco_nom:parkour_lv3",
  4: "mco_nom:parkour_lv4"
};
var CauldronStructures = {
  1: "mco_nom:candy_cauldron_lv1",
  2: "mco_nom:candy_cauldron_lv2",
  3: "mco_nom:candy_cauldron_lv3",
  4: "mco_nom:candy_cauldron_lv4"
};
var SpiderDefenseStructures = {
  1: "",
  2: "",
  3: "",
  4: ""
};
var MinigameStructures = {
  [MinigameTypes.ParkourMinigame]: ParkourStructures,
  [MinigameTypes.CauldronMinigame]: CauldronStructures,
  [MinigameTypes.SpiderDefenseMinigame]: SpiderDefenseStructures
};
function getStructureName(minigame, level) {
  return MinigameStructures[minigame][level];
}
var add = (a, b) => ({ x: a.x + b.x, y: a.y + b.y, z: a.z + b.z });
var ParkourStageOffsets = [
  {
    startOffset: { x: 11, y: 3, z: 25 },
    finishOffset: { x: 10, y: 41, z: 2 },
    sizeOffset: { x: 26, y: 52, z: 35 }
  },
  {
    startOffset: { x: 11, y: 3, z: 25 },
    finishOffset: { x: 10, y: 41, z: 2 },
    sizeOffset: { x: 26, y: 52, z: 35 }
  },
  {
    startOffset: { x: 11, y: 3, z: 25 },
    finishOffset: { x: 10, y: 41, z: 2 },
    sizeOffset: { x: 26, y: 52, z: 32 }
  },
  {
    startOffset: { x: 10, y: 4, z: 26.5 },
    finishOffset: { x: 12, y: 41, z: 1 },
    sizeOffset: { x: 26, y: 52, z: 35 }
  }
];
var CauldronStageOffsets = [
  {
    "sizeOffset": { "x": 64, "y": 23, "z": 60 },
    "ingredientOffsetLocations": [
      { "x": 15.5, "y": 14, "z": 11.5 },
      { "x": 42.5, "y": 11, "z": 11.5 },
      { "x": 49.5, "y": 11, "z": 22.5 },
      { "x": 53.5, "y": 11, "z": 45.5 },
      { "x": 27.5, "y": 12, "z": 54.5 },
      { "x": 15.5, "y": 11, "z": 44.5 },
      { "x": 8.5, "y": 12, "z": 18.5 },
      { "x": 27.5, "y": 12, "z": 21.5 }
    ],
    "startOffset": { "x": 27, "y": 3, "z": 33 },
    "cauldronOffset": { "x": 27.5, "y": 2, "z": 41.5 }
  },
  {
    "sizeOffset": { "x": 64, "y": 23, "z": 60 },
    "ingredientOffsetLocations": [
      { "x": 15.5, "y": 14, "z": 11.5 },
      { "x": 42.5, "y": 11, "z": 11.5 },
      { "x": 49.5, "y": 11, "z": 22.5 },
      { "x": 53.5, "y": 11, "z": 45.5 },
      { "x": 27.5, "y": 12, "z": 54.5 },
      { "x": 15.5, "y": 11, "z": 44.5 },
      { "x": 8.5, "y": 12, "z": 18.5 },
      { "x": 27.5, "y": 12, "z": 21.5 }
    ],
    "startOffset": { "x": 27, "y": 3, "z": 33 },
    "cauldronOffset": { "x": 27.5, "y": 2, "z": 41.5 }
  },
  {
    "sizeOffset": { "x": 64, "y": 23, "z": 60 },
    "ingredientOffsetLocations": [
      { "x": 9.5, "y": 13, "z": 55.5 },
      { "x": 1.5, "y": 16, "z": 33.5 },
      { "x": 3.5, "y": 12, "z": 18.5 },
      { "x": 15.5, "y": 11, "z": 11.5 },
      { "x": 45.5, "y": 13, "z": 11.5 },
      { "x": 50.5, "y": 14, "z": 33.5 },
      { "x": 39.5, "y": 12, "z": 55.5 },
      { "x": 55.5, "y": 19, "z": 10.5 }
    ],
    "startOffset": { "x": 26.5, "y": 3, "z": 32.5 },
    "cauldronOffset": { "x": 26.5, "y": 3, "z": 40.5 }
  },
  {
    "sizeOffset": { "x": 64, "y": 23, "z": 60 },
    "ingredientOffsetLocations": [
      { "x": 15.5, "y": 14, "z": 11.5 },
      { "x": 42.5, "y": 11, "z": 11.5 },
      { "x": 49.5, "y": 11, "z": 22.5 },
      { "x": 53.5, "y": 11, "z": 45.5 },
      { "x": 27.5, "y": 12, "z": 54.5 },
      { "x": 15.5, "y": 11, "z": 44.5 },
      { "x": 8.5, "y": 12, "z": 18.5 },
      { "x": 27.5, "y": 12, "z": 21.5 }
    ],
    "startOffset": { "x": 27, "y": 3, "z": 33 },
    "cauldronOffset": { "x": 27.5, "y": 2, "z": 41.5 }
  }
];
function getParkourStageConfiguration(level, minigameLocation) {
  const idx = level - 1;
  const o = ParkourStageOffsets[idx];
  return {
    startPos: add(minigameLocation, o.startOffset),
    finishPos: add(minigameLocation, o.finishOffset),
    size: add(minigameLocation, o.sizeOffset)
  };
}
function getCauldronStageConfiguration(level, minigameLocation) {
  const idx = level - 1;
  const o = CauldronStageOffsets[idx];
  return {
    size: add(minigameLocation, o.sizeOffset),
    ingredientLocations: o.ingredientOffsetLocations.map((p) => add(minigameLocation, p)),
    startPos: add(minigameLocation, o.startOffset),
    cauldronOffset: add(minigameLocation, o.cauldronOffset)
  };
}

// data/gametests/src/mobs/RewardTypes.ts
var RewardTypes = {
  Companion: "Companion",
  Transformation: "Transformation",
  Accessory: "Accessory",
  Costume: "Costume"
};
var costumes = [
  "None",
  "Blue",
  "Cutesy",
  "Diamond",
  "Emerald",
  "Fuzzy",
  "Glowing",
  "Gold",
  "Love",
  "Mummy",
  "Noir",
  "Old",
  "Orange",
  "Purple",
  "Rainbow",
  "Red",
  "Robo",
  "Stone",
  "Techno",
  "Vampire",
  "Yellow"
];
var accessories = [
  "None",
  "Viking",
  "Magician",
  "Cap & Glasses",
  "Knight",
  "Beret",
  "Mustache",
  "Top Hat & Monacle",
  "Holiday Hat",
  "Detective Hat",
  "Miner",
  "Jester",
  "Nerdy Goggles",
  "Hero Cape",
  "Spooky Cape",
  "Diamond Helmet",
  "Raincoat",
  "Clown",
  "Nightcap",
  "Headphone",
  "Royal Crown",
  "Mush Co Hat",
  "Spider Hat"
];
var forms = [
  "Om Nom",
  "Creeper Nom",
  "Fire Nom",
  "Guardian Nom",
  "Super Nom",
  "Spooky Nom",
  "Mad Scientist Nom",
  "Pig Nom",
  "Ender Dragon Nom"
];

// data/gametests/src/systems/Minigame/Minigame.ts
var log5 = Logger.getLogger("Minigame");
world15.afterEvents.playerLeave.subscribe((e) => {
  const playerId = e.playerId;
  const player = world15.getEntity(playerId);
  if (player && player instanceof Player12) {
    player.setDynamicProperty("mco_nom:disconnecting", true);
  }
});
world15.afterEvents.playerSpawn.subscribe((e) => {
  const player = e.player;
  const isInitialSpawn = e.initialSpawn;
  const preMinigamePos = player.getDynamicProperty("mco_nom:pre_minigame_position");
  const playerMinigameId = getPlayerMinigameId(player);
  const isPlayerInGame = isPlayerInMinigame(player);
  if (isInitialSpawn && (isPlayerInGame === true || isPlayerInGame === "minigame_not_found")) {
    system16.runTimeout(() => {
      const bufferId = player.getDynamicProperty("mco_nom:buffer_inv_id");
      const minigameOrigin = player.getDynamicProperty(
        "mco_nom:minigame_origin"
      );
      warn(
        `Player ${player.nameTag} rejoining - bufferId: ${bufferId}, minigameOrigin: ${JSON.stringify(
          minigameOrigin
        )}`
      );
      if (bufferId && minigameOrigin) {
        const tempManager = new InventoryManager(minigameOrigin, bufferId);
        try {
          tempManager.transferToPlayer(player);
          tempManager.playerCleanUp(player, player.dimension);
          info(`Successfully restored inventory for ${player.nameTag} on rejoin`);
        } catch (err) {
          error(`Failed to restore inventory on rejoin: ${err}`);
        }
      } else {
        error(
          `Missing buffer data for ${player.nameTag} - bufferId: ${bufferId}, minigameOrigin: ${JSON.stringify(
            minigameOrigin
          )}`
        );
      }
      try {
        player.tryTeleport(preMinigamePos);
      } catch (e2) {
        error("Not able to teleport player to preminigamepos", e2);
      }
      player.setDynamicProperty("mco_nom:current_minigame_id");
      player.setDynamicProperty("mco_nom:minigame_step");
      player.setDynamicProperty("mco_nom:minigame_quit");
      player.setDynamicProperty("mco_nom:disconnecting");
      info("Minigame properties have been cleaned up for ", player.name);
    }, 60);
  }
});
world15.beforeEvents.playerBreakBlock.subscribe((e) => {
  const player = e.player;
  if (isPlayerInMinigame(player) === true) {
    e.cancel = true;
  }
});
world15.afterEvents.playerPlaceBlock.subscribe((e) => {
  const player = e.player;
  const block = e.block;
  if (isPlayerInMinigame(player) === true) {
    player.dimension.spawnItem(block.getItemStack(), player.location);
    block.setType("minecraft:air");
  }
});
var MINIGAME_SPAWN_Y_OFFSET = 50;
var Minigame = class {
  /**
   * @param box - Original box entity that called the minigame
   * @param level - Minigame level number to load (1-4)
   * @param origin - Minigame origin
   * @param dimension - Minigame dimension
   * @param playerIDList - List of player IDs
   * @param isReload - If true, this is a reload
   * @param minigameId - (optional) Persisted minigame id for buffer reuse
   */
  constructor(box, level, origin, dimension, playerIDList, rewardData = { formReward: 0, costumeReward: 0, accessoryReward: 0 }, isReload = false, minigameId, initialTimerSeconds) {
    // Timer in ticks for this minigame instance
    this._timerTicks = 0;
    // How many ticks to increment per scheduled tick() call (matches runInterval 5)
    this._tickDelta = 5;
    // 1 = count up, -1 = count down (for future use)
    this._timerDirection = 1;
    /**
     * True if the minigame is running and initialized, false if not started due to obstructions, etc.
     */
    this.active = true;
    /**
     * True if no players are in the minigame. This is decided during init.
     */
    this.empty = false;
    this.start_player_tick = false;
    // Last second value shown on action bar (to avoid redundant updates)
    this._lastDisplayedSecond = -1;
    this._endFired = false;
    this._completedPlayers = /* @__PURE__ */ new Set();
    this._failedPlayers = /* @__PURE__ */ new Set();
    this.musicTrackName = "mco_nom.music.competitive" /* McoNomMusicCompetitive */;
    this.outOfBoundsDistance = 32;
    this.completionCount = 0;
    this.firstEverMinigame = false;
    this.box = box;
    this.level = level;
    this.origin = origin;
    this.playerIDList = playerIDList;
    this.objectives = [];
    this.type = MinigameTypes.ParkourMinigame;
    this.dimension = dimension;
    this.formReward = rewardData.formReward;
    this.costumeReward = rewardData.costumeReward;
    this.accessoryReward = rewardData.accessoryReward;
    this.id = minigameId ?? `${Date.now()}:${Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}`;
    this.isReload = isReload;
    this.inventoryManager = new InventoryManager(this.origin, this.id);
    this.active = true;
    this.start_player_tick = false;
    this._actionBar = ActionBarManager.getInstance();
    if (this.playerIDList.length == 0) {
      error(`Trying to create empty minigame. Type: ${this.type}`);
      return;
    }
    this.init();
    if (!this.empty) {
      this.update_data();
    }
    if (!this.isReload && !this.empty) {
      this.tickInstance = system16.runInterval(() => {
        this.tick();
      }, 5);
      if (typeof initialTimerSeconds === "number") {
        this._timerTicks = Math.max(
          0,
          Math.floor(initialTimerSeconds * TicksPerSecond2)
        );
        try {
          world15.setDynamicProperty(
            this._dynamicTimerKey,
            Math.floor(initialTimerSeconds)
          );
        } catch {
        }
      }
    }
    if (this.isReload || this.empty) {
      system16.run(() => {
        this.cleanup();
      });
    } else {
      info("New Minigame!");
    }
  }
  /**
   * Returns structure that needs to be placed depending on the level and type of this minigame.
   */
  getStructureForThisGame() {
    if (this.type && this.level) {
      return getStructureName(this.type, this.level);
    } else {
      return void 0;
    }
  }
  /**
   * Loads structure for this minigame and level.
   * The structure has to be defined in MinigameStructures.ts
   * @throws Throws if no structure was found. Throws if this minigame doesn't have location.
   * Throws world.structureManager.place() errors.
   */
  loadStructure() {
    if (this.minigameLocation) {
      const structureToLoad = this.getStructureForThisGame();
      if (!structureToLoad) {
        throw new Error("Error loading structure: structure does not exist!");
      }
      world15.structureManager.place(
        structureToLoad,
        this.dimension,
        this.minigameLocation
      );
    } else {
      throw new Error("Error placing structure. No minigame location is set.");
    }
  }
  /**
   * Transfers inventory to the player and cleanus up the inventory buffers after that.
   * @param inventoryManager
   * @param player
   */
  transferPlayerInventory(inventoryManager, player) {
    inventoryManager.transferToPlayer(player);
    inventoryManager.playerCleanUp(player, this.dimension);
  }
  /**
   * Fills a box from areaMin to areaMax (inclusive) with air blocks in the minigame's dimension.
   * Remove all entities from the area.
   */
  cleanArea(areaMin, areaMax) {
    const entities = this.dimension.getEntities({ families: ["nom_minigame_entity"] });
    for (const entity of entities) {
      try {
        if (entity.getDynamicProperty("mco_nom:current_minigame_id") != this.id) {
          continue;
        }
        entity.remove();
      } catch (err) {
        warn(`Failed to clean up minigame entity: ${err}`);
      }
    }
    try {
      const minX = Math.floor(Math.min(areaMin.x, areaMax.x));
      const maxX = Math.floor(Math.max(areaMin.x, areaMax.x));
      const minY = Math.floor(Math.min(areaMin.y, areaMax.y));
      const maxY = Math.floor(Math.max(areaMin.y, areaMax.y));
      const minZ = Math.floor(Math.min(areaMin.z, areaMax.z));
      const maxZ = Math.floor(Math.max(areaMin.z, areaMax.z));
      const volumeSize = (maxX - minX + 1) * (maxY - minY + 1) * (maxZ - minZ + 1);
      if (volumeSize <= 32768) {
        const volume = new BlockVolume(
          { x: minX, y: minY, z: minZ },
          { x: maxX, y: maxY, z: maxZ }
        );
        this.dimension.fillBlocks(volume, "minecraft:air", {
          ignoreChunkBoundErrors: true
        });
      } else {
        const step = Math.max(
          1,
          Math.floor(32768 / ((maxX - minX + 1) * (maxZ - minZ + 1)))
        );
        for (let y = minY; y <= maxY; y += step) {
          const yEnd = Math.min(y + step - 1, maxY);
          const subVolume = new BlockVolume(
            { x: minX, y, z: minZ },
            { x: maxX, y: yEnd, z: maxZ }
          );
          this.dimension.fillBlocks(subVolume, "minecraft:air", {
            ignoreChunkBoundErrors: true
          });
        }
      }
    } catch (e) {
      error("Error cleaning up minigame area.", e);
    }
  }
  /** Starts a countdown timer for the minigame. */
  countDown(onDone) {
    const countDownTitleColors = {
      "1": "\xA7e",
      "2": "\xA7e",
      "3": "\xA7e",
      "Go!": "\xA7e",
      "GO!": "\xA7e"
    };
    function getCountDownColor(key) {
      const color = countDownTitleColors[key];
      if (color) {
        return countDownTitleColors[key];
      } else {
        return "";
      }
    }
    const countDownTitles = ["3", "2", "1", "Go!"];
    const ticksPerStep = TicksPerSecond2;
    for (const playerId of this.playerIDList) {
      const player = world15.getEntity(playerId);
      if (player && player instanceof Player12) {
        this.music_stop(player);
        player.playSound("mco_nom.ui.loading_screen" /* McoNomUiLoadingScreen */);
        player.runCommand("/camera @s fade time 0.5 3 0.5 color 0 0 0");
        player.addEffect(
          MinecraftEffectTypes.Resistance,
          ticksPerStep * countDownTitles.length,
          { amplifier: 255, showParticles: false }
        );
        player.inputPermissions.setPermissionCategory(
          InputPermissionCategory2.Movement,
          false
        );
        countDownTitles.forEach((title, i) => {
          system16.runTimeout(() => {
            player.onScreenDisplay.setTitle(
              getCountDownColor(title) + title,
              {
                fadeInDuration: 2,
                stayDuration: 16,
                fadeOutDuration: 2
              }
            );
            player.playSound("random.click", { volume: 1, pitch: 1.2 });
            if (i === countDownTitles.length - 1) {
              player.removeEffect(MinecraftEffectTypes.Resistance);
              player.inputPermissions.setPermissionCategory(
                InputPermissionCategory2.Movement,
                true
              );
              this.start_player_tick = true;
              this.music_play(player, this.musicTrackName);
              if (onDone)
                onDone();
            }
          }, i * ticksPerStep);
        });
      }
    }
  }
  /**
   * Compares the old score with the new score.
   * @param oldScore - old score
   * @param newScore - new score
   * @returns Condition in which new score is better that the old one (example: newScore < oldScore)
   */
  isScoreBetter(oldScore, newScore) {
    return newScore < oldScore;
  }
  scoreSort(a, b) {
    return b.score - a.score;
  }
  addScoreRecord(player, score) {
    const globalKey = `mco_nom:minigame_scores_${this.type}_level_${this.level}`;
    const playerName = player.name;
    let leaderboardData = [];
    const storedData = world15.getDynamicProperty(globalKey);
    if (storedData) {
      try {
        leaderboardData = JSON.parse(storedData);
      } catch (error2) {
        leaderboardData = [];
      }
    }
    const existingIndex = leaderboardData.findIndex((entry) => entry.name === playerName);
    if (existingIndex !== -1) {
      if (this.isScoreBetter(leaderboardData[existingIndex].score, score)) {
        leaderboardData[existingIndex].score = score;
      }
    } else {
      leaderboardData.push({ name: playerName, score });
    }
    leaderboardData.sort(this.scoreSort);
    world15.setDynamicProperty(globalKey, JSON.stringify(leaderboardData));
  }
  /**
   *
   * @param player
   * @param score
   * @param isScoreBetter - Comparator function callback.
   * @param applyFormatSeconds - Should the score be formatted to minutes and seconds in chat messages.
   */
  updatePersonalHighScore(player, score, isScoreBetter, scoreOutputFormatting) {
    try {
      const personalKey = `mco_nom:highscore_personal_${this.type}_level_${this.level}`;
      const oldPersonal = player.getDynamicProperty(personalKey);
      if (!oldPersonal || isScoreBetter(oldPersonal, score)) {
        player.setDynamicProperty(personalKey, score);
        const formattedScore = scoreOutputFormatting(score);
        player.sendMessage(`\xA7aNew Personal Record: ${formattedScore}!`);
      }
    } catch (err) {
      warn(`Failed to set personal highscore: ${err}`);
    }
  }
  /**
   * Updates player's star count dynamic property for this minigame and this level.
   * @param player
   * @param starsCollected
   */
  updatePlayerStarsCollected(player, starsCollected) {
    try {
      const personalKey = `mco_nom:stars_collected_${this.type}_level_${this.level}`;
      const oldStars = player.getDynamicProperty(personalKey);
      if (!oldStars || starsCollected > oldStars) {
        player.setDynamicProperty(personalKey, starsCollected);
      }
    } catch (err) {
      warn(`Failed to set personal star count: ${err}`);
    }
  }
  /**
   * Returns the dynamic property key for this minigame's timer.
   */
  get _dynamicTimerKey() {
    return `mco_nom:minigame_time_${this.id}`;
  }
  init() {
    const minigameBeenPlayed = world15.getDynamicProperty("mco_nom:minigame_has_been_played");
    if (!minigameBeenPlayed) {
      info("This minigame is the first minigame in this world");
      this.firstEverMinigame = true;
    }
    world15.setDynamicProperty("mco_nom:minigame_has_been_played", true);
    world15.gameRules.showTags = false;
    if (!this._timerTicks)
      this._timerTicks = 0;
    try {
      world15.setDynamicProperty(
        this._dynamicTimerKey,
        Math.floor(this._timerTicks / TicksPerSecond2)
      );
    } catch {
    }
    if (this.box) {
      try {
        this.box.setDynamicProperty("mco_nom:current_minigame_id", this.id);
      } catch (error2) {
        error(error2);
      }
    }
    for (const playerId of this.playerIDList) {
      let player;
      try {
        player = world15.getEntity(playerId);
      } catch (err) {
        error(`Error getting player. Removing.`);
        this.remove_player(playerId);
      }
      if (!player) {
        continue;
      }
      if (!player || !(player instanceof Player12)) {
        this.remove_player(playerId);
      } else {
        if (this.playerIDList.length == 0) {
          this.empty = true;
        }
        if (this.empty) {
          return;
        }
        if (this.isReload) {
          info("Shutting down a resumed Minigame.");
        } else {
          try {
            eatStackItemsManager.clearPlayerState(player);
          } catch (err) {
            warn(`Failed to clear player stack state: ${err}`);
          }
          player.setDynamicProperty("mco_nom:current_minigame_id", this.id);
          player.setDynamicProperty("mco_nom:pre_minigame_position", {
            ...player.location
          });
          player.setDynamicProperty(`mco_nom:minigame_step`, 0);
          player.setDynamicProperty("mco_nom:minigame_quit");
          player.setDynamicProperty("mco_nom:disconnecting");
          player.setDynamicProperty(`mco_nom:minigame_origin`, this.origin);
          try {
            this.inventoryManager.transferFromPlayer(player);
          } catch (err) {
            warn(`Failed to save inventory for ${player.nameTag}: ${err}`);
          }
          try {
            player.runCommand(
              `replaceitem entity @s slot.hotbar 8 ${"mco_nom:minigame_menu" /* MinigameMenu */} 1 0 {"minecraft:item_lock":{"mode":"lock_in_slot"},"minecraft:keep_on_death":{}}`
            );
          } catch (e) {
            warn(
              `Failed to set or lock minigame menu item for ${player.nameTag}: ${e}`
            );
          }
        }
      }
    }
  }
  generate_data() {
    const base = {
      level: this.level,
      type: this.type,
      origin: this.origin,
      dimensionId: this.dimension.id,
      playerIDList: this.playerIDList,
      minigameId: this.id,
      formReward: this.formReward,
      costumeReward: this.costumeReward,
      accessoryReward: this.accessoryReward,
      musicTrackName: this.musicTrackName
    };
    base.timerSeconds = Math.floor(this._timerTicks / TicksPerSecond2);
    return JSON.stringify(base);
  }
  update_data() {
    const data = this.generate_data();
    world15.setDynamicProperty(`mco_nom:minigame_data_${this.id}`, data);
    const activeMinigameString = world15.getDynamicProperty(`mco_nom:minigame_list`) ?? "";
    const activeMinigameList = activeMinigameString.split(";");
    const index = activeMinigameList.indexOf(`${this.id}`);
    if (index == -1) {
      activeMinigameList.push(`${this.id}`);
      world15.setDynamicProperty(
        `mco_nom:minigame_list`,
        `${activeMinigameList.join(";")}`
      );
    }
    info(`Minigame Data Saved. Type: ${this.type}`);
  }
  tick() {
    if (!this.active)
      return;
    if (this.start_player_tick && !(world15.getDynamicProperty("mco_nom:minigame_timer_pause") ?? false)) {
      this._timerTicks += this._tickDelta * this._timerDirection;
      try {
        world15.setDynamicProperty(
          this._dynamicTimerKey,
          Math.floor(this._timerTicks / TicksPerSecond2)
        );
      } catch {
      }
    }
    const totalSeconds = Math.floor(this._timerTicks / TicksPerSecond2);
    if (totalSeconds !== this._lastDisplayedSecond && this.start_player_tick) {
      this._lastDisplayedSecond = totalSeconds;
      if (!this._endFired) {
        this._updateActionBar(totalSeconds);
      }
    }
    for (const playerId of [...this.playerIDList]) {
      let player;
      try {
        player = world15.getEntity(playerId);
      } catch (err) {
        error(`Error getting player. Removing.`);
        this.remove_player(playerId);
        return;
      }
      if (player && player instanceof Player12) {
        if (player.getDynamicProperty("mco_nom:minigame_quit")) {
          this.remove_player(playerId);
          continue;
        }
        this.player_tick(player);
      } else {
        this.remove_player(playerId);
      }
    }
  }
  player_tick(player) {
    this.out_of_bounds_check(player);
  }
  out_of_bounds_check(player) {
    if (!this.outOfBoundsTPLocation) {
      return;
    }
    const dx = player.location.x - this.outOfBoundsTPLocation.x;
    const dy = player.location.y - this.outOfBoundsTPLocation.y;
    const dz = player.location.z - this.outOfBoundsTPLocation.z;
    const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
    if (distance > this.outOfBoundsDistance) {
      this.out_of_bounds_recover(player);
    }
  }
  out_of_bounds_recover(player) {
    if (!this.outOfBoundsTPLocation) {
      warn("No Out Of Bounds location.");
      return;
    }
    player.teleport(this.outOfBoundsTPLocation);
    player.runCommand(`/camera @s fade time 0 0.2 0.2 color 0 0 0`);
    const pitch = 0.9 + Math.random() * 0.2;
    if (this.start_player_tick) {
      system16.runTimeout(() => {
        player.playSound("mco_nom.minigame_teleport" /* McoNomMinigameTeleport */, {
          volume: 0.4,
          location: player.location,
          pitch
        });
      }, 5);
    }
  }
  music_play(player, trackName) {
    const musicOptions = {
      fade: 1,
      loop: true,
      volume: 1
    };
    const prefMusic = player.getDynamicProperty("mco_nom:pref_music_enabled");
    try {
      if (typeof prefMusic === "undefined" || prefMusic === true) {
        player.playMusic(trackName, musicOptions);
      }
    } catch {
    }
  }
  music_stop(player) {
    const prefMusic = player.getDynamicProperty("mco_nom:pref_music_enabled");
    try {
      if (typeof prefMusic === "undefined" || prefMusic === true) {
        player.playMusic("mco_nom.music.empty" /* McoNomMusicEmpty */, { fade: 2, loop: false });
      }
    } catch {
      try {
        player.stopMusic();
      } catch {
      }
    }
  }
  showWinningTitle(player) {
    const starCount = player.getDynamicProperty("mco_nom:star_count") ?? 0;
    const WinningTitles = {
      0: "Passable!",
      1: "Good!",
      2: "Great!",
      3: "Excellent!"
    };
    const TitleColors = {
      0: "\xA7e",
      1: "\xA7e",
      2: "\xA7e",
      3: "\xA7e\xA7l"
    };
    const winningTitle = WinningTitles[starCount] ?? "Excellent!";
    const titleColor = TitleColors[starCount] ?? "\xA7e\xA7l";
    const TicksPerSecond6 = 20;
    const stay = 5 * TicksPerSecond6;
    player.onScreenDisplay.setTitle(titleColor + winningTitle, {
      fadeInDuration: 1 * TicksPerSecond6,
      stayDuration: stay,
      fadeOutDuration: 1 * TicksPerSecond6,
      subtitle: `\xA7eStars: ${starCount}/3`
    });
  }
  showLosingTitle(player) {
    const title = "Womp Womp";
    const subtitle = "Better luck next time!";
    const titleColor = "\xA7c";
    const TicksPerSecond6 = 20;
    const stay = 5 * TicksPerSecond6;
    player.onScreenDisplay.setTitle(
      titleColor + title,
      {
        fadeInDuration: 1 * TicksPerSecond6,
        stayDuration: stay,
        fadeOutDuration: 1 * TicksPerSecond6,
        subtitle: titleColor + subtitle
      }
    );
  }
  /**
   * Unlocks corresponding rewards (costume/form/accessory) for this minigame.
   * @param player
   */
  unlockRewards(player) {
    const firstEverReward = RewardTypes.Companion;
    const unlockedForms = player.getDynamicProperty("mco_nom:unlocked_forms") ?? ";";
    const unlockedCostumes = player.getDynamicProperty("mco_nom:unlocked_costumes") ?? ";";
    const unlockedAccessories = player.getDynamicProperty("mco_nom:unlocked_accessories") ?? ";";
    if (this.formReward === 0 && this.accessoryReward === 0 && this.costumeReward === 0) {
      this._actionBar.queueRewardUnlockMessage(player, firstEverReward, forms[0]);
      return;
    }
    if (String(unlockedForms).includes(`;${this.formReward};`)) {
    } else {
      player.setDynamicProperty(
        "mco_nom:unlocked_forms",
        `${String(unlockedForms)}${this.formReward};`
      );
      if (!this.firstEverMinigame && this.formReward != 0) {
        this._actionBar.queueRewardUnlockMessage(
          player,
          RewardTypes.Transformation,
          forms[this.formReward]
        );
      }
    }
    if (String(unlockedCostumes).includes(`;${this.costumeReward};`)) {
    } else {
      player.setDynamicProperty(
        "mco_nom:unlocked_costumes",
        `${String(unlockedCostumes)}${this.costumeReward};`
      );
      if (!this.firstEverMinigame && this.costumeReward != 0) {
        this._actionBar.queueRewardUnlockMessage(
          player,
          RewardTypes.Costume,
          costumes[this.costumeReward]
        );
      } else {
        this._actionBar.queueRewardUnlockMessage(player, firstEverReward, forms[0]);
      }
    }
    if (String(unlockedAccessories).includes(`;${this.accessoryReward};`)) {
    } else {
      player.setDynamicProperty(
        "mco_nom:unlocked_accessories",
        `${String(unlockedAccessories)}${this.accessoryReward};`
      );
      if (!this.firstEverMinigame && this.accessoryReward != 0) {
        this._actionBar.queueRewardUnlockMessage(
          player,
          RewardTypes.Accessory,
          accessories[this.accessoryReward]
        );
      } else {
        this._actionBar.queueRewardUnlockMessage(player, firstEverReward, forms[0]);
      }
    }
  }
  /**
   *
   * @param player
   * @param removePlayerTimeout Timeout in seconds
   */
  completed_minigame(player, removePlayerTimeout = 5) {
    if (this._completedPlayers.has(player.id))
      return;
    this._completedPlayers.add(player.id);
    this._actionBar.clearMinigameMessages(player);
    info(`${player.nameTag} completed minigame!`);
    this.completionCount += 1;
    this.music_stop(player);
    this.showWinningTitle(player);
    player.playSound("mco_nom.ui.end_level" /* McoNomUiEndLevel */);
    system16.runTimeout(() => {
      this.remove_player(player.id);
      this.unlockRewards(player);
    }, removePlayerTimeout * TicksPerSecond2);
  }
  /**
   *
   * @param player
   * @param removePlayerTimeout Timeout in seconds
   */
  lost_minigame(player, removePlayerTimeout = 3) {
    if (this._failedPlayers.has(player.id))
      return;
    this._failedPlayers.add(player.id);
    this._actionBar.clearMinigameMessages(player);
    info(`${player.nameTag} failed minigame...`);
    this.music_stop(player);
    this.showLosingTitle(player);
    player.playSound("mco_nom.ui.lose_level" /* McoNomUiLoseLevel */);
    system16.runTimeout(() => {
      this.remove_player(player.id);
    }, removePlayerTimeout * TicksPerSecond2);
  }
  /**
   * This function handles several things:
   * -Removes player from this minigame playerIDList;
   * -If the player is the last player of the minigame, runs minigame cleanup process;
   * -Stops music for the player depending on his music prefs;
   * -Teleports the player back to his pre minigame position;
   * -Cleans up player's minigame dynamic properties and restores his inventory.
   *
   * @param playerId - targer playerId.
   * @returns
   */
  remove_player(playerId) {
    const idx = this.playerIDList.indexOf(playerId);
    if (idx !== -1) {
      let player;
      try {
        player = world15.getEntity(playerId);
      } catch {
        error("Error trying to get the player.");
        return;
      }
      this.playerIDList.splice(idx, 1);
      if (player && player instanceof Player12) {
        const isLastPlayer = this.playerIDList.length === 0;
        const blindnessDuration = 1;
        const lastPlayerTeleportDelayTicks = 15;
        player.inputPermissions.setPermissionCategory(
          InputPermissionCategory2.Movement,
          false
        );
        player.runCommand(
          `/camera @s fade time 0.5 ${blindnessDuration} 0.5 color 0 0 0`
        );
        player.addEffect(MinecraftEffectTypes.Resistance, 40, {
          amplifier: 255,
          showParticles: false
        });
        this._actionBar.clearMinigameMessages(player);
        if (isLastPlayer) {
          this.cleanup();
        }
        const teleportTarget = player.getDynamicProperty(
          "mco_nom:pre_minigame_position"
        );
        const isDisconnecting = player.getDynamicProperty(
          "mco_nom:disconnecting"
        );
        if (!isDisconnecting) {
          this.music_stop(player);
        }
        system16.runTimeout(
          () => {
            if (!isDisconnecting) {
              if (teleportTarget) {
                try {
                  player.tryTeleport(teleportTarget);
                } catch (err) {
                  warn(
                    `Failed to teleport player to original position: ${err}`
                  );
                }
              } else {
                warn(
                  "No original position found for player, skipping teleport."
                );
              }
              system16.runTimeout(() => {
                player.removeEffect(MinecraftEffectTypes.Blindness);
                player.removeEffect(MinecraftEffectTypes.Resistance);
                player.inputPermissions.setPermissionCategory(
                  InputPermissionCategory2.Movement,
                  true
                );
                player.setDynamicProperty("mco_nom:minigame_quit");
                player.setDynamicProperty("mco_nom:current_minigame_id");
              }, 20);
              try {
                this.transferPlayerInventory(this.inventoryManager, player);
              } catch (err) {
                warn(
                  `Failed to restore inventory for ${player.nameTag}: ${err}`
                );
              }
            }
            player.setDynamicProperty("mco_nom:disconnecting");
          },
          isLastPlayer ? lastPlayerTeleportDelayTicks : 1
        );
      }
    }
  }
  cleanup() {
    this.stop();
    this.give_rewards();
  }
  stop() {
    try {
      world15.setDynamicProperty(this._dynamicTimerKey);
    } catch {
    }
    world15.setDynamicProperty(`mco_nom:minigame_data_${this.id}`);
    const activeMinigameString = world15.getDynamicProperty(`mco_nom:minigame_list`) ?? "";
    const activeMinigameList = activeMinigameString.split(";");
    const index = activeMinigameList.indexOf(`${this.id}`);
    if (index != -1) {
      activeMinigameList.splice(index, 1);
      world15.setDynamicProperty(
        `mco_nom:minigame_list`,
        `${activeMinigameList.join(";")}`
      );
    }
    if (this.tickInstance) {
      system16.clearRun(this.tickInstance);
    }
    const runningMinigames = getRunningMinigames();
    if (!runningMinigames || runningMinigames.length == 0) {
      world15.gameRules.showTags = true;
      info("ShowTags = true");
    }
    for (const playerId of this.playerIDList) {
      const player = world15.getEntity(playerId);
      if (player && player instanceof Player12) {
        this._actionBar.clearMinigameMessages(player);
      }
    }
  }
  formatTimeFromTicks(ticks) {
    const totalSeconds = Math.max(0, Math.floor(ticks / TicksPerSecond2));
    const minutes = Math.floor(totalSeconds / 60);
    const seconds = totalSeconds % 60;
    const paddedSeconds = seconds.toString().padStart(2, "0");
    if (minutes > 0)
      return `${minutes}m ${paddedSeconds}s`;
    return `${seconds}s`;
  }
  /**
   * Update action bar for all players in this minigame.
   */
  _updateActionBar(totalSeconds) {
    const timeString = this.formatTimeFromTicks(totalSeconds * TicksPerSecond2);
    for (const playerId of this.playerIDList) {
      const player = world15.getEntity(playerId);
      if (player && player instanceof Player12) {
        const text = `\xA7l${timeString}`;
        this._actionBar.queueMinigameStatus(player, text);
      }
    }
  }
  give_rewards() {
    if (this.completionCount > 0) {
      system16.runTimeout(() => {
        try {
          let rewardBoxPos = {
            x: this.origin.x - 2 + 4 * Math.random(),
            y: this.origin.y,
            z: this.origin.z - 2 + 4 * Math.random()
          };
          if (this.box) {
            rewardBoxPos.x = this.box.location.x - 2 + 4 * Math.random();
            rewardBoxPos.y = this.box.location.y;
            rewardBoxPos.z = this.box.location.z - 2 + 4 * Math.random();
            this.box.triggerEvent("mco_nom:transform_to_rewarard_box");
          } else {
            error("Cant find the box. Placing rewards at the origin");
          }
          const candyItem = new ItemStack6("mco_nom:candy");
          const donutItem = new ItemStack6("mco_nom:donut");
          system16.runTimeout(() => {
            for (let i = 0; i < this.completionCount; i += 1) {
              try {
                const nom = this.dimension.spawnEntity(
                  "mco_nom:om_nom",
                  rewardBoxPos
                );
                nom.setProperty("mco_nom:form", this.formReward);
                nom.setProperty("mco_nom:costume", this.costumeReward);
                nom.setProperty("mco_nom:accessory", this.accessoryReward);
                system16.runTimeout(() => {
                  try {
                    for (let j = 0; j < 10; j += 1) {
                      if (Math.random() < 0.5) {
                        this.dimension.spawnItem(candyItem, {
                          x: rewardBoxPos.x - 1.5 + 3 * Math.random(),
                          y: rewardBoxPos.y - 1.5 + 3 * Math.random(),
                          z: rewardBoxPos.z - 1.5 + 3 * Math.random()
                        });
                      } else {
                        this.dimension.spawnItem(donutItem, {
                          x: rewardBoxPos.x - 1.5 + 3 * Math.random(),
                          y: rewardBoxPos.y - 1.5 + 3 * Math.random(),
                          z: rewardBoxPos.z - 1.5 + 3 * Math.random()
                        });
                      }
                    }
                  } catch (err) {
                    error(`Minigame Food Reward Error: ${err}`);
                  }
                }, 15);
              } catch (err) {
                error(`Minigame Reward Error: ${err}`);
              }
            }
          }, 15);
        } catch (err) {
          error(`Reward Box Spawn Error: ${err}`);
        }
      }, 25);
    }
  }
};
function getPersonalHighScore(player, minigameType, level, applyFormatSeconds) {
  try {
    const personalKey = `mco_nom:highscore_personal_${minigameType}_level_${level}`;
    const personalHighScore = player.getDynamicProperty(personalKey);
    if (applyFormatSeconds) {
      const formattedScore = formatSeconds(personalHighScore);
      if (formattedScore) {
        return formattedScore;
      } else {
        return void 0;
      }
    } else {
      return personalHighScore;
    }
  } catch (err) {
    warn(`Failed to get ${player.nameTag}'s personal highscore: ${err}`);
    return void 0;
  }
}
function getScoreRecords(type, level) {
  const globalKey = `mco_nom:minigame_scores_${type}_level_${level}`;
  const storedData = world15.getDynamicProperty(globalKey);
  if (!storedData) {
    return [];
  }
  try {
    const leaderboardData = JSON.parse(storedData);
    return leaderboardData;
  } catch (error2) {
    return [];
  }
}
function getPlayerStarCount(player, minigameType, level) {
  try {
    const personalKey = `mco_nom:stars_collected_${minigameType}_level_${level}`;
    const starCount = player.getDynamicProperty(personalKey);
    return starCount;
  } catch (err) {
    warn(`Failed to get ${player.nameTag}'s personal star count: ${err}`);
    return void 0;
  }
}
function getRunningMinigames() {
  const activeMinigameString = world15.getDynamicProperty("mco_nom:minigame_list");
  const activeMinigameList = activeMinigameString?.split(";").filter((s) => s.trim().length > 0);
  return activeMinigameList;
}
function getPlayerMinigameId(player) {
  return player.getDynamicProperty("mco_nom:current_minigame_id");
}
function isMinigameRunning(gameId) {
  const list = getRunningMinigames();
  if (!list || !gameId)
    return false;
  const index = list.indexOf(`${gameId}`);
  return index != -1;
}
function isPlayerInMinigame(player) {
  const playerGameId = getPlayerMinigameId(player);
  if (!playerGameId) {
    return false;
  }
  const isPlayerMinigameRunning = isMinigameRunning(playerGameId);
  if (isPlayerMinigameRunning) {
    return true;
  } else {
    return "minigame_not_found";
  }
}
system16.afterEvents.scriptEventReceive.subscribe(({ sourceEntity, id }) => {
  if (sourceEntity === void 0 || sourceEntity instanceof Player12 === false)
    return;
  const player = sourceEntity;
  if (id === "nom:get_my_properties") {
    const all_properties_list = player.getDynamicPropertyIds();
    const current_minigame_id = getPlayerMinigameId(player);
    const pre_minigame_position = player.getDynamicProperty(
      "mco_nom:pre_minigame_position"
    );
    const minigame_origin = player.getDynamicProperty("mco_nom:minigame_origin");
    const minigame_quit = player.getDynamicProperty("mco_nom:minigame_quit");
    const disconnecting = player.getDynamicProperty("mco_nom:disconnecting");
    const pref_music_enabled = player.getDynamicProperty("mco_nom:pref_music_enabled");
    info("All properties: ", all_properties_list);
    info("Current minigame ID: ", current_minigame_id);
    info("Pre minigame position: ", pre_minigame_position);
    info("Minigame origin: ", minigame_origin);
    info("Is quitting minigame: ", minigame_quit);
    info("Is disconnecting: ", disconnecting);
    info("Is music enabled: ", pref_music_enabled);
  } else if (id === "nom:buffers_say_hi") {
    const buffers = world15.getDimension("overworld").getEntities({
      type: "mco_nom:inventory_buffer" /* InventoryBuffer */
    });
    if (buffers.length == 0) {
      info("No buffers found.");
      return;
    }
    for (const buffer of buffers) {
      try {
        buffer.runCommand("say Hi, I am a buffer");
      } catch {
        warn("failed to make buffer say hi");
      }
    }
  } else if (id === "nom:get_my_star_count_parkour_1") {
    const stars = getPlayerStarCount(player, MinigameTypes.ParkourMinigame, 2);
    info(`${player.nameTag}s star count is `, stars);
  } else if (id == "mco_nom:minigame_timer_pause") {
    world15.setDynamicProperty("mco_nom:minigame_timer_pause", !world15.getDynamicProperty("mco_nom:minigame_timer_pause"));
  }
});

// data/gametests/src/mobs/CardboardBox.ts
import { world as world20, system as system21, ItemStack as ItemStack8, Player as Player16, TicksPerSecond as TicksPerSecond5, BlockVolume as BlockVolume2 } from "@minecraft/server";
import { ActionFormData } from "@minecraft/server-ui";

// data/gametests/src/systems/Minigame/ParkourMinigame.ts
import { world as world16, system as system17, Player as Player13, TicksPerSecond as TicksPerSecond3 } from "@minecraft/server";

// data/gametests/src/systems/Objective/Objective.ts
var log6 = Logger.getLogger("Minigame Objective");
var Objective = class {
  evaluate(player) {
    try {
      if (this.test(player)) {
        const step = player.getDynamicProperty(`mco_nom:minigame_step`) ?? 0;
        if (typeof step !== "number") {
          warn(`Player ${player.name} has an invalid step value: ${step}`);
          return;
        }
        player.setDynamicProperty(`mco_nom:minigame_step`, step + 1);
      }
    } catch (err) {
      warn(`Minigame Objective Error: ${err}`);
    }
  }
  test(player) {
    throw new Error("test() method must be implemented by subclass");
  }
};

// data/gametests/src/systems/Objective/LocationObjective.ts
var log7 = Logger.getLogger("LocationObjective");
var LocationObjective = class extends Objective {
  constructor(location, minDistance) {
    super();
    this.location = new Vec3(location);
    this.minDistance = minDistance;
  }
  test(player) {
    return this.location.distance(player.location) <= this.minDistance;
  }
};

// data/gametests/src/systems/Objective/SetDynamicPropertyObjective.ts
var log8 = Logger.getLogger("SetDynamicPropertyObjective");
var SetDynamicPropertyObjective = class extends Objective {
  constructor(propertyName, value) {
    super();
    this.propertyName = propertyName;
    this.value = value;
  }
  test(player) {
    player.setDynamicProperty(this.propertyName, this.value);
    return true;
  }
};

// data/gametests/src/systems/Objective/TestDynamicPropertyObjective.ts
var log9 = Logger.getLogger("TestDynamicPropertyObjective");
var TestDynamicPropertyObjective = class extends Objective {
  constructor(propertyName, value) {
    super();
    this.propertyName = propertyName;
    this.value = value;
  }
  test(player) {
    const playerValue = player.getDynamicProperty(this.propertyName);
    if (isNaN(this.value))
      return playerValue == this.value;
    else
      return playerValue >= this.value;
  }
};

// data/gametests/src/systems/Minigame/ParkourMinigame.ts
var log10 = Logger.getLogger("Parkour Minigame");
var ParkourMinigame = class extends Minigame {
  constructor() {
    super(...arguments);
    this.checkpointInitialized = false;
    this.finishRadiusSq = 3 * 3;
    this.candyGoal = 10;
    this.starGoal = 3;
  }
  init() {
    info(`hey, Initing parkour minigame. Is reload? ${this.isReload}`);
    this.musicTrackName = "mco_nom.music.competitive" /* McoNomMusicCompetitive */;
    this.minigameLocation = {
      x: this.origin.x,
      y: this.origin.y + MINIGAME_SPAWN_Y_OFFSET,
      z: this.origin.z
    };
    this.areaMin = { ...this.minigameLocation };
    this.areaMax = getParkourStageConfiguration(this.level, this.minigameLocation).size;
    super.init();
    if (!this.isReload) {
      system17.runTimeout(() => {
        this.countDown();
      }, 2);
    }
    this.type = MinigameTypes.ParkourMinigame;
    this.name = "Nom's Candy Parkour";
    this.startPos = getParkourStageConfiguration(
      this.level,
      this.minigameLocation
    ).startPos;
    this.finishPos = getParkourStageConfiguration(
      this.level,
      this.minigameLocation
    ).finishPos;
    this.outOfBoundsTPLocation = this.startPos;
    this.outOfBoundsDistance = 50;
    if (!this.isReload) {
      for (const playerId of this.playerIDList) {
        const p = world16.getEntity(playerId);
        if (p && p instanceof Player13) {
          p.setDynamicProperty("mco_nom:candy_count", 0);
          p.setDynamicProperty("mco_nom:star_count", 0);
        }
      }
      this.objectives = [
        new SetDynamicPropertyObjective("mco_nom:candy_count", 0),
        new SetDynamicPropertyObjective("mco_nom:star_count", 0),
        new TestDynamicPropertyObjective("mco_nom:candy_count", 10),
        new LocationObjective(this.finishPos, 5)
      ];
      try {
        this.loadStructure();
      } catch (e) {
        error(e);
        this.cleanup();
        return;
      }
      system17.runTimeout(() => {
        this.setup_entities(this.areaMin, this.areaMax);
      }, 5);
    }
  }
  isScoreBetter(oldScore, newScore) {
    return newScore < oldScore;
  }
  scoreSort(a, b) {
    return a.score - b.score;
  }
  setup_entities(areaMin, areaMax) {
    const minX = Math.floor(areaMin.x);
    const minY = Math.floor(areaMin.y);
    const minZ = Math.floor(areaMin.z);
    const maxX = Math.floor(areaMax.x);
    const maxY = Math.floor(areaMax.y);
    const maxZ = Math.floor(areaMax.z);
    const entities = this.dimension.getEntities({ families: ["nom_minigame_entity"] });
    for (const entity of entities) {
      try {
        const loc = entity.location;
        if (loc.x >= minX && loc.x <= maxX && loc.y >= minY && loc.y <= maxY && loc.z >= minZ && loc.z <= maxZ) {
          entity.setDynamicProperty("mco_nom:minigame_id", this.id);
        }
      } catch (err) {
        warn(`Failed to assign minigame id to minigame entity: ${err}`);
      }
    }
  }
  evaluate_objectives(player) {
    const dx = player.location.x - this.finishPos.x;
    const dy = player.location.y - this.finishPos.y;
    const dz = player.location.z - this.finishPos.z;
    const distSq = dx * dx + dy * dy + dz * dz;
    if (distSq > this.finishRadiusSq)
      return;
    const candyCount = player.getDynamicProperty("mco_nom:candy_count") ?? 0;
    if (candyCount >= this.candyGoal) {
      this.completed_minigame(player);
    } else {
      this.lost_minigame(player);
    }
  }
  tick() {
    super.tick();
    this.checkpointInitialized = true;
  }
  player_tick(player) {
    this.evaluate_objectives(player);
    super.player_tick(player);
    player.addEffect("instant_health", 20, { amplifier: 50, showParticles: false });
    player.addEffect("saturation", 20, { amplifier: 50, showParticles: false });
    let checkpoint = player.getDynamicProperty("mco_nom:parkour_checkpoint");
    if (!this.checkpointInitialized && !this.isReload) {
      player.setDynamicProperty("mco_nom:parkour_checkpoint", this.startPos);
      checkpoint = this.startPos;
    }
    if (player.location.y < this.startPos.y - 5) {
      if (!this.start_player_tick)
        return;
      player.runCommand(`/camera @s fade time 0 0.2 0.2 color 0 0 0`);
      const pitch = 0.9 + Math.random() * 0.2;
      player.teleport(checkpoint);
      system17.runTimeout(() => {
        player.playSound("mco_nom.minigame_teleport" /* McoNomMinigameTeleport */, { volume: 0.4, location: player.location, pitch });
      }, 5);
    }
  }
  completed_minigame(player) {
    super.completed_minigame(player);
    const totalSeconds = Math.max(0, Math.floor(this._timerTicks / TicksPerSecond3));
    const starCount = player.getDynamicProperty("mco_nom:star_count") ?? 0;
    this.addScoreRecord(player, totalSeconds);
    this.updatePlayerStarsCollected(player, starCount);
    this.updatePersonalHighScore(
      player,
      totalSeconds,
      this.isScoreBetter,
      this.scoreMessageFormatting
    );
  }
  scoreMessageFormatting(score) {
    return `${formatSeconds(Number(score))}`;
  }
  cleanup() {
    super.cleanup();
    let anyQuit = false;
    for (const player of this.dimension.getPlayers()) {
      if (player.getDynamicProperty("mco_nom:minigame_quit") === true) {
        anyQuit = true;
        break;
      }
    }
    system17.runTimeout(() => {
      this.cleanArea(this.areaMin, this.areaMax);
    }, 10);
  }
  _updateActionBar(totalSeconds) {
    const timeString = formatSeconds(totalSeconds);
    for (const playerId of this.playerIDList) {
      const player = world16.getEntity(playerId);
      if (!player || !(player instanceof Player13)) {
        continue;
      }
      if (this._completedPlayers.has(player.id))
        continue;
      const candyCount = player.getDynamicProperty("mco_nom:candy_count") ?? 0;
      const starCount = player.getDynamicProperty("mco_nom:star_count") ?? 0;
      const divider = "\xA7r\xA77|\xA7r";
      const counts = `\xA77Candy: \xA76\xA7l${candyCount}/${this.candyGoal} ${divider} \xA7r\xA77Stars: \xA7l\xA7e${starCount}/${this.starGoal}`;
      const text = `\xA7r\xA77Time: ${timeString} ${divider} ${counts}`;
      this._actionBar.queueMinigameStatus(player, text);
    }
  }
};

// data/gametests/src/systems/Minigame/CauldronMinigame.ts
import { world as world17, system as system18, Player as Player14 } from "@minecraft/server";

// data/gametests/src/systems/Minigame/minigame_random.ts
function createPRNG(seed) {
  let a = seed >>> 0;
  return function rand() {
    a = a + 1831565813 >>> 0;
    let t = Math.imul(a ^ a >>> 15, 1 | a);
    t ^= t + Math.imul(t ^ t >>> 7, 61 | t);
    return ((t ^ t >>> 14) >>> 0) / 4294967296;
  };
}
function randInt(rand, n) {
  return Math.floor(rand() * n);
}
function fisherYates(arr, rand) {
  const a = arr.slice();
  for (let i = a.length - 1; i > 0; i--) {
    const j = randInt(rand, i + 1);
    const t = a[i];
    a[i] = a[j];
    a[j] = t;
  }
  return a;
}
function sattoloDerangement(arr, rand) {
  const a = arr.slice();
  for (let i = a.length - 1; i > 0; i--) {
    const j = randInt(rand, i);
    const t = a[i];
    a[i] = a[j];
    a[j] = t;
  }
  return a;
}
function isDerangement(prev, next) {
  if (prev.length !== next.length)
    return false;
  for (let i = 0; i < prev.length; i++)
    if (prev[i] === next[i])
      return false;
  return true;
}
function shuffleDerangement(arr, rand) {
  if (arr.length < 2)
    return arr.slice();
  for (let tries = 0; tries < 16; tries++) {
    const cand = fisherYates(arr, rand);
    if (isDerangement(arr, cand))
      return cand;
  }
  return sattoloDerangement(arr, rand);
}
function shuffleIngredientsEnsuringMove(list, rand) {
  return shuffleDerangement(list, rand);
}
function pickDifferent(rand, n, exclude) {
  if (n <= 1)
    return 0;
  const r = randInt(rand, n - 1);
  return r < exclude ? r : r + 1;
}
function nextRecipeAndDistribution(prevRecipe, prevDist, recipesLen, distsLen, rand) {
  const pr = prevRecipe ?? -1;
  const pd = prevDist ?? -1;
  const recipeIdx = pickDifferent(rand, recipesLen, Math.max(0, pr));
  const distIdx = pickDifferent(rand, distsLen, Math.max(0, pd));
  return { recipeIdx, distIdx };
}
function hashString32(s) {
  let h = 2166136261 >>> 0;
  for (let i = 0; i < s.length; i++) {
    h ^= s.charCodeAt(i);
    h = Math.imul(h, 16777619);
  }
  return h >>> 0;
}

// data/gametests/src/systems/Minigame/CauldronMinigame.ts
var log11 = Logger.getLogger("Cauldron Minigame");
var cauldronRecipes = [
  { result: "candy_apple", ingredients: ["apple", "candy", "syrup"] },
  { result: "chocolate_strawberries", ingredients: ["chocolate_bar", "strawberry", "milk"] },
  { result: "cupcake", ingredients: ["chocolate_bar", "flour", "milk"] },
  { result: "strawberry_shortcake", ingredients: ["strawberry", "milk", "candy"] },
  { result: "apple_pie", ingredients: ["butter", "apple", "flour"] },
  { result: "buttermilk_pancakes", ingredients: ["butter", "milk", "syrup"] },
  { result: "donut", ingredients: ["candy", "flour", "butter"] }
];
var cauldronRecipeDistributions = [
  [1, 1, 2],
  [1, 2, 1],
  [2, 1, 1]
];
system18.afterEvents.scriptEventReceive.subscribe((e) => {
  const target = e.sourceEntity;
  if (e.id == "mco_nom:gave_ingredient") {
    if (!target) {
      return;
    }
    target.setDynamicProperty("mco_nom:given_ingredient", e.message);
  }
});
var CauldronMinigame = class extends Minigame {
  constructor() {
    super(...arguments);
    this.globalRecipeCount = 0;
    this.timeExpired = false;
    this.topCook = "";
    this.topScore = 0;
    this.shuffledIngredients = false;
  }
  isScoreBetter(oldScore, newScore) {
    return newScore > oldScore;
  }
  scoreMessageFormatting(score) {
    return `${score} recipes`;
  }
  init() {
    this.musicTrackName = "mco_nom.music.competitive" /* McoNomMusicCompetitive */;
    this.difficultyConfigurations = [
      {
        duration: 3 * 60,
        recipeCount: 3
      },
      {
        duration: 4 * 60,
        recipeCount: 3
      },
      {
        duration: 5 * 60,
        recipeCount: 3
      },
      {
        duration: 3 * 60,
        recipeCount: 3
      }
    ];
    this.difficultyData = this.difficultyConfigurations[this.level - 1];
    this.timerStartTime = this.difficultyData.duration * 20;
    this._timerTicks = this.timerStartTime;
    this._timerDirection = -1;
    this.phaseLength = 5 * 60 * 20;
    this.secondPhaseLength = 70 * 20;
    this.ingredientPhase = Math.floor(this._timerTicks / this.phaseLength);
    this.recipeCount = this.difficultyData.recipeCount;
    this.minigameLocation = {
      x: this.origin.x,
      y: this.origin.y + MINIGAME_SPAWN_Y_OFFSET,
      z: this.origin.z
    };
    this.areaMin = { ...this.minigameLocation };
    this.areaMax = getCauldronStageConfiguration(this.level, this.minigameLocation).size;
    this.startPos = getCauldronStageConfiguration(
      this.level,
      this.minigameLocation
    ).startPos;
    this.cauldronLocation = getCauldronStageConfiguration(
      this.level,
      this.minigameLocation
    ).cauldronOffset;
    this.ingredientLocations = getCauldronStageConfiguration(
      this.level,
      this.minigameLocation
    ).ingredientLocations;
    this.ingredientList = [
      "apple",
      "butter",
      "candy",
      "chocolate_bar",
      "flour",
      "milk",
      "strawberry",
      "syrup"
    ];
    this.name = "Cauldron Minigame";
    this.type = MinigameTypes.CauldronMinigame;
    const idSeed = hashString32(this.id);
    const seed = (idSeed ^ Date.now() >>> 0) >>> 0;
    this._rng ?? (this._rng = createPRNG(seed));
    this.shuffle_ingredients();
    super.init();
    if (!this.isReload) {
      for (const playerId of this.playerIDList) {
        const player = world17.getEntity(playerId);
        if (player && player instanceof Player14) {
          if (!this.isReload) {
            try {
              player.runCommand(
                `replaceitem entity @s slot.hotbar 1 minecraft:spyglass 1 0 {"minecraft:item_lock":{"mode":"lock_in_slot"},"minecraft:keep_on_death":{}}`
              );
            } catch (e) {
              warn(
                `Failed to set or lock minigame menu item for ${player.nameTag}: ${e}`
              );
            }
          }
        }
      }
    }
    this.outOfBoundsTPLocation = this.startPos;
    this.outOfBoundsDistance = 45;
    if (!this.isReload) {
      system18.runTimeout(() => {
        this.countDown();
      }, 2);
    }
    if (!this.isReload) {
      try {
        this.loadStructure();
      } catch (e) {
        error(e);
        this.cleanup();
        return;
      }
    }
    system18.runTimeout(() => {
      this.setup_entities();
    }, 5);
  }
  shuffle_ingredients() {
    this.ingredientList = shuffleIngredientsEnsuringMove(this.ingredientList, this._rng);
    if (this.start_player_tick && this._timerTicks != this.timerStartTime) {
      for (const playerId of this.playerIDList) {
        const player = this.dimension.getPlayers().find((p) => p.id === playerId);
        if (!player)
          continue;
        player.onScreenDisplay.setTitle("Ingredients Switched!", {
          fadeInDuration: 10,
          stayDuration: 50,
          fadeOutDuration: 10,
          subtitle: "\xA77The ingredients have switched places"
        });
        player.playSound("mco_nom.shuffle_ingrediens" /* McoNomShuffleIngrediens */, { volume: 0.2 });
      }
    }
    this.clear_ingredients();
  }
  clear_ingredients() {
    for (const location of this.ingredientLocations) {
      const ingredientEntity = this.dimension.getEntities({
        location,
        families: ["ingredient"],
        maxDistance: 10,
        closest: 1
      })[0];
      if (ingredientEntity) {
        ingredientEntity.remove();
      }
    }
  }
  setup_entities() {
    this.cauldronEntity = this.dimension.getEntities({
      type: "mco_nom:cauldron",
      location: this.cauldronLocation,
      closest: 1
    })[0];
    if (!this.cauldronEntity) {
      warn("Unable to find cauldron entity.");
      this.cleanup();
      return;
    }
    this.recipeBubbleEntity = this.cauldronEntity.dimension.spawnEntity(
      "mco_nom:recipe_bubble",
      {
        x: this.cauldronEntity.location.x,
        y: this.cauldronEntity.location.y + 2.4,
        z: this.cauldronEntity.location.z + 0.5
      }
    );
    const entities = this.dimension.getEntities({ families: ["nom_minigame_entity"] });
    for (const entity of entities) {
      try {
        const dx = entity.location.x - this.startPos.x;
        const dy = entity.location.y - this.startPos.y;
        const dz = entity.location.z - this.startPos.z;
        const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
        if (distance <= this.outOfBoundsDistance) {
          entity.setDynamicProperty("mco_nom:minigame_id", this.id);
        }
      } catch (err) {
        warn(`Failed to assign minigame id to minigame entity: ${err}`);
      }
    }
    for (const playerId of this.playerIDList) {
      const player = this.dimension.getPlayers().find((p) => p.id === playerId);
      if (!player)
        continue;
      player.setDynamicProperty("mco_nom:recipe_count", 0);
      player.setDynamicProperty("mco_nom:star_count", 0);
      player.setDynamicProperty("mco_nom:given_ingredient");
      player.setDynamicProperty("mco_nom:current_recipe");
      player.setDynamicProperty("mco_nom:current_recipe_distribution");
      player.setDynamicProperty("mco_nom:given_ingredient");
      player.setDynamicProperty("mco_nom:ingredient_count_1", 0);
      player.setDynamicProperty("mco_nom:ingredient_count_2", 0);
      player.setDynamicProperty("mco_nom:ingredient_count_3", 0);
    }
  }
  tick() {
    super.tick();
    this.ingredient_tick();
    if (this._timerDirection === -1 && this._timerTicks <= 0 && !this._endFired) {
      this._endFired = true;
      this._timerDirection = 0;
      this.evaluate_goal();
    }
  }
  out_of_bounds_recover(player) {
    super.out_of_bounds_recover(player);
    player.runCommand(`replaceitem entity @s slot.hotbar 0 air`);
  }
  playPickupSound(player, target, ingredient) {
    const soundProps = {
      volume: 0.25,
      pitch: 0.9 + Math.random() * 0.2
    };
    let soundName = "";
    switch (ingredient) {
      case "mco_nom:syrup_ingredient":
        soundName = "mco_nom.pickup_syrup";
        break;
      case "mco_nom:butter_ingredient":
        soundName = "mco_nom.pickup_butter";
        break;
      case "mco_nom:chocolate_bar_ingredient":
        soundName = "mco_nom.pickup_chocolate_bar";
        break;
      case "mco_nom:apple_ingredient":
        soundName = "mco_nom.pickup_apple";
        break;
      case "mco_nom:strawberry_ingredient":
        soundName = "mco_nom.pickup_strawberry";
        break;
      case "mco_nom:milk_ingredient":
        soundName = "mco_nom.pickup_milk";
        break;
      case "mco_nom:candy_ingredient":
        soundName = "mco_nom.pickup_candy";
        break;
      case "mco_nom:flour_ingredient":
        soundName = "mco_nom.pickup_flour";
        break;
    }
    system18.runTimeout(() => {
      try {
        player.playSound(soundName, soundProps);
      } catch (error2) {
        target.dimension.playSound(soundName, target.location, soundProps);
        error(error2);
      }
    }, 2);
  }
  ingredient_tick() {
    if (this._timerTicks < 60 * 20 && !this.shuffledIngredients) {
      this.shuffle_ingredients();
      this.shuffledIngredients = true;
    }
    let location;
    for (let i = 0; i < this.ingredientLocations.length; i += 1) {
      location = this.ingredientLocations[i];
      const ingredient = `mco_nom:${this.ingredientList[i]}_ingredient`;
      const ingredientItem = `${ingredient}_item`;
      const ingredientEntity = this.dimension.getEntities({
        location,
        families: ["ingredient"],
        maxDistance: 10,
        closest: 1
      })[0];
      if (!ingredientEntity) {
        const entity = this.dimension.spawnEntity(ingredient, location);
        entity.setDynamicProperty("mco_nom:minigame_id", this.id);
      } else {
        const playerList = ingredientEntity.dimension.getPlayers({
          location: ingredientEntity.location,
          maxDistance: 2
        });
        for (const player of playerList) {
          const ingredientTime = player.getDynamicProperty(
            "mco_nom:ingredient_collect_time"
          ) ?? 0;
          if (Date.now() - ingredientTime >= 2e3) {
            if (isSameItemInHotbar(player, 0, ingredientItem)) {
              continue;
            }
            player.setDynamicProperty(
              "mco_nom:ingredient_collect_time",
              Date.now()
            );
            player.runCommand(
              `replaceitem entity @s slot.hotbar 0 ${ingredientItem} 1 0 {"minecraft:item_lock":{"mode":"lock_in_slot"}}`
            );
            player.selectedSlotIndex = 0;
            this.playPickupSound(player, ingredientEntity, ingredient);
            ingredientEntity.playAnimation("collect", {
              controller: "controller.animation.mco_nom.ingredient.collect",
              nextState: "animation.mco_nom.collectable.null",
              players: [player],
              stopExpression: "q.any_animation_finished"
            });
          }
        }
      }
    }
  }
  evaluate_goal() {
    this.timeExpired = true;
    const playerIds = [...this.playerIDList];
    if (this.globalRecipeCount >= this.recipeCount) {
      let winner = null;
      let maxCooks = 0;
      for (const playerId of playerIds) {
        const player = world17.getEntity(playerId);
        if (!player)
          continue;
        if (player instanceof Player14) {
          const starCount = player.getDynamicProperty("mco_nom:star_count") ?? 0;
          this.updatePlayerStarsCollected(player, starCount);
          const playerCooks = player.getDynamicProperty("mco_nom:recipe_count") ?? 0;
          if (playerCooks > maxCooks) {
            maxCooks = playerCooks;
            winner = player;
          }
          this.addScoreRecord(player, playerCooks);
          this.updatePersonalHighScore(
            player,
            playerCooks,
            this.isScoreBetter,
            this.scoreMessageFormatting
          );
        }
      }
      for (const playerId of playerIds) {
        const player = world17.getEntity(playerId);
        if (!player)
          continue;
        if (player instanceof Player14) {
          if (player === winner) {
            this.completed_minigame(player);
          } else {
            this.completed_minigame(player);
          }
        }
      }
    } else {
      for (const playerId of playerIds) {
        const player = world17.getEntity(playerId);
        if (!player)
          continue;
        if (player instanceof Player14) {
          this.lost_minigame(player);
        }
      }
    }
  }
  cleanup() {
    system18.runTimeout(() => {
      if (this.cauldronEntity) {
        try {
          this.cauldronEntity.remove();
        } catch (err) {
          try {
            warn(
              `Failed to remove cauldron entity: ${err}`
            );
          } catch {
          }
        }
      }
    }, 5);
    system18.runTimeout(() => {
      this.cleanArea(this.areaMin, this.areaMax);
    }, 10);
    super.cleanup();
  }
  stop() {
    world17.setDynamicProperty(`mco_nom:global_cooks_${this.id}`);
    super.stop();
  }
  player_tick(player) {
    super.player_tick(player);
    player.addEffect("speed", 80, { amplifier: 4, showParticles: false });
    player.addEffect("jump_boost", 80, { amplifier: 3, showParticles: false });
    player.addEffect("instant_health", 80, { amplifier: 50, showParticles: false });
    player.addEffect("saturation", 80, { amplifier: 50, showParticles: false });
    let checkpoint = player.getDynamicProperty("mco_nom:parkour_checkpoint");
    if (!this.checkpointInitialized && !this.isReload) {
      player.setDynamicProperty("mco_nom:parkour_checkpoint", this.startPos);
      checkpoint = this.startPos;
    }
    if (this.start_player_tick) {
      if (player.location.y < this.startPos.y - 5) {
        player.runCommand(`/camera @s fade time 0 0.2 0.2 color 0 0 0`);
        const pitch = 0.9 + Math.random() * 0.2;
        player.teleport(checkpoint);
        system18.runTimeout(() => {
          player.playSound("mco_nom.ui.loading_screen" /* McoNomUiLoadingScreen */, { pitch });
          player.playSound("mco_nom.minigame_teleport" /* McoNomMinigameTeleport */, {
            volume: 0.4,
            location: player.location,
            pitch
          });
        }, 5);
        player.runCommand(`replaceitem entity @s slot.hotbar 0 air`);
      }
    }
    const rawRecipe = player.getDynamicProperty("mco_nom:current_recipe");
    const rawDist = player.getDynamicProperty("mco_nom:current_recipe_distribution");
    if (typeof rawRecipe !== "number" || !Number.isInteger(rawRecipe) || rawRecipe < 0 || rawRecipe >= cauldronRecipes.length || typeof rawDist !== "number" || !Number.isInteger(rawDist) || rawDist < 0 || rawDist >= cauldronRecipeDistributions.length) {
      this.reset_recipe(player);
    } else {
      const recipe = cauldronRecipes[rawRecipe];
      const [count_a, count_b, count_c] = cauldronRecipeDistributions[rawDist];
      const [ingredient_a, ingredient_b, ingredient_c] = recipe.ingredients;
      const currentCount_a = player.getDynamicProperty("mco_nom:ingredient_count_1") ?? 0;
      const currentCount_b = player.getDynamicProperty("mco_nom:ingredient_count_2") ?? 0;
      const currentCount_c = player.getDynamicProperty("mco_nom:ingredient_count_3") ?? 0;
      const countDifference_a = Math.max(0, count_a - currentCount_a);
      const countDifference_b = Math.max(0, count_b - currentCount_b);
      const countDifference_c = Math.max(0, count_c - currentCount_c);
      if (!this.recipeBubbleEntity) {
        error("No recipe bubble entity");
        if (!this.cauldronEntity) {
          warn("Unable to find cauldron entity.");
          this.cleanup();
          return;
        } else {
          this.recipeBubbleEntity = this.cauldronEntity.dimension.spawnEntity(
            "mco_nom:recipe_bubble",
            {
              x: this.cauldronEntity.location.x,
              y: this.cauldronEntity.location.y + 2.4,
              z: this.cauldronEntity.location.z + 0.5
            }
          );
        }
      } else {
        this.recipeBubbleEntity.playAnimation(
          `animation.mco_nom.recipe_bubble.set_ingredient_1.${ingredient_a}`,
          {
            controller: "controller.animation.mco_nom.recipe_bubble.ingredient_1",
            nextState: "animation.mco_nom.collectable.null",
            players: [player],
            stopExpression: "q.any_animation_finished"
          }
        );
        this.recipeBubbleEntity.playAnimation(
          `animation.mco_nom.recipe_bubble.set_ingredient_2.${ingredient_b}`,
          {
            controller: "controller.animation.mco_nom.recipe_bubble.ingredient_2",
            nextState: "animation.mco_nom.collectable.null",
            players: [player],
            stopExpression: "q.any_animation_finished"
          }
        );
        this.recipeBubbleEntity.playAnimation(
          `animation.mco_nom.recipe_bubble.set_ingredient_3.${ingredient_c}`,
          {
            controller: "controller.animation.mco_nom.recipe_bubble.ingredient_3",
            nextState: "animation.mco_nom.collectable.null",
            players: [player],
            stopExpression: "q.any_animation_finished"
          }
        );
        this.recipeBubbleEntity.playAnimation(
          `animation.mco_nom.recipe_bubble.set_count_1.${countDifference_a}`,
          {
            controller: "controller.animation.mco_nom.recipe_bubble.ingredient_count_1",
            nextState: "animation.mco_nom.collectable.null",
            players: [player],
            stopExpression: "q.any_animation_finished"
          }
        );
        this.recipeBubbleEntity.playAnimation(
          `animation.mco_nom.recipe_bubble.set_count_2.${countDifference_b}`,
          {
            controller: "controller.animation.mco_nom.recipe_bubble.ingredient_count_2",
            nextState: "animation.mco_nom.collectable.null",
            players: [player],
            stopExpression: "q.any_animation_finished"
          }
        );
        this.recipeBubbleEntity.playAnimation(
          `animation.mco_nom.recipe_bubble.set_count_3.${countDifference_c}`,
          {
            controller: "controller.animation.mco_nom.recipe_bubble.ingredient_count_3",
            nextState: "animation.mco_nom.collectable.null",
            players: [player],
            stopExpression: "q.any_animation_finished"
          }
        );
      }
      if (countDifference_a == 0 && countDifference_b == 0 && countDifference_c == 0) {
        this.reset_recipe(player);
      }
    }
    const givenIngredient = player.getDynamicProperty("mco_nom:given_ingredient");
    if (givenIngredient) {
      this.gave_ingredient(player, givenIngredient);
      player.setDynamicProperty("mco_nom:given_ingredient");
    } else if (player.dimension.getEntities({
      type: "mco_nom:cauldron",
      location: player.location,
      maxDistance: 3
    }).length > 0) {
      try {
        const inventory = player.getComponent("inventory");
        if (!inventory)
          return false;
        const container = inventory.container;
        if (!container)
          return false;
        const item = container.getItem(0);
        if (!item)
          return false;
        if (item.hasTag("mco_nom:ingredient")) {
          const type = item.typeId.replace("mco_nom:", "").replace("_ingredient_item", "");
          this.gave_ingredient(player, type);
        }
      } catch (err) {
      }
    }
  }
  // reset_recipe(player) {
  //     player.setDynamicProperty(
  //         'mco_nom:current_recipe',
  //         Math.floor(Math.random() * cauldronRecipes.length)
  //     );
  //     player.setDynamicProperty(
  //         'mco_nom:current_recipe_distribution',
  //         Math.floor(Math.random() * cauldronRecipeDistributions.length)
  //     );
  //     player.setDynamicProperty('mco_nom:ingredient_count_1', 0);
  //     player.setDynamicProperty('mco_nom:ingredient_count_2', 0);
  //     player.setDynamicProperty('mco_nom:ingredient_count_3', 0);
  // }
  reset_recipe(player) {
    const prevRecipe = player.getDynamicProperty("mco_nom:current_recipe");
    const prevDist = player.getDynamicProperty("mco_nom:current_recipe_distribution");
    const { recipeIdx, distIdx } = nextRecipeAndDistribution(
      prevRecipe,
      prevDist,
      cauldronRecipes.length,
      cauldronRecipeDistributions.length,
      this._rng
    );
    player.setDynamicProperty("mco_nom:current_recipe", recipeIdx);
    player.setDynamicProperty("mco_nom:current_recipe_distribution", distIdx);
    player.setDynamicProperty("mco_nom:ingredient_count_1", 0);
    player.setDynamicProperty("mco_nom:ingredient_count_2", 0);
    player.setDynamicProperty("mco_nom:ingredient_count_3", 0);
  }
  gave_ingredient(player, givenIngredient) {
    if (player.getDynamicProperty("mco_nom:gave_ingredient"))
      return;
    player.setDynamicProperty("mco_nom:gave_ingredient", true);
    system18.runTimeout(() => player.setDynamicProperty("mco_nom:gave_ingredient"), 5);
    const rawRecipe = player.getDynamicProperty("mco_nom:current_recipe");
    const rawDist = player.getDynamicProperty("mco_nom:current_recipe_distribution");
    if (typeof rawRecipe !== "number" || !Number.isInteger(rawRecipe) || rawRecipe < 0 || rawRecipe >= cauldronRecipes.length || typeof rawDist !== "number" || !Number.isInteger(rawDist) || rawDist < 0 || rawDist >= cauldronRecipeDistributions.length) {
      this.reset_recipe(player);
      return;
    }
    const recipe = cauldronRecipes[rawRecipe];
    const [count_a, count_b, count_c] = cauldronRecipeDistributions[rawDist];
    const [ingredient_a, ingredient_b, ingredient_c] = recipe.ingredients;
    const currentCount_a = player.getDynamicProperty("mco_nom:ingredient_count_1") ?? 0;
    const currentCount_b = player.getDynamicProperty("mco_nom:ingredient_count_2") ?? 0;
    const currentCount_c = player.getDynamicProperty("mco_nom:ingredient_count_3") ?? 0;
    let goodResult = true;
    let recipeCompleted = false;
    if (givenIngredient === ingredient_a) {
      if (count_a > currentCount_a) {
        player.setDynamicProperty("mco_nom:ingredient_count_1", currentCount_a + 1);
        if (count_a <= currentCount_a + 1 && count_b <= currentCount_b && count_c <= currentCount_c) {
          recipeCompleted = true;
        }
      } else
        goodResult = false;
    } else if (givenIngredient === ingredient_b) {
      if (count_b > currentCount_b) {
        player.setDynamicProperty("mco_nom:ingredient_count_2", currentCount_b + 1);
        if (count_a <= currentCount_a && count_b <= currentCount_b + 1 && count_c <= currentCount_c) {
          recipeCompleted = true;
        }
      } else
        goodResult = false;
    } else if (givenIngredient === ingredient_c) {
      if (count_c > currentCount_c) {
        player.setDynamicProperty("mco_nom:ingredient_count_3", currentCount_c + 1);
        if (count_a <= currentCount_a && count_b <= currentCount_b && count_c <= currentCount_c + 1) {
          recipeCompleted = true;
        }
      } else
        goodResult = false;
    } else {
      goodResult = false;
    }
    this.cauldronEntity?.playAnimation(
      `animation.mco_nom.cauldron.set_recipe.${recipe.result}`,
      {
        controller: "controller.animation.mco_nom.cauldron.recipe_signal",
        nextState: "animation.mco_nom.collectable.null",
        players: [player],
        stopExpression: "q.any_animation_finished"
      }
    );
    if (recipeCompleted) {
      player.playSound("mco_nom.cauldron_accept" /* McoNomCauldronAccept */, {
        volume: 0.3,
        pitch: 0.9 + Math.random() * 0.2,
        location: this.cauldronEntity?.location
      });
      player.playSound("mco_nom.recipe_finished" /* McoNomRecipeFinished */, { volume: 0.25 });
      this.cauldronEntity?.playAnimation(
        `animation.mco_nom.cauldron.state.completed_recipe`,
        {
          controller: "controller.animation.mco_nom.cauldron.ingredient_signal",
          nextState: "animation.mco_nom.collectable.null",
          players: [player],
          stopExpression: "q.any_animation_finished"
        }
      );
      const recipeCount = player.getDynamicProperty("mco_nom:recipe_count") ?? 0;
      this.globalRecipeCount += 1;
      world17.setDynamicProperty(`mco_nom:global_cooks_${this.id}`, this.globalRecipeCount);
      player.setDynamicProperty("mco_nom:recipe_count", recipeCount + 1);
      if (recipeCount + 1 > this.topScore) {
        this.topCook = player.nameTag;
        this.topScore = recipeCount + 1;
      }
    } else if (goodResult) {
      player.playSound("mco_nom.cauldron_accept" /* McoNomCauldronAccept */, { volume: 0.4, pitch: 0.9 + Math.random() * 0.2, location: this.cauldronEntity?.location });
      this.cauldronEntity?.playAnimation(`animation.mco_nom.cauldron.state.happy`, {
        controller: "controller.animation.mco_nom.cauldron.ingredient_signal",
        nextState: "animation.mco_nom.collectable.null",
        players: [player],
        stopExpression: "q.any_animation_finished"
      });
    } else {
      player.playSound("mco_nom.cauldron_accept" /* McoNomCauldronAccept */, {
        volume: 0.4,
        pitch: 0.9 + Math.random() * 0.2,
        location: this.cauldronEntity?.location
      });
      this.cauldronEntity?.playAnimation(`animation.mco_nom.cauldron.state.sad`, {
        controller: "controller.animation.mco_nom.cauldron.ingredient_signal",
        nextState: "animation.mco_nom.collectable.null",
        players: [player],
        stopExpression: "q.any_animation_finished"
      });
    }
    player.runCommand(`replaceitem entity @s slot.hotbar 0 air`);
  }
  _updateActionBar(totalSeconds) {
    const timeString = formatSeconds(totalSeconds);
    for (const playerId of this.playerIDList) {
      const player = world17.getEntity(playerId);
      if (!player)
        continue;
      if (player instanceof Player14) {
        if (this._completedPlayers.has(player.id))
          continue;
        const personalCookCount = player.getDynamicProperty("mco_nom:recipe_count") ?? 0;
        let parsedData = null;
        try {
          const raw = String(
            world17.getDynamicProperty("mco_nom:minigame_data") ?? "null"
          );
          parsedData = JSON.parse(raw);
        } catch {
          parsedData = null;
        }
        const topCookString = this.topCook ? `\xA7r\xA77Top Cook:\xA7r \xA7l${this.topCook ?? ""}\xA7r \xA77| ` : "";
        const text = `${topCookString}\xA77\xA77${timeString}\xA7r \xA77| \xA77Recipes:\xA7r \xA7e\xA7l${personalCookCount}\xA7r \xA77| Total: \xA7r\xA7l\xA7c${this.globalRecipeCount}/${this.recipeCount}`;
        this._actionBar.queueMinigameStatus(player, text);
      }
    }
  }
};
function isSameItemInHotbar(player, slot, itemId) {
  try {
    const inventory = player.getComponent("inventory");
    if (!inventory)
      return false;
    const container = inventory.container;
    if (!container)
      return false;
    const item = container.getItem(slot);
    if (!item)
      return false;
    return item.typeId === itemId;
  } catch (err) {
    return false;
  }
}

// data/gametests/src/systems/Minigame/SpiderDefenseMinigame.ts
import { world as world19, system as system20, Player as Player15, ItemStack as ItemStack7, EntityDamageCause, ItemLockMode } from "@minecraft/server";

// data/gametests/src/mobs/MagicSpiderBoss.ts
import { system as system19, world as world18 } from "@minecraft/server";
var logger = Logger.getLogger("MagicSpiderBoss");
var MagicSpiderBoss = class _MagicSpiderBoss {
  constructor() {
    this.isTeleporting = false;
    this.lastTeleportTime = 0;
    this.TELEPORT_COOLDOWN = 200;
    this.setUpEventListeners();
  }
  static getInstance() {
    if (!_MagicSpiderBoss.instance) {
      _MagicSpiderBoss.instance = new _MagicSpiderBoss();
    }
    return _MagicSpiderBoss.instance;
  }
  setCenterLocation(center) {
    this.centerLocation = center;
  }
  setUpEventListeners() {
    world18.afterEvents.entityHurt.subscribe((e) => {
      if (e.hurtEntity.typeId === "mco_nom:magic_spider") {
        this.handleHurt(e.hurtEntity);
      }
    });
  }
  handleHurt(entity) {
    const currentTick = system19.currentTick;
    if (this.lastTeleportTime > 0 && currentTick - this.lastTeleportTime < this.TELEPORT_COOLDOWN) {
      return;
    }
    if (this.isTeleporting) {
      return;
    }
    this.isTeleporting = true;
    system19.runTimeout(() => {
      this.performTeleport(entity);
    }, 20);
  }
  performTeleport(entity) {
    if (!this.centerLocation) {
      warn("Center location not set for Magic Spider teleport");
      this.isTeleporting = false;
      return;
    }
    entity.dimension.spawnParticle("mco_nom:generic_poof", entity.location);
    entity.dimension.spawnParticle("mco_nom:generic_poof2", entity.location);
    const angle = Math.random() * 2 * Math.PI;
    const distance = Math.random() * 16;
    const targetX = this.centerLocation.x + Math.cos(angle) * distance;
    const targetZ = this.centerLocation.z + Math.sin(angle) * distance;
    const dimension = entity.dimension;
    const topBlock = dimension.getTopmostBlock({ x: targetX, z: targetZ });
    if (!topBlock) {
      warn("Could not find topmost block for Magic Spider teleport");
      this.isTeleporting = false;
      return;
    }
    const teleportLocation = {
      x: targetX,
      y: topBlock.location.y + 2,
      z: targetZ
    };
    entity.teleport(teleportLocation);
    this.lastTeleportTime = system19.currentTick;
    entity.playAnimation("vanish");
    system19.runTimeout(() => {
      this.isTeleporting = false;
    }, 20);
    info(`Magic Spider teleported to: ${teleportLocation.x}, ${teleportLocation.y}, ${teleportLocation.z}`);
  }
};
var magicSpiderBoss = MagicSpiderBoss.getInstance();

// data/gametests/src/systems/Minigame/SpiderDefenseMinigame.ts
var log12 = Logger.getLogger("Spider Defense Minigame");
var CENTER_RADIUS = 25;
var SPAWN_DISTANCE = 20;
var SpiderDefenseMinigame = class extends Minigame {
  constructor() {
    super(...arguments);
    this.currentWave = 0;
    this.enemiesRemaining = 0;
    this.playerKills = /* @__PURE__ */ new Map();
    this.spawnedEnemies = /* @__PURE__ */ new Set();
    this.waveCooldown = false;
    this.gameEnded = false;
    this.introSpawningComplete = false;
    // Track if intro spider spawning is complete
    this.gameStartTime = 0;
    // Global game timer start time
    this.waveEndTime = 0;
    // When the current wave should end
    this.globalTimer = 0;
    // Interval for global timer
    this.playerKillStreaks = /* @__PURE__ */ new Map();
    // Track player kill streaks
    this.playerLastKillTime = /* @__PURE__ */ new Map();
    // Track last kill time for streaks
    this.waveTimeRemaining = 0;
    this.score = 100;
  }
  init() {
    info("Initializing Spider Defense Minigame");
    this.waveConfigurations = [
      [
        {
          duration: 30,
          spawnRate: 0.25,
          mobWeights: {
            grunt: { level: 1, weight: 100 },
            speedy: { level: 1, weight: 0 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 35,
          spawnRate: 0.4,
          mobWeights: {
            grunt: { level: 2, weight: 70 },
            speedy: { level: 1, weight: 30 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 2e3,
          spawnRate: 0.5,
          mobWeights: {
            grunt: { level: 1, weight: 25 },
            speedy: { level: 1, weight: 25 },
            bulky: { level: 1, weight: 30 }
          }
        }
      ],
      [
        {
          duration: 30,
          spawnRate: 0.35,
          mobWeights: {
            grunt: { level: 1, weight: 100 },
            speedy: { level: 1, weight: 0 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 35,
          spawnRate: 0.45,
          mobWeights: {
            grunt: { level: 2, weight: 70 },
            speedy: { level: 1, weight: 30 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 40,
          spawnRate: 0.5,
          mobWeights: {
            grunt: { level: 2, weight: 50 },
            speedy: { level: 1, weight: 40 },
            bulky: { level: 1, weight: 10 }
          }
        },
        {
          duration: 2e3,
          spawnRate: 0.55,
          mobWeights: {
            grunt: { level: 2, weight: 25 },
            speedy: { level: 2, weight: 25 },
            bulky: { level: 2, weight: 30 }
          }
        }
      ],
      [
        {
          duration: 30,
          spawnRate: 0.35,
          mobWeights: {
            grunt: { level: 1, weight: 100 },
            speedy: { level: 1, weight: 0 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 35,
          spawnRate: 0.45,
          mobWeights: {
            grunt: { level: 2, weight: 70 },
            speedy: { level: 1, weight: 30 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 40,
          spawnRate: 0.5,
          mobWeights: {
            grunt: { level: 2, weight: 50 },
            speedy: { level: 1, weight: 40 },
            bulky: { level: 1, weight: 10 }
          }
        },
        {
          duration: 50,
          spawnRate: 0.55,
          mobWeights: {
            grunt: { level: 3, weight: 45 },
            speedy: { level: 2, weight: 35 },
            bulky: { level: 1, weight: 20 }
          }
        },
        {
          duration: 2e3,
          spawnRate: 0.6,
          mobWeights: {
            grunt: { level: 3, weight: 25 },
            speedy: { level: 3, weight: 25 },
            bulky: { level: 3, weight: 30 }
          }
        }
      ],
      [
        {
          duration: 50,
          spawnRate: 0.7,
          mobWeights: {
            grunt: { level: 3, weight: 100 },
            speedy: { level: 1, weight: 0 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 50,
          spawnRate: 0.7,
          mobWeights: {
            grunt: { level: 1, weight: 0 },
            speedy: { level: 3, weight: 100 },
            bulky: { level: 1, weight: 0 }
          }
        },
        {
          duration: 50,
          spawnRate: 0.7,
          mobWeights: {
            grunt: { level: 1, weight: 0 },
            speedy: { level: 1, weight: 0 },
            bulky: { level: 3, weight: 100 }
          }
        },
        {
          duration: 2e3,
          spawnRate: 0.7,
          mobWeights: {
            grunt: { level: 3, weight: 30 },
            speedy: { level: 3, weight: 30 },
            bulky: { level: 3, weight: 30 }
          }
        }
      ]
    ];
    this.musicTrackName = "mco_nom.music.competitive" /* McoNomMusicCompetitive */;
    this.name = "Magic Spider Swarm Defense";
    this.type = MinigameTypes.SpiderDefenseMinigame;
    this.waveData = this.waveConfigurations[this.level - 1];
    this.spawnPos = {
      x: this.origin.x,
      y: this.getTopYLoc(this.origin.x, this.origin.z + 5) + 3,
      z: this.origin.z + 5
    };
    this.outOfBoundsTPLocation = this.origin;
    this.outOfBoundsDistance = CENTER_RADIUS;
    super.init();
    if (!this.isReload) {
      this.setupEntities();
      this.setupDeathTracking();
      this.startGlobalTimer();
      this.countDown(() => {
        this.startWave(1);
      });
    }
  }
  setupEntities() {
    this.jumboCandy = this.dimension.spawnEntity("mco_nom:jumbo_candy" /* JumboCandy */, { x: this.origin.x + 1, y: this.origin.y, z: this.origin.z });
    this.jumboCandy.setDynamicProperty("mco_nom:minigame_id", this.id);
    for (const playerId of this.playerIDList) {
      const player = world19.getEntity(playerId);
      if (player) {
        system20.runTimeout(() => {
          const itemStack = new ItemStack7("mco_nom:candy_sword_alt" /* CandySwordAlt */, 1);
          itemStack.keepOnDeath = true;
          itemStack.lockMode = ItemLockMode.slot;
          const inventory = player.getComponent("minecraft:inventory");
          if (inventory && inventory.container) {
            inventory.container.setItem(0, itemStack);
          }
        }, 80);
        system20.runTimeout(() => {
          player.teleport(
            this.spawnPos,
            {
              facingLocation: {
                x: this.origin.x,
                y: this.getTopYLoc(this.origin.x, this.origin.z + 15) + 1,
                z: this.origin.z + 15
              }
            }
          );
        }, 10);
      }
    }
  }
  tick() {
    super.tick();
    if (this.jumboCandy && this.jumboCandy.isValid) {
      this.score = this.jumboCandy.getComponent("health")?.currentValue;
    }
    world19.setDynamicProperty(`mco_nom:defense_minigame_wave_${this.id}`, this.currentWave);
    world19.setDynamicProperty(`mco_nom:defense_minigame_hp_${this.id}`, this.score);
    for (const playerId of this.playerIDList) {
      try {
        const player = world19.getEntity(playerId);
        if (player) {
          player.setDynamicProperty(`mco_nom:defense_minigame_kill_count`, this.playerKills.get(playerId));
        }
      } catch (err) {
        warn(`Score update error: ${err}`);
      }
    }
    this.boss_out_of_bounds_check();
  }
  setupDeathTracking() {
    world19.afterEvents.playerSpawn.subscribe((event) => {
      if (this.playerIDList.includes(event.player.id) && !this.gameEnded) {
        event.player.teleport(this.spawnPos);
      }
    });
    world19.afterEvents.entityDie.subscribe((event) => {
      const entity = event.deadEntity;
      if (entity && this.spawnedEnemies.has(entity.id)) {
        this.spawnedEnemies.delete(entity.id);
        this.enemiesRemaining = Math.max(0, this.enemiesRemaining - 1);
        info(`Enemy died. Remaining: ${this.enemiesRemaining}`);
        if (this.currentWave === this.waveData.length && this.bossEntity && entity.id === this.bossEntity.id) {
          info("Magic Spider Boss defeated! Triggering victory.");
          this.victory();
          return;
        }
      }
    });
    system20.afterEvents.scriptEventReceive.subscribe((event) => {
      if (event.id === "mco_nom:kill_count") {
        const player = event.sourceEntity;
        if (player && player.id && this.playerIDList.includes(player.id)) {
          this.trackPlayerKill(player);
        }
      }
    });
    world19.afterEvents.entityRemove.subscribe((event) => {
      if (this.spawnedEnemies.has(event.removedEntityId)) {
        this.spawnedEnemies.delete(event.removedEntityId);
        this.enemiesRemaining = Math.max(0, this.enemiesRemaining - 1);
        info(`Enemy removed. Remaining: ${this.enemiesRemaining}`);
        if (this.currentWave === this.waveData.length && this.bossEntity && event.removedEntityId === this.bossEntity.id) {
          info("Magic Spider Boss removed! Triggering victory.");
          this.victory();
          return;
        }
      }
    });
  }
  startGlobalTimer() {
    this.gameStartTime = system20.currentTick;
    this.globalTimer = 0;
    this.globalTimerInterval = system20.runInterval(() => {
      this.globalTimer = this.globalTimer + 10;
      this.updateActionBar();
      this.checkAndTeleportStuckSpiders();
    }, 10);
  }
  trackPlayerKill(damageSource) {
    const currentTime = system20.currentTick;
    if (damageSource && damageSource.id && this.playerIDList.includes(damageSource.id)) {
      const playerId = damageSource.id;
      const currentKills = this.playerKills.get(playerId) || 0;
      this.playerKills.set(playerId, currentKills + 1);
      const lastKillTime = this.playerLastKillTime.get(playerId) || 0;
      let newStreak = 1;
      if (currentTime - lastKillTime <= 100) {
        const currentStreak = this.playerKillStreaks.get(playerId) || 0;
        newStreak = currentStreak + 1;
        this.playerKillStreaks.set(playerId, newStreak);
      } else {
        this.playerKillStreaks.set(playerId, 0);
        newStreak = 1;
        this.playerKillStreaks.set(playerId, newStreak);
      }
      if (newStreak > 0 && newStreak % 10 === 0) {
        const player = world19.getEntity(playerId);
        if (player) {
          this.applyRandomMilestoneEffect(player);
          this.knockbackWave();
        }
      }
      this.playerLastKillTime.set(playerId, currentTime);
    }
  }
  knockbackWave() {
    this.dimension.spawnParticle("minecraft:knockback_roar_particle", this.jumboCandy.location);
    this.dimension.getEntities({
      location: this.jumboCandy.location,
      maxDistance: 10,
      families: ["spider"]
    }).forEach((e) => {
      e.applyDamage(5, {
        cause: EntityDamageCause.entityAttack
      });
      e.applyKnockback(
        {
          x: (e.location.x - this.jumboCandy.location.x) * 2.5,
          z: (e.location.z - this.jumboCandy.location.z) * 2.5
        },
        0.5
      );
    });
  }
  getTopYLoc(x, z) {
    const topBlock = this.dimension.getTopmostBlock({ x: this.origin.x, z: this.origin.z + 15 });
    const spawnY = topBlock ? topBlock.location.y + 2 : this.origin.y + 2;
    return spawnY;
  }
  startWave(waveNumber) {
    info(`Starting wave ${waveNumber}`);
    this.waveEndTime = 0;
    this.spawnedEnemies.clear();
    this.introSpawningComplete = false;
    if (waveNumber > this.waveData.length) {
      info("All waves completed, triggering victory");
      this.victory();
      return;
    }
    this.currentWave = waveNumber;
    const waveData = this.waveData[waveNumber - 1];
    this.showWaveTitle(waveNumber);
    if (waveNumber <= this.waveData.length - 1) {
      this.waveIntro();
    } else if (waveNumber === this.waveData.length) {
      this.spawnBossWave();
    } else {
      this.startWaveTimer(waveData);
    }
  }
  waveIntro() {
    if (this.magicSpider && this.magicSpider.isValid) {
      info("Removing existing magic spider before spawning new one");
      try {
        this.magicSpider.remove();
      } catch (e) {
        warn("Failed to remove existing magic spider:", e);
      }
    }
    const spiderPos = {
      x: this.origin.x,
      y: this.getTopYLoc(this.origin.x, this.origin.z + 15),
      z: this.origin.z + 15
    };
    this.magicSpider = this.dimension.spawnEntity("mco_nom:magic_spider", spiderPos, {
      spawnEvent: "mco_nom:spawn_intro"
    });
    this.magicSpider.setDynamicProperty("mco_nom:minigame_id", this.id);
    this.magicSpider.teleport(this.magicSpider.location, { facingLocation: this.origin });
    if (this.currentWave === this.waveData.length) {
      const magicSpiderBoss2 = MagicSpiderBoss.getInstance();
      magicSpiderBoss2.setCenterLocation(this.origin);
    }
    system20.runTimeout(() => {
      if (!this.magicSpider)
        return;
      info(`Magic Spider summoning 2 spiders for wave ${this.currentWave} intro`);
      for (let i = 0; i < 2; i++) {
        system20.runTimeout(() => {
          const spawnPos = {
            x: this.magicSpider.location.x + (Math.random() * 2 - 1),
            y: this.getTopYLoc(this.magicSpider.location.x, this.magicSpider.location.z + (Math.random() * 2 - 1)),
            z: this.magicSpider.location.z + (Math.random() * 2 - 1)
          };
          const spawnedEntity = this.dimension.spawnEntity("mco_nom:spider_grunt" /* SpiderGrunt */, spawnPos, {
            spawnEvent: "mco_nom:level_1"
          });
          if (spawnedEntity) {
            spawnedEntity.addEffect(MinecraftEffectTypes.Slowness, 180, { amplifier: 255, showParticles: false });
            this.spawnedEnemies.add(spawnedEntity.id);
            spawnedEntity.setDynamicProperty("mco_nom:minigame_id", this.id);
            this.enemiesRemaining++;
            info(`Summoned spider ${i + 1}/2 spawned during Magic Spider intro. Total enemies: ${this.enemiesRemaining}`);
          }
        }, Math.floor(Math.random() * 10) + 30);
      }
    }, 60);
    system20.runTimeout(() => {
      if (!this.magicSpider)
        return;
      this.magicSpider.remove();
      info(`Wave ${this.currentWave} intro completed, starting wave timer. Intro spiders remaining: ${this.enemiesRemaining}`);
      system20.runTimeout(() => {
        this.introSpawningComplete = true;
        info(`Intro spawning marked complete for wave ${this.currentWave}`);
      }, 50);
      const waveData = this.waveData[this.currentWave - 1];
      this.startWaveTimer(waveData);
    }, 280);
  }
  spawnBossWave() {
    info("Spawning Magic Spider Boss for wave 6");
    if (this.bossEntity && this.bossEntity.isValid) {
      info("Removing existing boss entity before spawning new one");
      try {
        this.bossEntity.remove();
      } catch (e) {
        warn("Failed to remove existing boss entity:", e);
      }
    }
    const bossPos = {
      x: this.origin.x,
      y: this.getTopYLoc(this.origin.x, this.origin.z + 15),
      z: this.origin.z + 15
    };
    this.bossEntity = this.dimension.spawnEntity("mco_nom:magic_spider", bossPos, {
      spawnEvent: "mco_nom:spawn_boss"
    });
    if (this.bossEntity) {
      const magicSpiderBoss2 = MagicSpiderBoss.getInstance();
      magicSpiderBoss2.setCenterLocation(this.origin);
      this.bossEntity.setDynamicProperty("mco_nom:minigame_id", this.id);
      this.spawnedEnemies.add(this.bossEntity.id);
      this.enemiesRemaining++;
      info(`Magic Spider Boss spawned with ID: ${this.bossEntity.id}`);
      const waveData = this.waveData[this.currentWave - 1];
      this.startWaveTimer(waveData);
    } else {
      error("Failed to spawn Magic Spider Boss");
    }
  }
  startWaveTimer(waveData) {
    this.waveEndTime = this.globalTimer + waveData.duration * 20;
    this.waveCooldown = false;
    info(`Starting wave ${this.currentWave} timer - will end at tick ${this.waveEndTime} (${waveData.duration}s from now)`);
    const baseSpawnRate = waveData.spawnRate;
    const playerCount = this.playerIDList.length;
    const actualSpawnRate = baseSpawnRate + playerCount * 0.2;
    this.spawnInterval = system20.runInterval(() => {
      const activeMinigameList = getRunningMinigames();
      const minigameActive = activeMinigameList.includes(this.id);
      if (!minigameActive && this.spawnInterval) {
        system20.clearRun(this.spawnInterval);
        return;
      }
      this.spawnEnemies(waveData);
    }, Math.max(1, Math.floor(20 / actualSpawnRate)));
    let enemiesHaveSpawned = false;
    let spawnIntervalCleared = false;
    system20.runInterval(() => {
      const currentTime = this.globalTimer;
      const timeRemaining = Math.max(0, Math.floor((this.waveEndTime - currentTime) / 20));
      if (this.currentWave !== this.waveData.length) {
        if (timeRemaining <= 0 && !spawnIntervalCleared) {
          if (this.spawnInterval) {
            this.spawnInterval = void 0;
            spawnIntervalCleared = true;
          }
          enemiesHaveSpawned = true;
          info(`Wave ${this.currentWave} spawning stopped. Total enemies: ${this.enemiesRemaining}`);
        }
      }
      if (this.currentWave !== this.waveData.length) {
        if (timeRemaining <= 0 && enemiesHaveSpawned && this.enemiesRemaining === 0 && this.introSpawningComplete) {
          info(`Wave ${this.currentWave} ending - Timer ended and all enemies defeated. Time remaining: ${timeRemaining}, Enemies: ${this.enemiesRemaining}, Spawned: ${enemiesHaveSpawned}, IntroComplete: ${this.introSpawningComplete}`);
          this.endWave();
        }
      }
    }, 20);
  }
  spawnEnemies(waveData) {
    if (this.currentWave !== this.waveData.length) {
      const currentTime = this.globalTimer;
      const timeRemaining = Math.max(0, Math.floor((this.waveEndTime - currentTime) / 20));
      if (timeRemaining <= 0)
        return;
    }
    const angle = Math.random() * 2 * Math.PI;
    const baseX = this.origin.x + Math.cos(angle) * SPAWN_DISTANCE;
    const baseZ = this.origin.z + Math.sin(angle) * SPAWN_DISTANCE;
    const spawnPos = {
      x: baseX,
      y: this.getTopYLoc(baseX, baseZ) + 2,
      z: baseZ
    };
    const totalWeight = waveData.mobWeights.grunt.weight + waveData.mobWeights.speedy.weight + waveData.mobWeights.bulky.weight;
    const random = Math.random() * totalWeight;
    let selectedMob = "grunt";
    let cumulativeWeight = waveData.mobWeights.grunt.weight;
    if (random > cumulativeWeight) {
      selectedMob = "speedy";
      cumulativeWeight += waveData.mobWeights.speedy.weight;
      if (random > cumulativeWeight) {
        selectedMob = "bulky";
      }
    }
    let entityType = "mco_nom:spider_grunt" /* SpiderGrunt */;
    let level = 1;
    switch (selectedMob) {
      case "grunt":
        entityType = "mco_nom:spider_grunt" /* SpiderGrunt */;
        level = waveData.mobWeights.grunt.level;
        break;
      case "speedy":
        entityType = "mco_nom:spider_speedy" /* SpiderSpeedy */;
        level = waveData.mobWeights.speedy.level;
        break;
      case "bulky":
        entityType = "mco_nom:spider_bulky" /* SpiderBulky */;
        level = waveData.mobWeights.bulky.level;
        break;
    }
    const spawnedEntity = this.dimension.spawnEntity(entityType, spawnPos, {
      spawnEvent: `mco_nom:level_${level}`
    });
    if (spawnedEntity) {
      this.spawnedEnemies.add(spawnedEntity.id);
      spawnedEntity.setDynamicProperty("mco_nom:minigame_id", this.id);
    }
    this.enemiesRemaining++;
  }
  endWave() {
    if (this.waveCooldown) {
      info(`Wave ${this.currentWave} already ending, ignoring duplicate call`);
      return;
    }
    info(`Ending wave ${this.currentWave}`);
    if (this.spawnInterval) {
      system20.clearRun(this.spawnInterval);
      this.spawnInterval = void 0;
    }
    if (this.enemiesRemaining === 0) {
      info("All enemies defeated, starting cooldown");
      this.waveCooldown = true;
      system20.runTimeout(() => {
        this.waveCooldown = false;
        const nextWave = this.currentWave + 1;
        info(`Starting next wave: ${nextWave}`);
        this.startWave(nextWave);
      }, 100);
    } else {
      info(`Waiting for ${this.enemiesRemaining} enemies to be defeated`);
      this.waveCooldown = true;
      system20.runTimeout(() => {
        this.checkWaveCompletion();
      }, 20);
    }
  }
  checkWaveCompletion() {
    info(`Wave ${this.currentWave} - Remaining enemies: ${this.enemiesRemaining}`);
    if (this.enemiesRemaining === 0) {
      this.waveCooldown = false;
      const nextWave = this.currentWave + 1;
      info(`Wave ${this.currentWave} completed, starting wave ${nextWave}`);
      this.startWave(nextWave);
    } else {
      system20.runTimeout(() => {
        this.updateActionBar();
        this.checkWaveCompletion();
      }, 20);
    }
  }
  showWaveTitle(waveNumber) {
    const title = waveNumber === this.waveData.length ? "\xA7c\xA7lFINAL WAVE" : `\xA7e\xA7lWave ${waveNumber}`;
    for (const playerId of this.playerIDList) {
      const player = world19.getEntity(playerId);
      if (player) {
        player.onScreenDisplay.setTitle(title, {
          fadeInDuration: 10,
          stayDuration: 40,
          fadeOutDuration: 10
        });
      }
    }
  }
  updateActionBar() {
    for (const playerId of this.playerIDList) {
      const player = world19.getEntity(playerId);
      if (player && player instanceof Player15) {
        if (this._completedPlayers.has(player.id))
          continue;
        const playerKills = this.playerKills.get(playerId) || 0;
        const currentTime = system20.currentTick;
        const lastKillTime = this.playerLastKillTime.get(playerId) || 0;
        let playerStreak = this.playerKillStreaks.get(playerId) || 0;
        if (playerStreak > 0 && currentTime - lastKillTime > 100) {
          this.playerKillStreaks.set(playerId, 0);
          playerStreak = 0;
        }
        const totalSeconds = Math.floor(this.globalTimer / 20);
        const timeString = this.formatTime(totalSeconds);
        const hpDisplay = `\xA7aCandy HP: ${this.jumboCandy?.getComponent("health")?.currentValue ?? 0}`;
        let displayText;
        if (this.waveCooldown) {
          if (this.currentWave === this.waveData.length && this.enemiesRemaining === 0) {
            displayText = `\xA7bWave ${this.currentWave} \xA7f| \xA7aBOSS DEFEATED! \xA7f| \xA7eTime: ${timeString}`;
          } else {
            const mobText = this.enemiesRemaining === 1 ? "Spider Left" : "Spiders Left";
            if (this.enemiesRemaining > 0) {
              displayText = `\xA7bWave ${this.currentWave} \xA7f| \xA7a${this.enemiesRemaining} ${mobText} \xA7f| \xA7eTime: ${timeString}`;
            } else {
              displayText = `\xA7bWave ${this.currentWave} \xA7f| \xA7a-- ${mobText} \xA7f| \xA7eTime: ${timeString}`;
            }
          }
        } else {
          if (this.currentWave === this.waveData.length) {
            displayText = `\xA7bWave ${this.currentWave} \xA7f| \xA7cBOSS FIGHT \xA7f| \xA7aKills: ${playerKills} \xA7f| ${hpDisplay} \xA7f| \xA7eTime: ${timeString}`;
          } else {
            if (this.waveEndTime > 0) {
              this.waveTimeRemaining = Math.max(0, Math.floor((this.waveEndTime - this.globalTimer) / 20));
              if (this.waveTimeRemaining <= 1) {
                const mobText = this.enemiesRemaining === 1 ? "Mob Remaining" : "Mobs Remaining";
                displayText = `\xA7bWave ${this.currentWave} \xA7f| \xA7c${this.enemiesRemaining} ${mobText} \xA7f| \xA7aKills: ${playerKills} \xA7f| ${hpDisplay} \xA7f| \xA7eTime: ${timeString}`;
              } else {
                const waveTimeString = this.formatTime(this.waveTimeRemaining);
                displayText = `\xA7bWave ${this.currentWave} \xA7f| \xA7e${waveTimeString} \xA7f| \xA7aKills: ${playerKills} \xA7f| ${hpDisplay} \xA7f| \xA7eTime: ${timeString}`;
              }
            } else {
              displayText = `\xA7bWave ${this.currentWave} \xA7f| \xA7e-- \xA7f| \xA7aKills: ${playerKills} \xA7f| ${hpDisplay} \xA7f| \xA7eTime: ${timeString}`;
            }
          }
        }
        this._actionBar.queueMinigameStatus(player, displayText);
      }
    }
  }
  checkAndTeleportStuckSpiders() {
    for (const spiderId of this.spawnedEnemies) {
      const spider = world19.getEntity(spiderId);
      if (spider && spider.isValid) {
        const dx = spider.location.x - this.outOfBoundsTPLocation.x;
        const dy = spider.location.y - this.outOfBoundsTPLocation.y;
        const dz = spider.location.z - this.outOfBoundsTPLocation.z;
        const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
        if (distance > 40) {
          const angle = Math.random() * 2 * Math.PI;
          const baseX = this.origin.x + Math.cos(angle) * SPAWN_DISTANCE;
          const baseZ = this.origin.z + Math.sin(angle) * SPAWN_DISTANCE;
          const tpPos = {
            x: baseX,
            y: this.getTopYLoc(baseX, baseZ) + 2,
            z: baseZ
          };
          spider.teleport(tpPos);
        }
      }
    }
  }
  applyRandomMilestoneEffect(player) {
    const effects = [
      { type: MinecraftEffectTypes.Speed, name: "Speed", duration: 100, amplifier: 1 },
      // 5 seconds
      { type: MinecraftEffectTypes.Regeneration, name: "Regeneration", duration: 120, amplifier: 1 },
      // 6 seconds
      { type: MinecraftEffectTypes.JumpBoost, name: "Jump Boost", duration: 140, amplifier: 1 },
      // 7 seconds
      { type: MinecraftEffectTypes.Strength, name: "Strength", duration: 160, amplifier: 0 }
      // 8 seconds
    ];
    const randomEffect = effects[Math.floor(Math.random() * effects.length)];
    try {
      player.addEffect(randomEffect.type, randomEffect.duration, {
        amplifier: randomEffect.amplifier,
        showParticles: true
      });
    } catch (error2) {
    }
  }
  formatKillStreak(streak) {
    if (streak <= 1) {
      return `\xA77Streak: --`;
    } else if (streak >= 10) {
      return `\xA76Streak: ${streak}`;
    } else if (streak >= 5) {
      return `\xA7eStreak: ${streak}`;
    } else {
      return `\xA7aStreak: ${streak}`;
    }
  }
  formatTime(seconds) {
    const mins = Math.floor(seconds / 60);
    const secs = seconds % 60;
    return mins > 0 ? `${mins}:${secs.toString().padStart(2, "0")}` : `${secs}s`;
  }
  isScoreBetter(oldScore, newScore) {
    return newScore > oldScore;
  }
  scoreMessageFormatting(score) {
    return `${score} HP`;
  }
  saveScores() {
    for (const playerId of this.playerIDList) {
      const player = world19.getEntity(playerId);
      if (player) {
        this.addScoreRecord(player, this.score);
        this.updatePersonalHighScore(player, this.score, this.isScoreBetter, this.scoreMessageFormatting);
        const starCount = this.score >= 80 ? 3 : this.score >= 50 ? 2 : this.score >= 20 ? 1 : 0;
        this.updatePlayerStarsCollected(player, starCount);
      }
    }
  }
  victory() {
    info("Victory achieved!");
    if (this.globalTimerInterval) {
      system20.clearRun(this.globalTimerInterval);
      this.globalTimerInterval = void 0;
    }
    this.gameEnded = true;
    const gameTime = Math.max(0, Math.floor((this.globalTimer - this.gameStartTime) / 20));
    this.displayKillStats();
    this.saveScores();
    for (const playerId of this.playerIDList) {
      const player = world19.getEntity(playerId);
      if (player) {
        this.completed_minigame(player);
      }
    }
    this.cleanup();
  }
  defeat() {
    if (this.globalTimerInterval) {
      system20.clearRun(this.globalTimerInterval);
      this.globalTimerInterval = void 0;
    }
    this.gameEnded = true;
    const gameTime = Math.max(0, Math.floor((this.globalTimer - this.gameStartTime) / 20));
    this.displayKillStats();
    this.saveScores();
    for (const playerId of this.playerIDList) {
      const player = world19.getEntity(playerId);
      if (player) {
        this.lost_minigame(player);
      }
    }
    this.cleanup();
  }
  player_tick(player) {
    super.player_tick(player);
    if (this.jumboCandy && this.jumboCandy.isValid) {
    } else if (!this.gameEnded) {
      info("Jumbo candy destroyed, triggering defeat");
      this.gameEnded = true;
      this.defeat();
      return;
    }
  }
  boss_out_of_bounds_check() {
    if (this.bossEntity) {
      if (!this.outOfBoundsTPLocation) {
        return;
      }
      const dx = this.bossEntity.location.x - this.outOfBoundsTPLocation.x;
      const dy = this.bossEntity.location.y - this.outOfBoundsTPLocation.y;
      const dz = this.bossEntity.location.z - this.outOfBoundsTPLocation.z;
      const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
      if (distance > 20) {
        const magicSpiderBoss2 = MagicSpiderBoss.getInstance();
        magicSpiderBoss2.performTeleport(this.bossEntity);
      }
    }
  }
  cleanup() {
    if (this.globalTimerInterval) {
      system20.clearRun(this.globalTimerInterval);
    }
    this.spawnedEnemies.clear();
    world19.setDynamicProperty(`mco_nom:defense_minigame_wave_${this.id}`);
    world19.setDynamicProperty(`mco_nom:defense_minigame_hp_${this.id}`);
    const spiders = this.dimension.getEntities({
      families: ["spider_minigame"],
      location: this.origin,
      maxDistance: 100
    });
    for (const spider of spiders) {
      try {
        spider.remove();
      } catch {
      }
    }
    if (this.jumboCandy) {
      try {
        this.jumboCandy.remove();
      } catch {
      }
    }
    if (this.magicSpider && this.magicSpider.isValid) {
      try {
        this.magicSpider.remove();
      } catch {
      }
    }
    if (this.bossEntity && this.bossEntity.isValid) {
      try {
        this.bossEntity.remove();
      } catch {
      }
    }
    super.cleanup();
  }
  /**
   * Override base class action bar to prevent double action bars
   */
  _updateActionBar(totalSeconds) {
  }
  displayKillStats() {
    const killStats = [];
    for (const playerId of this.playerIDList) {
      const kills = this.playerKills.get(playerId) || 0;
      const streak = this.playerKillStreaks.get(playerId) || 0;
      const player = world19.getEntity(playerId);
      const playerName = player ? player.name : "Unknown";
      killStats.push({ name: playerName, kills, streak });
    }
    killStats.sort((a, b) => b.kills - a.kills);
    const rankedStats = [];
    for (let i = 0; i < killStats.length; i++) {
      const rank = i + 1;
      rankedStats.push(`${rank}. ${killStats[i].name} - ${killStats[i].kills} kills (${killStats[i].streak} streak)`);
    }
  }
  evaluate_objectives(player) {
  }
};

// data/gametests/src/mobs/CardboardBox.ts
var log13 = Logger.getLogger("CardboardBox");
var UI_ICONS = {
  Accessory: "textures/mco/nom/ui/button_accessory.png",
  Back: "textures/mco/nom/ui/button_close.png",
  Behavior: "textures/mco/nom/ui/button_behavior.png",
  Costume: "textures/mco/nom/ui/button_costume.png",
  How: "textures/mco/nom/ui/button_how.png",
  Leaderboard: "textures/mco/nom/ui/button_leaderboard.png",
  Start: "textures/mco/nom/ui/button_start.png",
  Transformation: "textures/mco/nom/ui/button_transformation.png",
  "Fabric Box": "textures/mco/nom/items/box_fabric.png",
  "Cardboard Box": "textures/mco/nom/items/box.png",
  "Magic Box": "textures/mco/nom/items/box_magic.png",
  "Mystery Box": "textures/mco/nom/items/box_mystery.png"
};
function getIcon(key) {
  return UI_ICONS[key];
}
var commonRewards = [
  { type: "costume", id: 1 },
  { type: "costume", id: 12 },
  { type: "costume", id: 13 },
  { type: "costume", id: 15 },
  { type: "costume", id: 20 },
  { type: "accessory", id: 16 },
  { type: "accessory", id: 10 },
  { type: "accessory", id: 12 },
  { type: "accessory", id: 18 },
  { type: "accessory", id: 5 },
  { type: "accessory", id: 3 },
  { type: "form", id: 1 },
  { type: "form", id: 7 }
];
var uncommonRewardChance = 0.3;
var uncommonRewards = [
  { type: "costume", id: 3 },
  { type: "costume", id: 7 },
  { type: "costume", id: 8 },
  { type: "costume", id: 14 },
  { type: "costume", id: 17 },
  { type: "accessory", id: 6 },
  { type: "accessory", id: 7 },
  { type: "accessory", id: 8 },
  { type: "accessory", id: 9 },
  { type: "accessory", id: 13 },
  { type: "accessory", id: 19 },
  { type: "form", id: 2 },
  { type: "form", id: 3 }
];
var rareRewardChance = 0.2;
var rareRewards = [
  { type: "costume", id: 2 },
  { type: "costume", id: 5 },
  { type: "costume", id: 10 },
  { type: "costume", id: 11 },
  { type: "costume", id: 16 },
  { type: "accessory", id: 1 },
  { type: "accessory", id: 4 },
  { type: "accessory", id: 14 },
  { type: "accessory", id: 15 },
  { type: "accessory", id: 21 },
  { type: "form", id: 5 },
  { type: "form", id: 6 }
];
var legendaryRewardChance = 0.1;
var legendaryRewards = [
  { type: "costume", id: 4 },
  { type: "costume", id: 6 },
  { type: "costume", id: 9 },
  { type: "costume", id: 18 },
  { type: "costume", id: 19 },
  { type: "accessory", id: 2 },
  { type: "accessory", id: 11 },
  { type: "accessory", id: 17 },
  { type: "accessory", id: 20 },
  { type: "accessory", id: 22 },
  { type: "form", id: 4 },
  { type: "form", id: 8 }
];
system21.afterEvents.scriptEventReceive.subscribe((e) => {
  const target = e.sourceEntity;
  if (e.id == "mco_nom:cardboard_box_remove") {
    if (!target) {
      error(`A source entity is required to use mco_nom:cardboard_box_remove.`);
      return;
    } else if (target.typeId != "mco_nom:cardboard_box") {
      error(`Only a cardboard box can use mco_nom:cardboard_box_remove.`);
      return;
    }
    let despawning = false;
    const boxOpen = target.getProperty("mco_nom:box_open");
    if (boxOpen) {
      target.triggerEvent("mco_nom:close_box");
    }
    system21.runTimeout(() => {
      try {
        if (!despawning) {
          despawning = true;
          target.setProperty("mco_nom:box_disappear", true);
          system21.runTimeout(() => {
            try {
              if (!target)
                return;
              let boxType = "mco_nom:cardboard_box";
              const minigameChoice = target.getProperty("mco_nom:minigame_choice");
              if (minigameChoice == 2) {
                boxType = "mco_nom:fabric_box";
              } else if (minigameChoice == 3) {
                boxType = "mco_nom:magic_box";
              }
              const itemStack = new ItemStack8(boxType);
              itemStack.setDynamicProperty("mco_nom:form", target.getProperty("mco_nom:form"));
              itemStack.setDynamicProperty("mco_nom:costume", target.getProperty("mco_nom:costume"));
              itemStack.setDynamicProperty("mco_nom:accessory", target.getProperty("mco_nom:accessory"));
              target.dimension.spawnItem(
                itemStack,
                target.location
              );
              target.remove();
            } catch (err) {
              return;
            }
          }, 15);
        }
      } catch (err) {
        return;
      }
    }, boxOpen ? 50 : 0);
  } else if (e.id == "mco_nom:unlock_rewards") {
    world20.setDynamicProperty("mco_nom:unlock_rewards", !(world20.getDynamicProperty("mco_nom:unlock_rewards") ?? false));
  } else if (e.id == "mco_nom:minigame_box_refresh") {
    const minigameId = target.getDynamicProperty("mco_nom:current_minigame_id");
    const minigameMode = target.getProperty("mco_nom:minigame_mode");
    if (minigameId) {
      const activeMinigameList = getRunningMinigames();
      const minigameActive = activeMinigameList.includes(minigameId);
      if (minigameActive && !minigameMode) {
        target.setProperty("mco_nom:minigame_mode", true);
      } else if (!minigameActive && minigameMode) {
        target.setProperty("mco_nom:minigame_mode", false);
        target.setDynamicProperty("mco_nom:current_minigame_id");
      }
    } else {
      if (minigameMode) {
        target.setProperty("mco_nom:minigame_mode", false);
      }
    }
  } else if (e.id == "mco_nom:skip_intro") {
    world20.setDynamicProperty("mco_nom:minigame_has_been_played", true);
  } else if (e.id == "mco_nom:reset_intro") {
    world20.setDynamicProperty("mco_nom:minigame_has_been_played", false);
  }
});
world20.beforeEvents.playerInteractWithEntity.subscribe((e) => {
  try {
    const player = e.player;
    const target = e.target;
    if (target.typeId == "mco_nom:cardboard_box") {
      if (target.getProperty("mco_nom:box_open") == true) {
        system21.runTimeout(() => {
          interact_with_box(player, target);
        }, 2);
      } else {
        system21.runTimeout(() => {
          opened_box(player, target);
        }, 2);
      }
    }
  } catch (err) {
    warn(`Cardboard Box interact error: ${err}`);
  }
});
world20.afterEvents.entitySpawn.subscribe((e) => {
  try {
    const cause = e.cause;
    const entity = e.entity;
    if (entity.typeId == "mco_nom:cardboard_box") {
      try {
        entity.lookAt(entity.dimension.getEntities({ type: "minecraft:player", location: entity.location, closest: 1 })[0].location);
      } catch (err) {
        warn(`Cardboard box rotation error: ${err}`);
      }
      system21.runTimeout(() => {
        if (world20.getDynamicProperty("mco_nom:minigame_has_been_played")) {
          try {
            const hasRewardSet = entity.getProperty("mco_nom:accessory") != 0 || entity.getProperty("mco_nom:costume") != 0 || entity.getProperty("mco_nom:form") != 0;
            if (!hasRewardSet) {
              const categorySelection = Math.random();
              if (categorySelection <= legendaryRewardChance) {
                set_reward(entity, legendaryRewards);
              } else if (categorySelection <= legendaryRewardChance + rareRewardChance) {
                set_reward(entity, rareRewards);
              } else if (categorySelection <= legendaryRewardChance + rareRewardChance + uncommonRewardChance) {
                set_reward(entity, uncommonRewards);
              } else {
                set_reward(entity, commonRewards);
              }
            }
          } catch (err) {
            warn(`Cardboard Box award set error: ${err}`);
          }
          try {
            const hasMinigameSet = entity.getProperty("mco_nom:minigame_choice") != 0;
            if (!hasMinigameSet) {
              const choice = 1 + Math.floor(Math.random() * 3);
              entity.setProperty("mco_nom:minigame_choice", choice);
              if (choice == 1) {
                info(`Parkour Minigame Set!`);
              } else if (choice == 2) {
                info(`Cauldron Minigame Set!`);
              } else if (choice == 3) {
                info(`Spider Defense Minigame Set!`);
              }
            }
          } catch (err) {
            warn(`Cardboard Box minigame set error: ${err}`);
          }
        } else {
          entity.setProperty("mco_nom:minigame_choice", 1);
          entity.setProperty("mco_nom:accessory", 0);
          entity.setProperty("mco_nom:costume", 0);
          entity.setProperty("mco_nom:form", 0);
        }
      }, 3);
    }
  } catch (err) {
    warn(`Cardboard Box spawn error: ${err}`);
  }
});
world20.afterEvents.itemStartUseOn.subscribe((e) => {
  try {
    const itemStack = e.itemStack;
    const source = e.source;
    if (!itemStack) {
      return;
    }
    if (itemStack.hasTag("mco_nom:minigame_box")) {
      let minigameChoice = 1;
      if (itemStack.typeId == "mco_nom:fabric_box") {
        minigameChoice = 2;
      } else if (itemStack.typeId == "mco_nom:magic_box") {
        minigameChoice = 3;
      }
      const formReward = itemStack.getDynamicProperty("mco_nom:form") ?? 0;
      const costumeReward = itemStack.getDynamicProperty("mco_nom:costume") ?? 0;
      const accessoryReward = itemStack.getDynamicProperty("mco_nom:accessory") ?? 0;
      const chosenMinigame = minigameChoice;
      const boxListBefore = source.dimension.getEntities({ type: "mco_nom:cardboard_box", location: source.location, maxDistance: 20 });
      system21.runTimeout(() => {
        const boxListAfter = source.dimension.getEntities({ type: "mco_nom:cardboard_box", location: source.location, maxDistance: 20 });
        for (const box of boxListAfter) {
          if (!boxListBefore.includes(box)) {
            if (formReward) {
              box.setProperty("mco_nom:form", Number(formReward));
            }
            if (costumeReward) {
              box.setProperty("mco_nom:costume", Number(costumeReward));
            }
            if (accessoryReward) {
              box.setProperty("mco_nom:accessory", Number(accessoryReward));
            }
            if (chosenMinigame) {
              box.setProperty("mco_nom:minigame_choice", chosenMinigame);
            }
            break;
          }
        }
      }, 2);
    }
  } catch (err) {
    warn(`Cardboard Box reload error: ${err}`);
  }
});
function set_reward(box, list) {
  const rewardSelection = Math.floor(Math.random() * list.length);
  box.setProperty(`mco_nom:${list[rewardSelection].type}`, list[rewardSelection].id);
}
function playButtonSound(player) {
  player.playSound("mco_nom.ui.button_click" /* McoNomUiButtonClick */);
}
function getMinigameTypeByChoice(choice) {
  switch (choice) {
    case 1:
      return MinigameTypes.ParkourMinigame;
      break;
    case 2:
      return MinigameTypes.CauldronMinigame;
      break;
    case 3:
      return MinigameTypes.SpiderDefenseMinigame;
      break;
    default:
      return void 0;
      break;
  }
}
function opened_box(player, box) {
  try {
    system21.runTimeout(() => {
      if (!box || box.isValid === false)
        return;
      if (!box || !box.isValid)
        return;
      const minigameChoice = box.getProperty("mco_nom:minigame_choice");
      const minigameType = getMinigameTypeByChoice(minigameChoice);
      if (minigameType) {
        showGameMenu(player, box, minigameType);
      } else {
        error("No minigame type set.");
      }
    }, TicksPerSecond5 * 3);
  } catch (err) {
    error(`Box open error: ${err}`);
  }
}
function interact_with_box(player, box) {
  try {
    if (!box || box.isValid === false)
      return;
    const minigameChoice = box.getProperty("mco_nom:minigame_choice");
    const minigameType = getMinigameTypeByChoice(minigameChoice);
    if (minigameType) {
      showGameMenu(player, box, minigameType);
    } else {
      error("No minigame type set.");
    }
  } catch (err) {
    error(`Box interact error: ${err}`);
  }
}
var buttonTextPrefix = "\xA7l";
var titleTextPrefix = "\xA7l";
var MAX_STAR_AMOUNT = 3;
var STARS_TO_UNLOCK_NEXT_LEVEL = 2;
var gray = "\xA77";
var reset = "\xA7r";
var Titles = {
  ParkourMinigame: "Cardboard Box",
  CauldronMinigame: "Fabric Box",
  SpiderDefenseMinigame: "Magic Box"
};
function showGameMenu(player, box, minigameType) {
  if (!minigameType) {
    error("Error getting box minigame type.");
    return;
  }
  const italic = "\xA7o";
  const bold2 = "\xA7l";
  const gray2 = "\xA77";
  const Games = {
    ParkourMinigame: gray2 + "Let's play...\xA7r\n\xA7lNom's Candy Parkour Challenge!\xA7r",
    CauldronMinigame: gray2 + "Let's play...\xA7r\n\xA7lCandy Cauldron Cooking Challenge!\xA7r",
    SpiderDefenseMinigame: gray2 + "Let's play...\xA7r\n\xA7lMagic Spider Swarm Defense!\xA7r"
  };
  const Descriptions = {
    ParkourMinigame: gray2 + "Jump through obstacles to collect the candy and feed Om Nom!\xA7r",
    CauldronMinigame: gray2 + "Chef Nom's kitchen is calling... Are you up for challenge?\n",
    SpiderDefenseMinigame: gray2 + "The Magic Spider is after the beloved Jumbo Candy, and Om Nom needs your help to save it!\xA7r"
  };
  const description = Descriptions[minigameType];
  const title = Titles[minigameType];
  const form = new ActionFormData().title(titleTextPrefix + title).label(Games[minigameType]).label(description).label("\n").divider().button(`${buttonTextPrefix}Start Game`, UI_ICONS.Start).button(`${buttonTextPrefix}How to Play`, UI_ICONS.How).button(`${buttonTextPrefix}Leaderboards`, UI_ICONS.Leaderboard).label("\n").button(`${buttonTextPrefix}Close Box`, getIcon(title));
  form.show(player).then((res) => {
    if (res.canceled)
      return;
    playButtonSound(player);
    switch (res.selection) {
      case 0:
        showStartGame(player, box, minigameType);
        break;
      case 1:
        showHowToPlay(player, box, minigameType);
        break;
      case 2:
        showLeaderboards(player, box, minigameType);
        break;
      case 3:
        cancel_minigame(player, box);
        break;
    }
  });
}
var FORMAT_RE = /§[0-9A-FK-OR]/gi;
var stripFmt = (s) => s.replace(FORMAT_RE, "");
function ellipsizeNameCharsDotsAsOne(s, maxChars) {
  if (maxChars <= 0)
    return "";
  const plain = stripFmt(s);
  if (plain.length <= maxChars)
    return s;
  const budget = Math.max(0, maxChars - 1);
  let out = "", visible = 0;
  for (let i = 0; i < s.length; i++) {
    const ch = s[i];
    if (ch === "\xA7" && i + 1 < s.length) {
      out += ch + s[i + 1];
      i++;
      continue;
    }
    if (visible + 1 > budget)
      break;
    out += ch;
    visible += 1;
  }
  return out + "...";
}
function alignKeyValueRows(rows, extraSpacing, scorePostfix) {
  const maxKeyLength = Math.max(...rows.map(([key]) => key.length));
  return rows.map(([key, value], i) => {
    const firstRowShift = i === 0 ? -1 : 0;
    const padding = " " + gray + "-".repeat(maxKeyLength - key.length + extraSpacing - 2 + firstRowShift) + reset + " ";
    return `${key}${padding}${value}${scorePostfix}`;
  }).join("\n");
}
function showLeaderboards(player, box, minigameType) {
  const title = Titles[minigameType];
  const form = new ActionFormData().title(titleTextPrefix + title);
  const levelIcons = [
    "textures/mco/nom/ui/level_1",
    "textures/mco/nom/ui/level_2",
    "textures/mco/nom/ui/level_3",
    "textures/mco/nom/ui/level_4"
  ];
  let i = 0;
  for (const [level, title2] of Object.entries(LevelTitles)) {
    form.button(`${buttonTextPrefix}${title2}`, levelIcons[i]);
    i++;
  }
  form.label("\n").button(`${buttonTextPrefix}Back`, UI_ICONS.Back);
  form.show(player).then((res) => {
    if (res.canceled)
      return;
    if (res.selection === void 0)
      return;
    playButtonSound(player);
    const levelKeys = [1, 2, 3, 4];
    const level = levelKeys[res.selection];
    if (res.selection === levelKeys.length) {
      showGameMenu(player, box, minigameType);
      return;
    }
    try {
      const applyFormatSeconds = minigameType == MinigameTypes.ParkourMinigame ? true : false;
      const starsCollected = getPlayerStarCount(player, minigameType, level) ?? 0;
      const scorePostfixes = {
        ParkourMinigame: "",
        CauldronMinigame: " recipes\xA7r",
        SpiderDefenseMinigame: " HP"
      };
      const scorePrefixes = {
        ParkourMinigame: `\xA7r\xA77Your Best Time\xA7r`,
        CauldronMinigame: `\xA7r\xA77Your Best Score\xA7r`,
        SpiderDefenseMinigame: `\xA7r\xA77Your Best Score\xA7r`
      };
      const scorePostfix = scorePostfixes[minigameType];
      const scorePrefix = scorePrefixes[minigameType];
      const starCountPrefix = starsCollected < 3 ? "" : "\xA7l";
      const extraSpacing = minigameType === MinigameTypes.CauldronMinigame ? 10 : 12;
      const noScoreSymbol = applyFormatSeconds ? "--:--" : "0";
      const personalScore = getPersonalHighScore(
        player,
        minigameType,
        level,
        applyFormatSeconds
      );
      const scores = getScoreRecords(minigameType, level);
      const personalStats = alignKeyValueRows(
        [
          [scorePrefix, `\xA77${personalScore ?? noScoreSymbol}${scorePostfix}\xA7r`],
          [
            `\xA7r\xA77Stars Collected\xA7r`,
            `\xA77${starCountPrefix}${starsCollected ?? 0}/${MAX_STAR_AMOUNT}\xA7r`
          ]
        ],
        extraSpacing,
        ""
      );
      const MAX_NAME_CHARS = 25;
      const rows = scores.map((entry, i2) => {
        const you = entry.name === player.name;
        const trimmedName = ellipsizeNameCharsDotsAsOne(entry.name, MAX_NAME_CHARS);
        const left = `${i2 + 1}. \xA77\xA7l${you ? "\xA7r\xA7l" : ""}${trimmedName}\xA7r`;
        const raw = applyFormatSeconds ? formatSeconds(entry.score) : String(entry.score);
        const right = `\xA7r\xA77${you ? "\xA7r" : ""}--- ${"\xA7o" + raw}${you ? "\xA7r\xA7o" : ""}${scorePostfix}\xA7r`;
        return { left, right };
      });
      const leaderboardList = [];
      for (const row of rows) {
        leaderboardList.push(row.left + "\n" + row.right + "\n");
      }
      const title2 = Titles[minigameType];
      new ActionFormData().title(titleTextPrefix + title2).label(`${titleTextPrefix}${LevelTitles[level]}:\xA7r
`).label(personalStats).label("\xA7r\xA7lGlobal Leaderboards:\xA7r\n").label(leaderboardList.join("\n")).label("\n").divider().button(`${buttonTextPrefix}Back`, UI_ICONS.Back).show(player).then(() => {
        playButtonSound(player);
        showLeaderboards(player, box, minigameType);
      });
    } catch (err) {
      error(err);
    }
  });
}
function showStartGame(player, box, minigameType) {
  const title = Titles[minigameType];
  const form = new ActionFormData().title(titleTextPrefix + title);
  const levelKeys = [1, 2, 3, 4];
  const levelIcons = [
    "textures/mco/nom/ui/level_1",
    "textures/mco/nom/ui/level_2",
    "textures/mco/nom/ui/level_3",
    "textures/mco/nom/ui/level_4"
  ];
  const buttons = levelKeys.map((level) => {
    let previousLevelStars;
    let active;
    const currentLevelStars = getPlayerStarCount(player, minigameType, level) ?? 0;
    if (level !== 1) {
      previousLevelStars = getPlayerStarCount(player, minigameType, level - 1) ?? 0;
      active = previousLevelStars >= STARS_TO_UNLOCK_NEXT_LEVEL;
    } else {
      active = true;
    }
    const titleBase = LevelTitles[level] ?? `Level ${level}`;
    const title2 = `${titleBase} ${"\n"}Stars: ${currentLevelStars}/${MAX_STAR_AMOUNT}`;
    return {
      title: title2,
      active
    };
  });
  buttons.forEach((btn, i) => {
    if (!btn.active)
      form.button(buttonTextPrefix + btn.title, "textures/mco/nom/items/lock");
    else
      form.button(buttonTextPrefix + btn.title, levelIcons[i]);
  });
  form.label("\n").button(`${buttonTextPrefix}Back`, UI_ICONS.Back).show(player).then((response) => {
    if (response.canceled)
      return;
    if (response.selection === void 0)
      return;
    playButtonSound(player);
    if (response.selection == levelKeys.length) {
      showGameMenu(player, box, minigameType);
      return;
    }
    const selected = buttons[response.selection];
    if (selected?.active) {
      const level = levelKeys[response.selection];
      start_minigame(player, box, minigameType, level);
    } else {
      showStartGame(player, box, minigameType);
    }
  });
}
function showHowToPlay(player, box, minigameType) {
  const rules = {
    ParkourMinigame: gray + "1. Dash through wobbly cardboard obstacles.\n\n2. Snag every candy. Each one feeds Om Nom and becomes your next checkpoint.\n\n3. Stay on your feet! Falling means starting back at your last candy.\n\n\nThere's no time limit, but a lightning-fast finish earns bragging rights.\n\xA7lBonus:\xA7r\xA77 grab hidden stars along the way for bonus points!" + reset,
    CauldronMinigame: gray + "1. Hop and sprint across a wobbly cardboard village to hunt for tasty ingredients.\n\n2. Toss each ingredient into Chef Nom's Candy Cauldron to start cooking.\n\n3. Complete as many sweet recipes as you can before the cauldron runs dry.\n\n\nPlaying with friends? Work as a team to fill the cauldron, but keep an eye on your own recipe list... only one can be Chef Nom's \xA7ltop cook!\xA7r\xA77\n\xA7lBonus:\xA7r\xA77 Want to be Chef Nom's #1? Hurl ingredients at fellow chefs to throw them off course." + reset,
    SpiderDefenseMinigame: gray + "1. Guard the Candy. Hold off wave after wave of hungry spiders.\n\n2. Squash the Swarm. Take down every spider before they nibble the candy.\n\n3. Face the Magic Spider. Defeat the boss to secure victory!\n\n\nThe spiders grow stronger and hungrier with every wave, so stay sharp.\nDefend the candy by yourself or with friends to keep the Jumbo Candy perfectly intact to earn the highest star rating and claim ultimate sweet-defender glory." + reset
  };
  const title = Titles[minigameType];
  const howToPlay = new ActionFormData();
  howToPlay.title(titleTextPrefix + title).label(titleTextPrefix + "How to play:\n").label(rules[minigameType]).label("\n").divider().button(`${buttonTextPrefix}Back`, UI_ICONS.Back).show(player).then((res) => {
    if (res.canceled)
      return;
    playButtonSound(player);
    showGameMenu(player, box, minigameType);
  });
}
function start_minigame(player, box, minigameType, level) {
  try {
    new MinigameStartConfirmation(
      box,
      player,
      player.dimension.getPlayers({ location: player.location, maxDistance: 20 }),
      minigameType,
      level
    );
    return;
  } catch (err) {
    error(`Box UI error: ${err}`);
  }
}
function cancel_minigame(player, box) {
  box.triggerEvent("mco_nom:close_box");
}
var MinigameStartConfirmation = class {
  constructor(box, mainPlayer, playerList, minigameType, level) {
    this._areaCheckInFlight = false;
    // Prevent parallel checks
    this._areaDecisionMade = false;
    this.add = (a, b) => ({
      x: a.x + b.x,
      y: a.y + b.y,
      z: a.z + b.z
    });
    this.floor = (v) => ({
      x: Math.floor(v.x),
      y: Math.floor(v.y),
      z: Math.floor(v.z)
    });
    this.box = box;
    this.mainPlayer = mainPlayer;
    this.playerList = playerList;
    this.tickCount = 0;
    this.minigameType = minigameType;
    this.level = level;
    this.dimension = box.dimension;
    this.origin = box.location;
    for (const player of this.playerList) {
      player.setDynamicProperty("mco_nom:minigame_start_choice");
      if (player != this.mainPlayer) {
        const dialog = new ActionFormData();
        dialog.title({
          translate: titleTextPrefix + Titles[this.minigameType],
          with: { rawtext: [{ text: "\n" }] }
        });
        dialog.label({
          translate: `\xA7l${this.mainPlayer.nameTag}\xA7r is starting a minigame! Want to join?
`,
          with: { rawtext: [{ text: "\n" }] }
        });
        dialog.divider();
        dialog.button({
          translate: `${buttonTextPrefix}Yes`,
          with: { rawtext: [{ text: "\n" }] }
        });
        dialog.button({
          translate: `${buttonTextPrefix}No`,
          with: { rawtext: [{ text: "\n" }] }
        });
        dialog.show(player).then((response) => {
          if (response?.selection != null) {
            if (response.selection == 0) {
              player.setDynamicProperty("mco_nom:minigame_start_choice", 1);
            } else if (response.selection == 1) {
              player.setDynamicProperty("mco_nom:minigame_start_choice", 0);
            }
            playButtonSound(player);
          } else {
            player.setDynamicProperty("mco_nom:minigame_start_choice", 0);
          }
        }).catch((err) => {
          warn(`Minigame Join Option Error: ${err}`);
          player.setDynamicProperty("mco_nom:minigame_start_choice", 0);
        });
      }
    }
    this.checkTick = system21.runInterval(() => this.tick(), 15);
    this.tick();
  }
  getCenteredOrigin(box, baseY, sizeOffset) {
    const size = sizeOffset;
    const centerOffset = { x: size.x / 2, y: 0, z: size.z / 2 };
    const originMin = {
      x: box.location.x - centerOffset.x,
      y: baseY,
      z: box.location.z - centerOffset.z
    };
    return this.floor(originMin);
  }
  makeAabb(minCorner, size) {
    const to = {
      x: minCorner.x + size.x,
      y: minCorner.y + size.y,
      z: minCorner.z + size.z
    };
    const min = {
      x: Math.floor(Math.min(minCorner.x, to.x)),
      y: Math.floor(Math.min(minCorner.y, to.y)),
      z: Math.floor(Math.min(minCorner.z, to.z))
    };
    const max = {
      x: Math.floor(Math.max(minCorner.x, to.x)),
      y: Math.floor(Math.max(minCorner.y, to.y)),
      z: Math.floor(Math.max(minCorner.z, to.z))
    };
    return { min, max };
  }
  /**
   * This tries to teleport player to a potential minigame spawn point to load chunks at that are so they
   * can be checked. If teleportation was not successful (meaning that there are blocks at the teleport location
   * or that a chunk with that location is not loaded), returns false.
   * If teleport succeeded, checks if the area has any blocks, if not returns true.
   *
   * @param player Main player that will be teleportet to load chunks
   * @param min Min of the area
   * @param size Size of the area
   * @param spawnLocation Spawn location of the potential level
   * @param maxWaitSeconds Max amount of seconds to wait for chunks to load
   * @returns If area is clear
   */
  async isAreaClearAsync(player, min, size, spawnLocation, maxWaitSeconds = 2) {
    const backLocation = {
      x: player.location.x,
      y: player.location.y,
      z: player.location.z
    };
    let tpStatus = false;
    try {
      player.runCommand(
        `/camera @s fade time 0 2 0.2 color 0 0 0`
      );
      player.addEffect(MinecraftEffectTypes.Resistance, 40, {
        amplifier: 255,
        showParticles: false
      });
      player.addEffect(MinecraftEffectTypes.SlowFalling, 40, {
        amplifier: 255,
        showParticles: false
      });
      tpStatus = player.tryTeleport(spawnLocation);
    } catch {
      tpStatus = false;
    }
    if (!tpStatus)
      return false;
    const { min: aMin, max: aMax } = this.makeAabb(min, size);
    const volume = new BlockVolume2(aMin, aMax);
    const filter = { excludeTypes: ["minecraft:air"] };
    const timeoutTicks = Math.max(1, Math.floor(maxWaitSeconds * TicksPerSecond5));
    const result = await new Promise((resolve) => {
      let waitedTicks = 0;
      const tickRate = 3;
      const waitForChunks = system21.runInterval(() => {
        try {
          const hasObstacle = player.dimension.containsBlock(
            volume,
            filter,
            false
            // allowUnloadedChunks
          );
          system21.clearRun(waitForChunks);
          resolve(!hasObstacle);
        } catch (e) {
          error("contains block error: ", e);
          waitedTicks += tickRate;
          player.tryTeleport(spawnLocation);
          if (waitedTicks >= timeoutTicks) {
            system21.clearRun(waitForChunks);
            error("Chunks loading timeout!");
            resolve(false);
          }
        }
      }, tickRate);
    });
    try {
      player.tryTeleport(backLocation);
      try {
        player.removeEffect(MinecraftEffectTypes.Resistance);
        player.removeEffect(MinecraftEffectTypes.SlowFalling);
      } catch {
        if (player) {
          player.addEffect(MinecraftEffectTypes.Resistance, 10, {
            amplifier: 255,
            showParticles: false
          });
          player.addEffect(MinecraftEffectTypes.SlowFalling, 10, {
            amplifier: 1,
            showParticles: false
          });
        }
      }
    } catch {
      player.addEffect(MinecraftEffectTypes.Resistance, 10, {
        amplifier: 255,
        showParticles: false
      });
      player.addEffect(MinecraftEffectTypes.SlowFalling, 10, {
        amplifier: 1,
        showParticles: false
      });
    }
    return result;
  }
  /**
   * Shows an action bar warning to all players in the minigame.
   */
  showObstructionWarning(heightLimit = false) {
    for (const playerId of this.playerList) {
      const player = world20.getEntity(playerId.id);
      if (player && player instanceof Player16) {
        const actionBar = ActionBarManager.getInstance();
        let message = `\xA7l\xA7cBuilds are in the way!\xA7r \xA77Move the Box to an open space.\xA7r`;
        if (heightLimit) {
          message = `\xA7l\xA7cToo high!\xA7r \xA77Impossible to place a minigame.\xA7r`;
        }
        actionBar.queueTimedMessage(player, message, 1 /* MINIGAMES */, 4);
      }
    }
  }
  tick() {
    let shouldStart = true;
    this.tickCount += 1;
    for (const player of this.playerList) {
      try {
        if (player == this.mainPlayer) {
          continue;
        }
        const choice = player.getDynamicProperty("mco_nom:minigame_start_choice");
        if (choice == void 0) {
          shouldStart = false;
        }
      } catch (err) {
        warn(`Minigame Join Tick Error: ${err}`);
      }
    }
    if (shouldStart || this.tickCount >= 15)
      this.startAsync();
  }
  async startAsync() {
    if (this._areaCheckInFlight)
      return;
    this._areaCheckInFlight = true;
    this._areaDecisionMade = false;
    const list = [];
    for (const player of this.playerList) {
      try {
        const choice = player.getDynamicProperty("mco_nom:minigame_start_choice");
        if ((player == this.mainPlayer || choice === 1) && !isPlayerInMinigame(player)) {
          list.push(player.id);
        }
      } catch (err) {
        warn(`Minigame Join Error: ${err}`);
      }
    }
    const formReward = Number(this.box.getProperty("mco_nom:form") ?? 0);
    const costumeReward = Number(this.box.getProperty("mco_nom:costume") ?? 0);
    const accessoryReward = Number(this.box.getProperty("mco_nom:accessory") ?? 0);
    const chosenMinigame = this.minigameType;
    if (chosenMinigame == MinigameTypes.ParkourMinigame) {
      const baseY = MINIGAME_SPAWN_Y_OFFSET;
      const cfg = getParkourStageConfiguration(this.level, { x: 0, y: 0, z: 0 });
      const spawnCfg = getParkourStageConfiguration(this.level, {
        x: 0,
        y: MINIGAME_SPAWN_Y_OFFSET,
        z: 0
      });
      const sizeOffset = cfg.size;
      const spawnOffset = spawnCfg.startPos;
      const originCentered = this.getCenteredOrigin(
        this.box,
        this.box.location.y,
        sizeOffset
      );
      info(
        "Origin Centered = ",
        originCentered.x,
        originCentered.y,
        originCentered.z
      );
      const minForCheck = {
        x: originCentered.x,
        y: originCentered.y + MINIGAME_SPAWN_Y_OFFSET,
        z: originCentered.z
      };
      const { min: areaMin } = this.makeAabb(minForCheck, sizeOffset);
      const spawnLocation = {
        x: originCentered.x + spawnOffset.x,
        y: originCentered.y + spawnOffset.y,
        z: originCentered.z + spawnOffset.z
      };
      try {
        const heightLimit = this.box.location.y >= 220;
        if (heightLimit) {
          this.showObstructionWarning(true);
        } else {
          const isAreaClear = await this.isAreaClearAsync(
            this.mainPlayer,
            areaMin,
            sizeOffset,
            spawnLocation
          );
          if (this._areaDecisionMade)
            return;
          this._areaDecisionMade = true;
          if (isAreaClear) {
            new ParkourMinigame(
              this.box,
              this.level,
              originCentered,
              this.box.dimension,
              list,
              {
                formReward,
                costumeReward,
                accessoryReward
              }
            );
          } else {
            this.showObstructionWarning();
          }
        }
      } catch (e) {
        error(e);
      } finally {
        this._areaCheckInFlight = false;
      }
    } else if (chosenMinigame == MinigameTypes.CauldronMinigame) {
      const baseY = MINIGAME_SPAWN_Y_OFFSET;
      const cfg = getCauldronStageConfiguration(this.level, { x: 0, y: 0, z: 0 });
      const spawnCfg = getCauldronStageConfiguration(this.level, {
        x: 0,
        y: MINIGAME_SPAWN_Y_OFFSET,
        z: 0
      });
      const sizeOffset = cfg.size;
      const spawnOffset = spawnCfg.startPos;
      const originCentered = this.getCenteredOrigin(this.box, this.box.location.y, sizeOffset);
      info("Origin Centered = ", originCentered.x, originCentered.y, originCentered.z);
      const minForCheck = {
        x: originCentered.x,
        y: originCentered.y + MINIGAME_SPAWN_Y_OFFSET,
        z: originCentered.z
      };
      const { min: areaMin } = this.makeAabb(minForCheck, sizeOffset);
      const spawnLocation = {
        x: originCentered.x + spawnOffset.x,
        y: originCentered.y + spawnOffset.y,
        z: originCentered.z + spawnOffset.z
      };
      try {
        const heightLimit = this.box.location.y >= 220;
        if (heightLimit) {
          this.showObstructionWarning(true);
        } else {
          const isAreaClear = await this.isAreaClearAsync(
            this.mainPlayer,
            areaMin,
            sizeOffset,
            spawnLocation
          );
          if (this._areaDecisionMade)
            return;
          this._areaDecisionMade = true;
          if (isAreaClear) {
            new CauldronMinigame(
              this.box,
              this.level,
              originCentered,
              this.box.dimension,
              list,
              {
                formReward,
                costumeReward,
                accessoryReward
              }
            );
          } else {
            this.showObstructionWarning();
          }
        }
      } catch (e) {
        error(e);
      } finally {
        this._areaCheckInFlight = false;
      }
    } else if (chosenMinigame == MinigameTypes.SpiderDefenseMinigame) {
      new SpiderDefenseMinigame(
        this.box,
        this.level,
        this.origin,
        this.box.dimension,
        list,
        {
          formReward,
          costumeReward,
          accessoryReward
        }
      );
    }
    this.stop();
  }
  stop() {
    system21.clearRun(this.checkTick);
  }
};

// data/gametests/src/items/minigame/minigame_menu.ts
var MENU_ITEM_ID = "mco_nom:minigame_menu";
var log14 = Logger.getLogger("Minigame Manager");
function getMinigameData(player) {
  const minigameId = getPlayerMinigameId(player);
  const active = isMinigameRunning(minigameId);
  const raw = world21.getDynamicProperty(`mco_nom:minigame_data_${minigameId}`);
  let data = void 0;
  try {
    if (typeof raw === "string")
      data = JSON.parse(raw);
    else if (raw && typeof raw === "object")
      data = raw;
  } catch {
  }
  return { active: !!active, data };
}
function inMinigameFor(player, mg) {
  if (!mg || !mg.playerIDList)
    return false;
  return Array.isArray(mg.playerIDList) && mg.playerIDList.includes(player.id);
}
function formatSeconds(seconds) {
  if (seconds === void 0 || seconds === null || isNaN(seconds)) {
    return void 0;
  }
  if (seconds < 0) {
    return void 0;
  }
  const mins = Math.floor(seconds / 60);
  const secs = Math.floor(seconds % 60);
  const minsStr = mins.toString().padStart(2, "0");
  const secsStr = secs.toString().padStart(2, "0");
  return `${minsStr}:${secsStr}`;
}
world21.afterEvents.itemUse.subscribe(async (ev) => {
  const { itemStack, source } = ev;
  if (!(source instanceof Player17))
    return;
  if (!itemStack || itemStack.typeId !== MENU_ITEM_ID)
    return;
  const { active, data } = getMinigameData(source);
  const isIn = active && inMinigameFor(source, data);
  if (isIn) {
    const cookCount = source.getDynamicProperty("mco_nom:recipe_count") ?? 0;
    const globalCookCount = world21.getDynamicProperty(`mco_nom:global_cooks_${data.minigameId}`) ?? 0;
    const lines = [];
    const minigameType = data?.type ?? "";
    if (minigameType === "CauldronMinigame") {
      lines.push(`\xA77\xA7lRecipes Made: \xA7r\xA7l${cookCount}`);
      lines.push(`\xA77\xA7lRecipes Total: \xA7r\xA7l${globalCookCount}`);
    } else if (minigameType === "ParkourMinigame") {
      lines.push(
        `\xA77\xA7lCandy Collected: \xA7r\xA7l${source.getDynamicProperty("mco_nom:candy_count") ?? 0}/${data?.candyGoal ?? 10}`
      );
      lines.push(
        `\xA77\xA7lStars Collected: \xA7r\xA7l${source.getDynamicProperty("mco_nom:star_count") ?? 0}/${data?.starGoal ?? 3}`
      );
    } else if (minigameType == "SpiderDefenseMinigame") {
      lines.push(
        `\xA77\xA7lWave: \xA7r\xA7l${world21.getDynamicProperty(`mco_nom:defense_minigame_wave_${data.minigameId}`) ?? 0}`
      );
      lines.push(
        `\xA77\xA7lKills: \xA7r\xA7l${source.getDynamicProperty(`mco_nom:defense_minigame_kill_count`) ?? 0}`
      );
      lines.push(
        `\xA77\xA7lCandy HP: \xA7r\xA7l${world21.getDynamicProperty(`mco_nom:defense_minigame_hp_${data.minigameId}`) ?? 0}`
      );
    } else {
      lines.push(`Mini-Game: ${minigameType || "Unknown"}`);
    }
    const form = new ActionFormData2().title("\xA7lGame Menu").label(lines.join("\n")).label("\n").divider().button("\xA7lSettings", "textures/mco/nom/items/settings.png").button("\xA7lQuit Game", getIcon(minigameType) ?? UI_ICONS.Back);
    const res = await form.show(source);
    if (res.canceled)
      return;
    if (res.selection === 0) {
      play_button_sound(source);
      let prefMusic = source.getDynamicProperty("mco_nom:pref_music_enabled");
      if (typeof prefMusic === "undefined") {
        source.setDynamicProperty("mco_nom:pref_music_enabled", true);
        prefMusic = true;
      }
      const dialog = new ModalFormData2();
      dialog.title("\xA7lSettings");
      dialog.label("Minigame Music");
      dialog.toggle("Enable Music", { defaultValue: prefMusic });
      dialog.show(source).then((formData) => {
        if (formData.canceled)
          return;
        if (!formData.formValues || formData.formValues.length === 0)
          return;
        play_button_sound(source);
        const newPrefMusic = formData.formValues[1];
        if (newPrefMusic === prefMusic)
          return;
        try {
          source.setDynamicProperty("mco_nom:pref_music_enabled", newPrefMusic);
        } catch {
        }
        try {
          if (!newPrefMusic) {
            source.playMusic("mco_nom.music.empty" /* McoNomMusicEmpty */, { fade: 1 });
          } else {
            const { data: parsed } = getMinigameData(source);
            if (parsed && Array.isArray(parsed.playerIDList) && parsed.playerIDList.includes(source.id)) {
              try {
                source.playMusic(parsed.musicTrackName, {
                  loop: true,
                  fade: 2,
                  volume: 1
                });
              } catch {
              }
            }
          }
        } catch {
        }
      }).catch((err) => {
        `Settings Error: ${err}`;
      });
      return;
    } else if (res.selection === 1) {
      play_button_sound(source);
      const confirm = await new ActionFormData2().title("\xA7lQuit Game").label("\xA77\xA7lAre you sure you want to quit the minigame?\n\n").divider().button("\xA7lYes").button("\xA7lNo").show(source);
      if (confirm.canceled)
        return;
      if (confirm.selection === 0) {
        play_button_sound(source);
        source.setDynamicProperty("mco_nom:minigame_quit", true);
      } else if (confirm.selection === 1) {
        play_button_sound(source);
      }
      return;
    } else {
      play_button_sound(source);
      return;
    }
  } else {
    const form = new ActionFormData2().title("Game Menu").body("You are not currently in a minigame.").button("Close");
    await form.show(source);
    return;
  }
});
function play_button_sound(player) {
  player.playSound("mco_nom.ui.button_click" /* McoNomUiButtonClick */);
}

// data/gametests/src/items/ingredient/IngredientThrowerManager.ts
import { world as world24 } from "@minecraft/server";

// data/gametests/src/items/bubble_blower/utils/shootProjectile.ts
import { EntityComponentTypes as EntityComponentTypes4 } from "@minecraft/server";
function shootProjectile(entity, typeId, power, eventName) {
  const headLoc = entity.getHeadLocation();
  const viewVector = entity.getViewDirection();
  const direction = { x: headLoc.x + viewVector.x, y: headLoc.y + viewVector.y, z: headLoc.z + viewVector.z };
  const vel = { x: viewVector.x * power, y: viewVector.y * power, z: viewVector.z * power };
  const projectile = entity.dimension.spawnEntity(typeId, direction, {
    spawnEvent: eventName
  }).getComponent(EntityComponentTypes4.Projectile);
  if (!projectile)
    return;
  projectile.owner = entity;
  projectile.shoot(vel);
  return projectile;
}

// data/gametests/src/items/ingredient/IngredientAnimationManager.ts
import { EquipmentSlot as EquipmentSlot5, system as system23, world as world23 } from "@minecraft/server";
var log15 = Logger.getLogger("IngredientAnimationManager");
var IngredientAnimationManager = class _IngredientAnimationManager {
  constructor() {
    this.INGREDIENT_ITEMS = [
      "mco_nom:apple_ingredient",
      "mco_nom:butter_ingredient",
      "mco_nom:candy_ingredient",
      "mco_nom:chocolate_bar_ingredient",
      "mco_nom:flour_ingredient",
      "mco_nom:milk_ingredient",
      "mco_nom:strawberry_ingredient",
      "mco_nom:syrup_ingredient"
    ];
    this.ANIMATIONS = {
      EQUIP: { id: "animation.mco_nom.player.equip_ingredient", duration: 10, looping: false },
      // 0.5 seconds
      WADDLE: { id: "animation.mco_nom.player.waddle_ingredient", duration: 0, looping: true },
      // infinite loop
      TOSS: { id: "animation.mco_nom.player.toss_ingredient", duration: 10, looping: false },
      // 0.5 seconds
      BLANK: { id: "animation.mco_nom.player.init", duration: 2, looping: false }
    };
    this.playerAnimationStates = /* @__PURE__ */ new Map();
    this.playerLastHeldItem = /* @__PURE__ */ new Map();
    this.setUpEventListeners();
    this.startAnimationSystem();
  }
  static getInstance() {
    if (!_IngredientAnimationManager.instance) {
      _IngredientAnimationManager.instance = new _IngredientAnimationManager();
    }
    return _IngredientAnimationManager.instance;
  }
  setUpEventListeners() {
  }
  startAnimationSystem() {
    system23.runInterval(() => {
      this.updatePlayerAnimations();
    }, 1);
  }
  updatePlayerAnimations() {
    const players = world23.getPlayers();
    for (const player of players) {
      try {
        const currentHeldItem = this.getHeldIngredientItem(player);
        const lastHeldItem = this.playerLastHeldItem.get(player.id);
        let targetAnimation;
        if (currentHeldItem) {
          if (lastHeldItem !== currentHeldItem) {
            targetAnimation = "EQUIP";
            this.playerLastHeldItem.set(player.id, currentHeldItem);
          } else {
            targetAnimation = "WADDLE";
          }
        } else {
          targetAnimation = "BLANK";
          if (lastHeldItem) {
            this.playerLastHeldItem.delete(player.id);
          }
        }
        const currentState = this.playerAnimationStates.get(player.id);
        const currentTime = system23.currentTick;
        let shouldChangeAnimation = false;
        if (!currentState) {
          shouldChangeAnimation = true;
        } else if (currentState.animation === "EQUIP") {
          if (currentTime - currentState.startTime >= this.ANIMATIONS.EQUIP.duration) {
            shouldChangeAnimation = true;
          }
        } else if (currentState.animation === "TOSS") {
          if (currentTime - currentState.startTime >= this.ANIMATIONS.TOSS.duration) {
            shouldChangeAnimation = true;
          }
        } else if (currentState.animation !== targetAnimation) {
          shouldChangeAnimation = true;
        }
        if (shouldChangeAnimation) {
          try {
            const animConfig = this.ANIMATIONS[targetAnimation];
            const animationOptions = {
              controller: "controller.animation.mco_nom.player",
              nextState: animConfig.id,
              blendOutTime: 0.1
            };
            player.playAnimation(animConfig.id, animationOptions);
            this.playerAnimationStates.set(player.id, {
              animation: targetAnimation,
              startTime: currentTime
            });
          } catch (animError) {
            warn(`Failed to play animation ${targetAnimation} for player ${player.id}:`, animError);
          }
        }
      } catch (error2) {
        warn(`Error updating animation for player ${player.id}:`, error2);
        continue;
      }
    }
  }
  getHeldIngredientItem(player) {
    try {
      const equippable = player.getComponent("equippable");
      if (!equippable)
        return null;
      const mainhandItem = equippable.getEquipment(EquipmentSlot5.Mainhand);
      if (!mainhandItem)
        return null;
      if (this.INGREDIENT_ITEMS.includes(mainhandItem.typeId)) {
        return mainhandItem.typeId;
      }
      return null;
    } catch (error2) {
      return null;
    }
  }
  // Public method to trigger toss animation (called from IngredientThrowerManager)
  playTossAnimation(player) {
    try {
      const animationOptions = {
        controller: "controller.animation.mco_nom.player",
        nextState: this.ANIMATIONS.TOSS.id,
        blendOutTime: 0.1
      };
      player.playAnimation(this.ANIMATIONS.TOSS.id, animationOptions);
      this.playerAnimationStates.set(player.id, {
        animation: "TOSS",
        startTime: system23.currentTick
      });
    } catch (error2) {
      warn(`Failed to play toss animation for player ${player.id}:`, error2);
    }
  }
};
var ingredientAnimationManager = IngredientAnimationManager.getInstance();

// data/gametests/src/items/ingredient/IngredientThrowerManager.ts
var log16 = Logger.getLogger("IngredientThrowerManager");
var IngredientThrowerManager = class _IngredientThrowerManager {
  constructor() {
    this.INGREDIENTS_PROJECTILES = {
      "mco_nom:apple_ingredient_item": "mco_nom:apple_ingredient_projectile",
      "mco_nom:butter_ingredient_item": "mco_nom:butter_ingredient_projectile",
      "mco_nom:candy_ingredient_item": "mco_nom:candy_ingredient_projectile",
      "mco_nom:chocolate_bar_ingredient_item": "mco_nom:chocolate_bar_ingredient_projectile",
      "mco_nom:flour_ingredient_item": "mco_nom:flour_ingredient_projectile",
      "mco_nom:milk_ingredient_item": "mco_nom:milk_ingredient_projectile",
      "mco_nom:strawberry_ingredient_item": "mco_nom:strawberry_ingredient_projectile",
      "mco_nom:syrup_ingredient_item": "mco_nom:syrup_ingredient_projectile"
    };
    this.setUpEventListeners();
  }
  static getInstance() {
    if (!_IngredientThrowerManager.instance) {
      _IngredientThrowerManager.instance = new _IngredientThrowerManager();
    }
    return _IngredientThrowerManager.instance;
  }
  setUpEventListeners() {
    world24.afterEvents.itemCompleteUse.subscribe((event) => {
      const { source, itemStack } = event;
      if (itemStack && itemStack.hasTag("mco_nom:ingredient")) {
        for (const [itemId, projectileId] of Object.entries(
          this.INGREDIENTS_PROJECTILES
        )) {
          if (itemStack.typeId === itemId) {
            shootProjectile(source, projectileId, 1.2);
            ingredientAnimationManager.playTossAnimation(source);
            const soundProps = {
              volume: 0.2,
              pitch: 0.9 + Math.random() * 0.2
            };
            source.playSound("mco_nom.throw" /* McoNomThrow */, soundProps);
          }
        }
      }
    });
  }
};
var ingredientThrowerManager = IngredientThrowerManager.getInstance();

// data/gametests/src/items/index.ts
eatStackItemsManager.registerStrategy(candyStrategy);
eatStackItemsManager.registerStrategy(donutStrategy);

// data/gametests/src/blocks/index.ts
import { system as system37 } from "@minecraft/server";

// data/gametests/src/blocks/block_set/slab.ts
import {
  BlockPermutation as BlockPermutation2,
  Direction as Direction3,
  EquipmentSlot as EquipmentSlot6,
  GameMode as GameMode4
} from "@minecraft/server";
var SlabBlockComponent = class {
  onPlayerInteract({ block, player, face }) {
    if (!player || !block?.isValid)
      return;
    const isDouble = block.permutation.getState("mco_nom:double");
    if (isDouble)
      return;
    const equipment = player.getComponent("equippable");
    const selectedItem = equipment?.getEquipment(
      EquipmentSlot6.Mainhand
    );
    if (!selectedItem || selectedItem.typeId !== block.typeId)
      return;
    const half = block.permutation.getState("minecraft:vertical_half");
    const isBottomUp = half === "bottom" && face === Direction3.Up;
    const isTopDown = half === "top" && face === Direction3.Down;
    if (!isBottomUp && !isTopDown)
      return;
    if (player.getGameMode() !== GameMode4.Creative) {
      if ((selectedItem.amount ?? 0) > 1) {
        selectedItem.amount -= 1;
        equipment?.setEquipment(EquipmentSlot6.Mainhand, selectedItem);
      } else {
        equipment?.setEquipment(EquipmentSlot6.Mainhand, void 0);
      }
    }
    const newPerm = BlockPermutation2.resolve(block.typeId, {
      ...block.permutation.getAllStates(),
      ["mco_nom:double"]: true
    });
    block.setPermutation(newPerm);
    player.playSound("step.wood");
  }
};
var SlabDestroyComponent = class {
  onPlayerBreak({
    block,
    dimension,
    brokenBlockPermutation
  }) {
    if (!block?.isValid)
      return;
    const wasDouble = brokenBlockPermutation.getState("mco_nom:double");
    if (!wasDouble)
      return;
    const extra = brokenBlockPermutation.getItemStack(1);
    if (extra) {
      dimension.spawnItem(extra, {
        x: block.location.x + 0.5,
        y: block.location.y + 0.5,
        z: block.location.z + 0.5
      });
    }
  }
};
var SlabComponentId = "mco_nom:slab";
var SlabDestroyComponentId = "mco_nom:slabDestroy";

// data/gametests/src/blocks/block_set/trapdoor.ts
function rndFloat(range) {
  return Math.random() * (range.max - range.min) + range.min;
}
var TrapdoorBlockComponent = class {
  constructor() {
  }
  onPlayerInteract({ block, dimension }) {
    let open = block.permutation.getState("mco_nom:open");
    if (open === void 0)
      return;
    open = !open;
    if (open === true) {
      dimension.playSound("open.wooden_trapdoor", block.location, {
        volume: 0.9,
        pitch: rndFloat({ min: 0.9, max: 1 })
      });
    } else if (open === false) {
      dimension.playSound("close.wooden_trapdoor", block.location, {
        volume: 0.9,
        pitch: rndFloat({ min: 0.9, max: 1 })
      });
    }
    block.setPermutation(block.permutation.withState("mco_nom:open", open));
  }
};

// data/gametests/src/blocks/block_set/fence.ts
import {
  BlockPermutation as BlockPermutation3,
  system as system24,
  world as world25
} from "@minecraft/server";

// data/gametests/src/blocks/utils.ts
var solidBlocks = (
  /** @type {const} */
  [
    "minecraft:acacia_log",
    "minecraft:acacia_planks",
    "minecraft:acacia_double_slab",
    "minecraft:acacia_wood",
    "minecraft:amethyst_block",
    "minecraft:amethyst_cluster",
    "minecraft:ancient_debris",
    "minecraft:andesite",
    "minecraft:andesite_double_slab",
    "minecraft:bamboo_block",
    "minecraft:bamboo_mosaic",
    "minecraft:bamboo_mosaic_double_slab",
    "minecraft:bamboo_planks",
    "minecraft:bamboo_double_slab",
    "minecraft:barrel",
    "minecraft:basalt",
    "minecraft:beacon",
    "minecraft:bedrock",
    "minecraft:bee_nest",
    "minecraft:beehive",
    "minecraft:birch_log",
    "minecraft:birch_planks",
    "minecraft:birch_double_slab",
    "minecraft:birch_wood",
    "minecraft:black_concrete",
    "minecraft:black_concrete_powder",
    "minecraft:black_glazed_terracotta",
    "minecraft:black_stained_glass",
    "minecraft:black_terracotta",
    "minecraft:black_wool",
    "minecraft:blackstone",
    "minecraft:blackstone_double_slab",
    "minecraft:blast_furnace",
    "minecraft:blue_concrete",
    "minecraft:blue_concrete_powder",
    "minecraft:blue_glazed_terracotta",
    "minecraft:blue_ice",
    "minecraft:blue_stained_glass",
    "minecraft:blue_terracotta",
    "minecraft:blue_wool",
    "minecraft:bone_block",
    "minecraft:bookshelf",
    "minecraft:brain_coral_block",
    "minecraft:brick_double_slab",
    "minecraft:bricks",
    "minecraft:brown_concrete",
    "minecraft:brown_concrete_powder",
    "minecraft:brown_glazed_terracotta",
    "minecraft:brown_mushroom_block",
    "minecraft:brown_stained_glass",
    "minecraft:brown_terracotta",
    "minecraft:brown_wool",
    "minecraft:bubble_coral_block",
    "minecraft:calcite",
    "minecraft:cartography_table",
    "minecraft:carved_pumpkin",
    "minecraft:chain_command_block",
    "minecraft:cherry_log",
    "minecraft:cherry_planks",
    "minecraft:cherry_double_slab",
    "minecraft:cherry_wood",
    "minecraft:chiseled_bookshelf",
    "minecraft:chiseled_copper",
    "minecraft:chiseled_deepslate",
    "minecraft:chiseled_nether_bricks",
    "minecraft:chiseled_polished_blackstone",
    "minecraft:chiseled_quartz_block",
    "minecraft:chiseled_red_sandstone",
    "minecraft:chiseled_resin_bricks",
    "minecraft:chiseled_sandstone",
    "minecraft:chiseled_stone_bricks",
    "minecraft:chiseled_tuff",
    "minecraft:chiseled_tuff_bricks",
    "minecraft:clay",
    "minecraft:coal_block",
    "minecraft:coal_ore",
    "minecraft:coarse_dirt",
    "minecraft:cobbled_deepslate",
    "minecraft:cobbled_deepslate_double_slab",
    "minecraft:cobblestone",
    "minecraft:cobblestone_double_slab",
    "minecraft:command_block",
    "minecraft:copper_block",
    "minecraft:copper_bulb",
    "minecraft:copper_grate",
    "minecraft:copper_ore",
    "minecraft:cracked_deepslate_bricks",
    "minecraft:cracked_deepslate_tiles",
    "minecraft:cracked_nether_bricks",
    "minecraft:cracked_polished_blackstone_bricks",
    "minecraft:cracked_stone_bricks",
    "minecraft:crafter",
    "minecraft:crafting_table",
    "minecraft:creaking_heart",
    "minecraft:crimson_hyphae",
    "minecraft:crimson_planks",
    "minecraft:crimson_double_slab",
    "minecraft:crimson_stem",
    "minecraft:crying_obsidian",
    "minecraft:cut_copper",
    "minecraft:cut_copper_double_slab",
    "minecraft:cut_red_sandstone",
    "minecraft:cut_red_sandstone_double_slab",
    "minecraft:cut_sandstone",
    "minecraft:cut_sandstone_double_slab",
    "minecraft:cyan_concrete",
    "minecraft:cyan_concrete_powder",
    "minecraft:cyan_glazed_terracotta",
    "minecraft:cyan_stained_glass",
    "minecraft:cyan_terracotta",
    "minecraft:cyan_wool",
    "minecraft:dark_oak_log",
    "minecraft:dark_oak_planks",
    "minecraft:dark_oak_double_slab",
    "minecraft:dark_oak_wood",
    "minecraft:dark_prismarine",
    "minecraft:dark_prismarine_double_slab",
    "minecraft:dead_brain_coral_block",
    "minecraft:dead_bubble_coral_block",
    "minecraft:dead_fire_coral_block",
    "minecraft:dead_horn_coral_block",
    "minecraft:dead_tube_coral_block",
    "minecraft:deepslate",
    "minecraft:deepslate_brick_double_slab",
    "minecraft:deepslate_bricks",
    "minecraft:deepslate_coal_ore",
    "minecraft:deepslate_copper_ore",
    "minecraft:deepslate_diamond_ore",
    "minecraft:deepslate_emerald_ore",
    "minecraft:deepslate_gold_ore",
    "minecraft:deepslate_iron_ore",
    "minecraft:deepslate_lapis_ore",
    "minecraft:deepslate_redstone_ore",
    "minecraft:deepslate_tile_double_slab",
    "minecraft:deepslate_tiles",
    "minecraft:diamond_block",
    "minecraft:diamond_ore",
    "minecraft:diorite",
    "minecraft:diorite_double_slab",
    "minecraft:dirt",
    "minecraft:dirt_path",
    "minecraft:dispenser",
    "minecraft:dried_kelp_block",
    "minecraft:dripstone_block",
    "minecraft:dropper",
    "minecraft:emerald_block",
    "minecraft:emerald_ore",
    "minecraft:end_stone",
    "minecraft:end_stone_brick_double_slab",
    "minecraft:end_stone_bricks",
    "minecraft:exposed_chiseled_copper",
    "minecraft:exposed_copper",
    "minecraft:exposed_copper_bulb",
    "minecraft:exposed_cut_copper",
    "minecraft:exposed_cut_copper_double_slab",
    "minecraft:farmland",
    "minecraft:fire_coral_block",
    "minecraft:fletching_table",
    "minecraft:furnace",
    "minecraft:gilded_blackstone",
    "minecraft:glass",
    "minecraft:glowstone",
    "minecraft:gold_block",
    "minecraft:gold_ore",
    "minecraft:granite",
    "minecraft:granite_double_slab",
    "minecraft:grass_block",
    "minecraft:gravel",
    "minecraft:gray_concrete",
    "minecraft:gray_concrete_powder",
    "minecraft:gray_glazed_terracotta",
    "minecraft:gray_stained_glass",
    "minecraft:gray_terracotta",
    "minecraft:gray_wool",
    "minecraft:green_concrete",
    "minecraft:green_concrete_powder",
    "minecraft:green_glazed_terracotta",
    "minecraft:green_stained_glass",
    "minecraft:green_terracotta",
    "minecraft:green_wool",
    "minecraft:hay_block",
    "minecraft:honey_block",
    "minecraft:honeycomb_block",
    "minecraft:horn_coral_block",
    "minecraft:ice",
    "minecraft:infested_chiseled_stone_bricks",
    "minecraft:infested_cobblestone",
    "minecraft:infested_cracked_stone_bricks",
    "minecraft:infested_deepslate",
    "minecraft:infested_mossy_stone_bricks",
    "minecraft:infested_stone",
    "minecraft:infested_stone_bricks",
    "minecraft:iron_block",
    "minecraft:iron_ore",
    "minecraft:jack_o_lantern",
    "minecraft:jukebox",
    "minecraft:jungle_log",
    "minecraft:jungle_planks",
    "minecraft:jungle_double_slab",
    "minecraft:jungle_wood",
    "minecraft:lapis_block",
    "minecraft:lapis_ore",
    "minecraft:light_blue_concrete",
    "minecraft:light_blue_concrete_powder",
    "minecraft:light_blue_glazed_terracotta",
    "minecraft:light_blue_stained_glass",
    "minecraft:light_blue_terracotta",
    "minecraft:light_blue_wool",
    "minecraft:light_gray_concrete",
    "minecraft:light_gray_concrete_powder",
    "minecraft:light_gray_glazed_terracotta",
    "minecraft:light_gray_stained_glass",
    "minecraft:light_gray_terracotta",
    "minecraft:light_gray_wool",
    "minecraft:lime_concrete",
    "minecraft:lime_concrete_powder",
    "minecraft:lime_glazed_terracotta",
    "minecraft:lime_stained_glass",
    "minecraft:lime_terracotta",
    "minecraft:lime_wool",
    "minecraft:lodestone",
    "minecraft:loom",
    "minecraft:magenta_concrete",
    "minecraft:magenta_concrete_powder",
    "minecraft:magenta_glazed_terracotta",
    "minecraft:magenta_stained_glass",
    "minecraft:magenta_terracotta",
    "minecraft:magenta_wool",
    "minecraft:magma_block",
    "minecraft:mangrove_log",
    "minecraft:mangrove_planks",
    "minecraft:mangrove_roots",
    "minecraft:mangrove_double_slab",
    "minecraft:mangrove_wood",
    "minecraft:melon",
    "minecraft:moss_block",
    "minecraft:mossy_cobblestone",
    "minecraft:mossy_cobblestone_double_slab",
    "minecraft:mossy_stone_brick_double_slab",
    "minecraft:mossy_stone_bricks",
    "minecraft:mud",
    "minecraft:mud_brick_double_slab",
    "minecraft:mud_bricks",
    "minecraft:muddy_mangrove_roots",
    "minecraft:mushroom_stem",
    "minecraft:mycelium",
    "minecraft:nether_brick_double_slab",
    "minecraft:nether_bricks",
    "minecraft:nether_gold_ore",
    "minecraft:nether_quartz_ore",
    "minecraft:nether_wart_block",
    "minecraft:netherite_block",
    "minecraft:netherrack",
    "minecraft:note_block",
    "minecraft:oak_log",
    "minecraft:oak_planks",
    "minecraft:oak_double_slab",
    "minecraft:oak_wood",
    "minecraft:observer",
    "minecraft:obsidian",
    "minecraft:ochre_froglight",
    "minecraft:orange_concrete",
    "minecraft:orange_concrete_powder",
    "minecraft:orange_glazed_terracotta",
    "minecraft:orange_stained_glass",
    "minecraft:orange_terracotta",
    "minecraft:orange_wool",
    "minecraft:oxidized_chiseled_copper",
    "minecraft:oxidized_copper",
    "minecraft:oxidized_copper_bulb",
    "minecraft:oxidized_cut_copper",
    "minecraft:oxidized_cut_copper_double_slab",
    "minecraft:packed_ice",
    "minecraft:packed_mud",
    "minecraft:pale_moss_block",
    "minecraft:pale_oak_log",
    "minecraft:pale_oak_planks",
    "minecraft:pale_oak_double_slab",
    "minecraft:pale_oak_wood",
    "minecraft:pearlescent_froglight",
    "minecraft:petrified_oak_double_slab",
    "minecraft:pink_concrete",
    "minecraft:pink_concrete_powder",
    "minecraft:pink_glazed_terracotta",
    "minecraft:pink_stained_glass",
    "minecraft:pink_terracotta",
    "minecraft:pink_wool",
    "minecraft:podzol",
    "minecraft:polished_andesite",
    "minecraft:polished_andesite_double_slab",
    "minecraft:polished_basalt",
    "minecraft:polished_blackstone",
    "minecraft:polished_blackstone_brick_double_slab",
    "minecraft:polished_blackstone_bricks",
    "minecraft:polished_blackstone_double_slab",
    "minecraft:polished_deepslate",
    "minecraft:polished_deepslate_double_slab",
    "minecraft:polished_diorite",
    "minecraft:polished_diorite_double_slab",
    "minecraft:polished_granite",
    "minecraft:polished_granite_double_slab",
    "minecraft:polished_tuff",
    "minecraft:polished_tuff_double_slab",
    "minecraft:prismarine",
    "minecraft:prismarine_brick_double_slab",
    "minecraft:prismarine_bricks",
    "minecraft:prismarine_double_slab",
    "minecraft:pumpkin",
    "minecraft:purple_concrete",
    "minecraft:purple_concrete_powder",
    "minecraft:purple_glazed_terracotta",
    "minecraft:purple_stained_glass",
    "minecraft:purple_terracotta",
    "minecraft:purple_wool",
    "minecraft:purpur_block",
    "minecraft:purpur_pillar",
    "minecraft:purpur_double_slab",
    "minecraft:quartz_block",
    "minecraft:quartz_bricks",
    "minecraft:quartz_pillar",
    "minecraft:quartz_double_slab",
    "minecraft:raw_copper_block",
    "minecraft:raw_gold_block",
    "minecraft:raw_iron_block",
    "minecraft:red_concrete",
    "minecraft:red_concrete_powder",
    "minecraft:red_glazed_terracotta",
    "minecraft:red_mushroom_block",
    "minecraft:red_nether_brick_double_slab",
    "minecraft:red_nether_bricks",
    "minecraft:red_sand",
    "minecraft:red_sandstone",
    "minecraft:red_sandstone_double_slab",
    "minecraft:red_stained_glass",
    "minecraft:red_terracotta",
    "minecraft:red_wool",
    "minecraft:redstone_block",
    "minecraft:redstone_lamp",
    "minecraft:redstone_ore",
    "minecraft:reinforced_deepslate",
    "minecraft:repeating_command_block",
    "minecraft:resin_block",
    "minecraft:resin_brick_double_slab",
    "minecraft:resin_bricks",
    "minecraft:respawn_anchor",
    "minecraft:rooted_dirt",
    "minecraft:sand",
    "minecraft:sandstone",
    "minecraft:sandstone_double_slab",
    "minecraft:sculk",
    "minecraft:sculk_catalyst",
    "minecraft:sea_lantern",
    "minecraft:shroomlight",
    "minecraft:slime_block",
    "minecraft:smithing_table",
    "minecraft:smoker",
    "minecraft:smooth_basalt",
    "minecraft:smooth_quartz",
    "minecraft:smooth_quartz_double_slab",
    "minecraft:smooth_red_sandstone",
    "minecraft:smooth_red_sandstone_double_slab",
    "minecraft:smooth_sandstone",
    "minecraft:smooth_sandstone_double_slab",
    "minecraft:smooth_stone",
    "minecraft:smooth_stone_double_slab",
    "minecraft:snow_block",
    "minecraft:soul_sand",
    "minecraft:soul_soil",
    "minecraft:spawner",
    "minecraft:sponge",
    "minecraft:spruce_log",
    "minecraft:spruce_planks",
    "minecraft:spruce_double_slab",
    "minecraft:spruce_wood",
    "minecraft:sticky_piston",
    "minecraft:stone",
    "minecraft:stone_brick_double_slab",
    "minecraft:stone_bricks",
    "minecraft:stone_double_slab",
    "minecraft:stripped_acacia_log",
    "minecraft:stripped_acacia_wood",
    "minecraft:stripped_bamboo_block",
    "minecraft:stripped_birch_log",
    "minecraft:stripped_birch_wood",
    "minecraft:stripped_cherry_log",
    "minecraft:stripped_cherry_wood",
    "minecraft:stripped_crimson_hyphae",
    "minecraft:stripped_crimson_stem",
    "minecraft:stripped_dark_oak_log",
    "minecraft:stripped_dark_oak_wood",
    "minecraft:stripped_jungle_log",
    "minecraft:stripped_jungle_wood",
    "minecraft:stripped_mangrove_log",
    "minecraft:stripped_mangrove_wood",
    "minecraft:stripped_oak_log",
    "minecraft:stripped_oak_wood",
    "minecraft:stripped_pale_oak_log",
    "minecraft:stripped_pale_oak_wood",
    "minecraft:stripped_spruce_log",
    "minecraft:stripped_spruce_wood",
    "minecraft:stripped_warped_hyphae",
    "minecraft:stripped_warped_stem",
    "minecraft:suspicious_gravel",
    "minecraft:suspicious_sand",
    "minecraft:target",
    "minecraft:terracotta",
    "minecraft:tinted_glass",
    "minecraft:tnt",
    "minecraft:trial_spawner",
    "minecraft:tube_coral_block",
    "minecraft:tuff",
    "minecraft:tuff_brick_double_slab",
    "minecraft:tuff_bricks",
    "minecraft:tuff_double_slab",
    "minecraft:vault",
    "minecraft:verdant_froglight",
    "minecraft:warped_hyphae",
    "minecraft:warped_planks",
    "minecraft:warped_double_slab",
    "minecraft:warped_stem",
    "minecraft:warped_wart_block",
    "minecraft:waxed_chiseled_copper",
    "minecraft:waxed_copper_block",
    "minecraft:waxed_copper_bulb",
    "minecraft:waxed_cut_copper",
    "minecraft:waxed_cut_copper_double_slab",
    "minecraft:waxed_exposed_chiseled_copper",
    "minecraft:waxed_exposed_copper",
    "minecraft:waxed_exposed_copper_bulb",
    "minecraft:waxed_exposed_cut_copper",
    "minecraft:waxed_exposed_cut_copper_double_slab",
    "minecraft:waxed_oxidized_chiseled_copper",
    "minecraft:waxed_oxidized_copper",
    "minecraft:waxed_oxidized_copper_bulb",
    "minecraft:waxed_oxidized_cut_copper",
    "minecraft:waxed_oxidized_cut_copper_double_slab",
    "minecraft:waxed_weathered_chiseled_copper",
    "minecraft:waxed_weathered_copper",
    "minecraft:waxed_weathered_copper_bulb",
    "minecraft:waxed_weathered_cut_copper",
    "minecraft:waxed_weathered_cut_copper_double_slab",
    "minecraft:weathered_chiseled_copper",
    "minecraft:weathered_copper",
    "minecraft:weathered_copper_bulb",
    "minecraft:weathered_cut_copper",
    "minecraft:weathered_cut_copper_double_slab",
    "minecraft:wet_sponge",
    "minecraft:white_concrete",
    "minecraft:white_concrete_powder",
    "minecraft:white_glazed_terracotta",
    "minecraft:white_stained_glass",
    "minecraft:white_terracotta",
    "minecraft:white_wool",
    "minecraft:yellow_concrete",
    "minecraft:yellow_concrete_powder",
    "minecraft:yellow_glazed_terracotta",
    "minecraft:yellow_stained_glass",
    "minecraft:yellow_terracotta",
    "minecraft:yellow_wool"
  ]
);
var connectableBlocks = (
  /** @type {const} */
  [
    "minecraft:acacia_fence",
    "minecraft:acacia_fence_gate",
    "minecraft:andesite_wall",
    "minecraft:bamboo_fence",
    "minecraft:bamboo_fence_gate",
    "minecraft:birch_fence",
    "minecraft:birch_fence_gate",
    "minecraft:black_stained_glass_pane",
    "minecraft:blackstone_wall",
    "minecraft:blue_stained_glass_pane",
    "minecraft:brick_wall",
    "minecraft:brown_stained_glass_pane",
    "minecraft:cherry_fence",
    "minecraft:cherry_fence_gate",
    "minecraft:cobbled_deepslate_wall",
    "minecraft:cobblestone_wall",
    "minecraft:crimson_fence",
    "minecraft:crimson_fence_gate",
    "minecraft:cyan_stained_glass_pane",
    "minecraft:dark_oak_fence",
    "minecraft:dark_oak_fence_gate",
    "minecraft:deepslate_brick_wall",
    "minecraft:deepslate_tile_wall",
    "minecraft:diorite_wall",
    "minecraft:end_stone_brick_wall",
    "minecraft:glass_pane",
    "minecraft:granite_wall",
    "minecraft:gray_stained_glass_pane",
    "minecraft:green_stained_glass_pane",
    "minecraft:jungle_fence",
    "minecraft:jungle_fence_gate",
    "minecraft:light_blue_stained_glass_pane",
    "minecraft:light_gray_stained_glass_pane",
    "minecraft:lime_stained_glass_pane",
    "minecraft:magenta_stained_glass_pane",
    "minecraft:mangrove_fence",
    "minecraft:mangrove_fence_gate",
    "minecraft:mossy_cobblestone_wall",
    "minecraft:mossy_stone_brick_wall",
    "minecraft:mud_brick_wall",
    "minecraft:nether_brick_fence",
    "minecraft:nether_brick_wall",
    "minecraft:oak_fence",
    "minecraft:oak_fence_gate",
    "minecraft:orange_stained_glass_pane",
    "minecraft:pale_oak_fence",
    "minecraft:pale_oak_fence_gate",
    "minecraft:pink_stained_glass_pane",
    "minecraft:polished_blackstone_brick_wall",
    "minecraft:polished_blackstone_wall",
    "minecraft:polished_deepslate_wall",
    "minecraft:polished_tuff_wall",
    "minecraft:prismarine_wall",
    "minecraft:purple_stained_glass_pane",
    "minecraft:red_nether_brick_wall",
    "minecraft:red_sandstone_wall",
    "minecraft:red_stained_glass_pane",
    "minecraft:resin_brick_wall",
    "minecraft:sandstone_wall",
    "minecraft:spruce_fence",
    "minecraft:spruce_fence_gate",
    "minecraft:stone_brick_wall",
    "minecraft:tuff_brick_wall",
    "minecraft:tuff_wall",
    "minecraft:warped_fence",
    "minecraft:warped_fence_gate",
    "minecraft:white_stained_glass_pane",
    "minecraft:yellow_stained_glass_pane"
  ]
);
function getCustomState(block, state) {
  return block.permutation.getState(state);
}

// data/gametests/src/blocks/block_set/fence.ts
var FENCE_TAG = "mco_nom:is_fence";
var CONNECT_TAG = "mco_nom:is_connectable";
var CONNECT_SIDES = ["north", "south", "east", "west"];
var FenceBlockComponent = class _FenceBlockComponent {
  constructor() {
  }
  beforeOnPlayerPlace({ block }) {
    system24.run(() => {
      _FenceBlockComponent.updateFencesAround(block);
    });
  }
  onPlayerBreak({ block }) {
    _FenceBlockComponent.updateFencesAround(block);
  }
  static updateFenceStates(fence) {
    if (!fence || !fence.isValid)
      return;
    const neighbors = {
      north: fence.north(),
      south: fence.south(),
      east: fence.east(),
      west: fence.west()
    };
    const currentStates = fence.permutation.getAllStates();
    const newStates = {};
    for (const side of CONNECT_SIDES) {
      const neighbor = neighbors[side];
      let shouldConnect = false;
      if (neighbor && neighbor.isValid) {
        const id = neighbor.typeId;
        if (id.endsWith("fence_gate")) {
          const facing = neighbor.permutation.getState(
            "minecraft:cardinal_direction"
          );
          if (facing) {
            if ((facing === "north" || facing === "south") && (side === "east" || side === "west")) {
              shouldConnect = true;
            }
            if ((facing === "east" || facing === "west") && (side === "north" || side === "south")) {
              shouldConnect = true;
            }
            `[FenceDebug] Fence at ${fence.location.x},${fence.location.y},${fence.location.z} ${shouldConnect ? "CONNECTED" : "BLOCKED"} to fence_gate at ${neighbor.location.x},${neighbor.location.y},${neighbor.location.z} facing=${facing}`;
          }
        } else {
          shouldConnect = neighbor.hasTag(FENCE_TAG) || neighbor.hasTag(CONNECT_TAG) || connectableBlocks.includes(id) || solidBlocks.includes(id);
        }
      }
      newStates[`mco_nom:connect_${side}`] = shouldConnect;
    }
    fence.setPermutation(
      BlockPermutation3.resolve(fence.typeId, {
        ...currentStates,
        ...newStates
      })
    );
  }
  static updateFencesAround(center) {
    if (!center || !center.isValid)
      return;
    const blocksToUpdate = [
      center,
      center.north(),
      center.south(),
      center.east(),
      center.west()
    ];
    for (const block of blocksToUpdate) {
      if (block && block.isValid && block.hasTag(FENCE_TAG)) {
        _FenceBlockComponent.updateFenceStates(block);
      }
    }
  }
};
world25.afterEvents.playerPlaceBlock.subscribe(({ block }) => {
  for (const neighbor of [block.north(), block.south(), block.east(), block.west()]) {
    if (neighbor && neighbor.isValid && neighbor.hasTag(FENCE_TAG)) {
      FenceBlockComponent.updateFencesAround(neighbor);
    }
  }
});
world25.afterEvents.playerBreakBlock.subscribe(({ block }) => {
  for (const neighbor of [block.north(), block.south(), block.east(), block.west()]) {
    if (neighbor && neighbor.isValid && neighbor.hasTag(FENCE_TAG)) {
      FenceBlockComponent.updateFencesAround(neighbor);
    }
  }
});

// data/gametests/src/blocks/block_set/door.ts
import {
  world as world26,
  system as system25,
  ItemStack as ItemStack10,
  BlockPermutation as BlockPermutation4,
  GameMode as GameMode5
} from "@minecraft/server";

// data/gametests/src/blocks/redstone.ts
var RedstoneManager = class _RedstoneManager {
  static powered(block, tag) {
    if (tag && !block.hasTag(tag))
      return false;
    const dirs = [
      () => block.above(1),
      () => block.below(1),
      () => block.north(1),
      () => block.south(1),
      () => block.east(1),
      () => block.west(1)
    ];
    for (const dir of dirs) {
      let side;
      try {
        side = dir();
      } catch {
      }
      if (!side)
        continue;
      if (side.typeId === "minecraft:redstone_block" || side.typeId === "minecraft:redstone_torch") {
        return true;
      }
      const power = side.getRedstonePower?.();
      if (power !== void 0 && power > 0)
        return true;
    }
    return false;
  }
  static isPowered(block, options) {
    return _RedstoneManager.powered(block, options?.tag);
  }
  static redstonePowerAfterEvent(block, event, options) {
    const tag = options?.tag;
    const poweredState = options?.poweredState ?? "mco_nom:powered";
    if (tag && !block.hasTag(tag))
      return;
    const state = block.permutation.getState(poweredState);
    const powered = _RedstoneManager.powered(block, tag);
    if (state) {
      if (!powered) {
        block.setPermutation(block.permutation.withState(poweredState, false));
        event.onUnpowered?.(block);
      }
      return;
    }
    if (!powered)
      return;
    block.setPermutation(block.permutation.withState(poweredState, true));
    event.onPowered?.(block);
  }
};

// data/gametests/src/blocks/block_set/door.ts
function spawnItemAnywhere(item, location, dimension) {
  const itemEntity = dimension.spawnItem(item, { x: location.x, y: 100, z: location.z });
  itemEntity.teleport(location);
  return itemEntity;
}
var _DoorBlockComponent = class _DoorBlockComponent {
  constructor() {
  }
  // Door logic
  static interactWithDoor(block) {
    const dim = block.dimension;
    const loc = block.location;
    const topHalf = block.permutation.getState("mco_nom:upper_block_bit");
    let open = block.permutation.getState("mco_nom:open_bit");
    let doorPart;
    try {
      doorPart = topHalf ? block.below(1) : block.above(1);
    } catch {
    }
    if (doorPart === void 0)
      return;
    const data = _DoorBlockComponent.DOORS.find((f) => f.id == block.typeId);
    open = !open;
    if (data) {
      const sound = open ? data.openSound : data.closeSound;
      if (sound)
        dim.playSound(sound.id, loc, { pitch: sound.pitch, volume: sound.volume });
    }
    for (const door of [block, doorPart]) {
      try {
        door.setPermutation(
          door.permutation.withState("mco_nom:open_bit", open)
        );
      } catch {
      }
    }
  }
  static breakDoor(blockID, block, topHalf, drop = true) {
    system25.runTimeout(() => {
      let doorPart;
      try {
        doorPart = topHalf ? block.below(1) : block.above(1);
      } catch {
      }
      if (doorPart && doorPart.hasTag(_DoorBlockComponent.DOOR_TAG))
        doorPart.setPermutation(BlockPermutation4.resolve("minecraft:air"));
      const data = _DoorBlockComponent.DOORS.find((f) => f.id == blockID);
      if (data === void 0)
        return;
      const item = new ItemStack10(data.itemID, 1);
      block.dimension.playSound(data.breakSound?.id ?? "dig.wood", block.location, {
        pitch: data.breakSound?.pitch ?? 1,
        volume: data.breakSound?.volume ?? 1
      });
      if (drop) {
        spawnItemAnywhere(
          item,
          new Vec3(block.location).add(0.5, 0.5, 0.5),
          block.dimension
        );
      }
      block.setPermutation(BlockPermutation4.resolve("minecraft:air"));
    });
  }
  static placeDoor(block, above) {
    system25.runTimeout(() => {
      let reversed = false;
      const facing = block.permutation.getState("minecraft:cardinal_direction");
      const checkNeighbor = (neighbor) => {
        if (neighbor && neighbor.typeId.includes("door")) {
          const other_facing = neighbor.permutation.getState(
            "minecraft:cardinal_direction"
          );
          if (other_facing == facing)
            reversed = true;
        }
      };
      try {
        switch (facing) {
          case "north":
            checkNeighbor(block.west(1));
            break;
          case "south":
            checkNeighbor(block.east(1));
            break;
          case "east":
            checkNeighbor(block.north(1));
            break;
          case "west":
            checkNeighbor(block.south(1));
            break;
        }
      } catch {
      }
      block.setPermutation(
        block.permutation.withState("mco_nom:reversed", reversed)
      );
      above.setPermutation(BlockPermutation4.resolve(block.typeId));
      above.setPermutation(
        above.permutation.withState("mco_nom:upper_block_bit", true).withState("minecraft:cardinal_direction", facing).withState("mco_nom:reversed", reversed)
      );
    });
  }
  onTick({ block }) {
    RedstoneManager.redstonePowerAfterEvent(
      block,
      {
        onPowered(block2) {
          if (block2.permutation.getState("mco_nom:open_bit"))
            return;
          _DoorBlockComponent.interactWithDoor(block2);
        },
        onUnpowered(block2) {
          const topHalf2 = block2.permutation.getState(
            "mco_nom:upper_block_bit"
          );
          let doorPart2;
          try {
            doorPart2 = topHalf2 ? block2.below(1) : block2.above(1);
          } catch {
          }
          if (!block2.permutation.getState("mco_nom:open_bit"))
            return;
          if (doorPart2 && doorPart2.hasTag(_DoorBlockComponent.DOOR_TAG) && doorPart2.permutation.getState("mco_nom:powered"))
            return;
          _DoorBlockComponent.interactWithDoor(block2);
        }
      },
      { tag: _DoorBlockComponent.DOOR_TAG, poweredState: "mco_nom:powered" }
    );
    if (!block)
      return;
    const doordata = _DoorBlockComponent.DOORS.find((f) => f.id == block.typeId);
    const topHalf = block.permutation.getState("mco_nom:upper_block_bit");
    let doorPart;
    try {
      doorPart = topHalf ? block.below(1) : block.above(1);
    } catch {
    }
    if (!doorPart || !doorPart.hasTag(_DoorBlockComponent.DOOR_TAG)) {
      if (topHalf) {
        block.setPermutation(BlockPermutation4.resolve("minecraft:air"));
      } else {
        if (doordata) {
          const item = new ItemStack10(doordata.itemID, 1);
          spawnItemAnywhere(item, block.location, block.dimension);
        }
        block.setPermutation(BlockPermutation4.resolve("minecraft:air"));
      }
    }
  }
  onPlayerInteract({ block }) {
    _DoorBlockComponent.interactWithDoor(block);
  }
  beforeOnPlayerPlace({ block, dimension, cancel }) {
    const loc = block.location;
    if (loc.y + 1 >= dimension.heightRange.max) {
      cancel = true;
      return;
    }
    let blockAbove, blockBelow;
    try {
      blockBelow = dimension.getBlock({ x: loc.x, y: loc.y - 1, z: loc.z });
    } catch {
    }
    if (!blockBelow || blockBelow.isAir || blockBelow.isLiquid) {
      cancel = true;
      return;
    }
    try {
      blockAbove = dimension.getBlock({ x: loc.x, y: loc.y + 1, z: loc.z });
    } catch {
    }
    if (!blockAbove || !(blockAbove.isAir || blockAbove.isLiquid)) {
      cancel = true;
      return;
    }
    _DoorBlockComponent.placeDoor(block, blockAbove);
  }
};
_DoorBlockComponent.DOOR_TAG = "mco_nom:is_door";
_DoorBlockComponent.DOORS = [
  {
    id: "mco_nom:cardboard_door",
    itemID: "mco_nom:cardboard_door",
    openSound: { id: "open.wooden_door", volume: 1, pitch: 1 },
    closeSound: { id: "close.wooden_door", volume: 1, pitch: 1 },
    breakSound: { id: "dig.wood", volume: 1, pitch: 1 }
  }
];
var DoorBlockComponent = _DoorBlockComponent;
world26.beforeEvents.playerBreakBlock.subscribe(
  ({ block, cancel, player }) => {
    if (block.hasTag(DoorBlockComponent.DOOR_TAG)) {
      cancel = true;
      DoorBlockComponent.breakDoor(
        block.typeId,
        block,
        block.permutation.getState("mco_nom:upper_block_bit"),
        [GameMode5.Survival, GameMode5.Adventure].includes(player.getGameMode())
      );
    } else {
      try {
        const above = block.above(1);
        if (above && above.hasTag(DoorBlockComponent.DOOR_TAG))
          DoorBlockComponent.breakDoor(
            above.typeId,
            above,
            above.permutation.getState("mco_nom:upper_block_bit")
          );
      } catch {
      }
    }
  }
);

// data/gametests/src/blocks/block_set/ladder.ts
import { system as system26, world as world27 } from "@minecraft/server";
system26.runInterval(() => {
  for (const player of world27.getAllPlayers()) {
    const dimension = player.dimension;
    const minHeight = dimension.heightRange.min;
    const maxHeight = dimension.heightRange.max;
    const currentHeight = player.location.y;
    if (currentHeight < minHeight || currentHeight > maxHeight) {
      return;
    }
    const block = dimension.getBlock(player.location);
    if (block === void 0 || !block.hasTag("mco_nom:can_climb"))
      return;
    const effect = player.isJumping ? "levitation" : "slow_falling";
    player.addEffect(effect, 5, {
      amplifier: 2,
      showParticles: false
    });
    if (player.isSneaking && !player.isJumping) {
      player.applyKnockback({ x: 0, z: 0 }, 0.02);
    }
  }
});

// data/gametests/src/blocks/rocketMovement.ts
import { world as world28, system as system27 } from "@minecraft/server";
var PROJECTILE_ID = "mco_nom:jumbo_firework_projectile";
var LAUNCHER_BLOCK_ID = "mco_nom:jumbo_firework_stand";
var SPIRAL_DURATION = 8 * 20;
var BLOCK_COLLISION_DELAY = 5;
var ENTITY_COLLISION_DELAY = 5;
var TICK_INTERVAL = 1;
var KNOCKBACK_RADIUS = 3;
var KNOCKBACK_HORIZONTAL = 0.8;
var KNOCKBACK_VERTICAL = 0.5;
function getForwardVector(facing) {
  switch (facing) {
    case "north":
      return { x: 0, y: 0, z: 1 };
    case "south":
      return { x: 0, y: 0, z: -1 };
    case "west":
      return { x: 1, y: 0, z: 0 };
    case "east":
      return { x: -1, y: 0, z: 0 };
    default:
      return { x: 0, y: 0, z: 1 };
  }
}
function getSideVector(forward) {
  if (forward.x !== 0)
    return { x: 0, y: 0, z: forward.x };
  if (forward.z !== 0)
    return { x: -forward.z, y: 0, z: 0 };
  return { x: 0, y: 0, z: 0 };
}
function isOnLauncherBlock(entity) {
  const x = Math.floor(entity.location.x);
  const z = Math.floor(entity.location.z);
  const offsets = [-0.25, -0.5, -69.5, -0.75, -1, -2];
  for (const offset of offsets) {
    const block = entity.dimension.getBlock({
      x,
      y: Math.floor(entity.location.y + offset),
      z
    });
    if (block?.isValid && block.typeId === LAUNCHER_BLOCK_ID) {
      return true;
    }
  }
  return false;
}
function getEntitiesOnLauncher(base, dimension) {
  const center = { x: base.x + 0.5, y: base.y + 1, z: base.z + 0.5 };
  const entities = dimension.getEntities({
    excludeTypes: [PROJECTILE_ID, "minecraft:item"],
    location: center,
    maxDistance: 1.5
  });
  return entities.filter((e) => isOnLauncherBlock(e));
}
function blastRider(rider, center) {
  if (!rider.isValid)
    return;
  try {
    rider.teleport(
      { x: center.x, y: center.y + 0.5, z: center.z },
      { dimension: rider.dimension, keepVelocity: false }
    );
  } catch {
  }
  system27.run(() => {
    try {
      rider.applyImpulse({
        x: (Math.random() - 0.5) * KNOCKBACK_HORIZONTAL * 2,
        y: KNOCKBACK_VERTICAL * 3,
        z: (Math.random() - 0.5) * KNOCKBACK_HORIZONTAL * 2
      });
    } catch {
    }
  });
}
function applyAoeKnockback(center, source, riders = []) {
  const entities = source.dimension.getEntities({
    excludeTypes: [PROJECTILE_ID, "minecraft:item"],
    location: center,
    maxDistance: KNOCKBACK_RADIUS
  });
  for (const target of entities) {
    if (!target.isValid || target.id === source.id)
      continue;
    if (riders.some((r) => r.id === target.id)) {
      blastRider(target, center);
      continue;
    }
    try {
      target.applyImpulse({
        x: (target.location.x - center.x) * KNOCKBACK_HORIZONTAL,
        y: KNOCKBACK_VERTICAL,
        z: (target.location.z - center.z) * KNOCKBACK_HORIZONTAL
      });
    } catch {
    }
  }
}
function triggerImpact(entity, pos, reason, riders = []) {
  entity.dimension.playSound("firework.large_blast", pos);
  entity.dimension.spawnParticle("mco_nom:jumbo_rocket_explo", pos);
  applyAoeKnockback(pos, entity, riders);
  entity.triggerEvent("mco_nom:on_dismount");
}
world28.afterEvents.entitySpawn.subscribe(({ entity }) => {
  if (entity.typeId !== PROJECTILE_ID)
    return;
  const spawnTick = system27.currentTick;
  const origin = { ...entity.location };
  const launcherBase = {
    x: Math.floor(origin.x),
    y: Math.floor(origin.y),
    z: Math.floor(origin.z)
  };
  const rotY = Math.floor(entity.getRotation().y);
  let facing = "south";
  if (rotY >= -45 && rotY < 45)
    facing = "south";
  else if (rotY >= 45 && rotY < 135)
    facing = "west";
  else if (rotY >= -135 && rotY < -45)
    facing = "east";
  else
    facing = "north";
  const forward = getForwardVector(facing);
  const side = getSideVector(forward);
  const phaseOffset = Math.random() * Math.PI * 2;
  const rideable = entity.getComponent("rideable");
  if (!rideable)
    return;
  const mountedAtLaunch = [];
  const riderIds = /* @__PURE__ */ new Set();
  const launchRiders = getEntitiesOnLauncher(launcherBase, entity.dimension);
  if (launchRiders.length > 0) {
    const candidate = launchRiders[0];
    system27.runTimeout(() => {
      try {
        const res = rideable.addRider(candidate);
        if (res) {
          mountedAtLaunch.push(candidate);
          riderIds.add(candidate.id);
        }
      } catch {
      }
    }, 10);
  }
  const intervalId = system27.runInterval(() => {
    if (!entity.isValid) {
      system27.clearRun(intervalId);
      return;
    }
    const age = system27.currentTick - spawnTick;
    const currentRiders = rideable.getRiders?.() ?? [];
    for (const r of currentRiders) {
      if (!mountedAtLaunch.includes(r))
        mountedAtLaunch.push(r);
      riderIds.add(r.id);
    }
    if (age > SPIRAL_DURATION) {
      triggerImpact(entity, entity.location, "end of spiral", mountedAtLaunch);
      system27.clearRun(intervalId);
      return;
    }
    const t = age / 2;
    const radius = 0.3 + 0.015 * t;
    const omega = 1.2;
    const ascent = 0.1;
    const speed = 0.75;
    const newPos = {
      x: origin.x + forward.x * speed * t + side.x * radius * Math.cos(omega * t + phaseOffset),
      y: origin.y + ascent * t + radius * Math.sin(omega * t + phaseOffset),
      z: origin.z + forward.z * speed * t + side.z * radius * Math.cos(omega * t + phaseOffset)
    };
    try {
      entity.teleport(newPos, { dimension: entity.dimension, keepVelocity: false });
    } catch {
    }
    if (age > BLOCK_COLLISION_DELAY) {
      const block = entity.dimension.getBlock({
        x: Math.floor(newPos.x),
        y: Math.floor(newPos.y - 0.1),
        z: Math.floor(newPos.z)
      });
      if (block && block.isValid && block.typeId !== "minecraft:air" && !(block.location.x === launcherBase.x && block.location.y === launcherBase.y && block.location.z === launcherBase.z)) {
        triggerImpact(entity, newPos, "block collision", mountedAtLaunch);
        system27.clearRun(intervalId);
        return;
      }
    }
    if (age > ENTITY_COLLISION_DELAY) {
      const candidates = entity.dimension.getEntities({
        excludeTypes: [PROJECTILE_ID, "minecraft:item"],
        location: newPos,
        maxDistance: 1.2
      });
      for (const target of candidates) {
        if (!target.isValid || riderIds.has(target.id))
          continue;
        const dx = target.location.x - newPos.x;
        const dz = target.location.z - newPos.z;
        const dy = target.location.y - newPos.y;
        const distSq = dx * dx + dy * dy + dz * dz;
        if (distSq <= 1) {
          triggerImpact(
            entity,
            newPos,
            `entity collision with ${target.typeId}`,
            mountedAtLaunch
          );
          system27.clearRun(intervalId);
          return;
        }
      }
    }
  }, TICK_INTERVAL);
});

// data/gametests/src/blocks/lootTables.ts
import {
  ItemStack as ItemStack11
} from "@minecraft/server";
var CardboardDestroyComponent = class {
  onPlayerBreak({
    block,
    dimension,
    brokenBlockPermutation
  }) {
    if (!block?.isValid)
      return;
    if (brokenBlockPermutation.type.id !== "mco_nom:cardboard_taped")
      return;
    const fullyTaped = brokenBlockPermutation.getAllStates()["mco_nom:fully_taped"];
    const spawn = (id, amount) => {
      try {
        dimension.spawnItem(new ItemStack11(id, amount), {
          x: block.location.x + 0.5,
          y: block.location.y + 0.5,
          z: block.location.z + 0.5
        });
      } catch {
      }
    };
    if (fullyTaped) {
      spawn("mco_nom:cardboard_taped", 1);
    } else {
      spawn("minecraft:string", 1);
      spawn("minecraft:paper", 2);
    }
  }
};
var CardboardDestroyComponentId = "mco_nom:cardboardDestroy";

// data/gametests/src/blocks/cardboardSwitcher.ts
import {
  world as world29,
  Player as Player19,
  EquipmentSlot as EquipmentSlot7,
  system as system28,
  BlockPermutation as BlockPermutation5,
  ItemStack as ItemStack12
} from "@minecraft/server";
world29.beforeEvents.playerInteractWithBlock.subscribe(
  (event) => {
    const { player, block } = event;
    if (!(player instanceof Player19))
      return;
    const equippable = player.getComponent(
      "minecraft:equippable"
    );
    if (!equippable)
      return;
    const item = equippable.getEquipment(EquipmentSlot7.Mainhand);
    if (!item)
      return;
    if (item.typeId === "minecraft:string" && block.typeId === "mco_nom:cardboard") {
      event.cancel = true;
      system28.run(() => {
        try {
          block.setPermutation(BlockPermutation5.resolve("mco_nom:cardboard_taped"));
          block.dimension.playSound("bundle.insert", block.location);
          if (item.amount > 1) {
            const newStack = new ItemStack12(item.typeId, item.amount - 1);
            equippable.setEquipment(EquipmentSlot7.Mainhand, newStack);
          } else {
            equippable.setEquipment(EquipmentSlot7.Mainhand, void 0);
          }
        } catch (e) {
        }
      });
      return;
    }
    if (item.typeId === "minecraft:slime_ball" && block.typeId === "mco_nom:cardboard_taped") {
      const permutation = block.permutation;
      const states = permutation.getAllStates();
      if (states["mco_nom:fully_taped"] === false) {
        event.cancel = true;
        system28.run(() => {
          try {
            const newPermutation = block.permutation.withState(
              "mco_nom:fully_taped",
              true
            );
            block.setPermutation(newPermutation);
            block.dimension.playSound("mob.slime.big", block.location);
            if (item.amount > 1) {
              const newStack = new ItemStack12(item.typeId, item.amount - 1);
              equippable.setEquipment(EquipmentSlot7.Mainhand, newStack);
            } else {
              equippable.setEquipment(EquipmentSlot7.Mainhand, void 0);
            }
          } catch (e) {
          }
        });
      }
    }
  }
);
world29.afterEvents.itemUse.subscribe((event) => {
  const { source, itemStack } = event;
  if (!(source instanceof Player19)) {
    return;
  }
  const block = source.getBlockFromViewDirection({ maxDistance: 15 })?.block;
  if (!block || block.typeId !== "mco_nom:cardboard") {
    return;
  }
  if (itemStack.typeId !== "minecraft:shears") {
    return;
  }
  const player = source;
  const equippable = player.getComponent("minecraft:equippable");
  if (!equippable) {
    return;
  }
  const equipment = equippable.getEquipment(EquipmentSlot7.Mainhand);
  if (!equipment)
    return;
  const durability = equipment.getComponent("minecraft:durability");
  if (durability) {
    block.dimension.playSound("pumpkin.carve", block.location);
    try {
      block.setType("mco_nom:cardboard_window");
    } catch (e) {
    }
    durability.damage += 1;
    if (durability.damage >= durability.maxDurability) {
      equippable.setEquipment(EquipmentSlot7.Mainhand, void 0);
      player.dimension.playSound("random.break", player.location);
    } else {
      equippable.setEquipment(EquipmentSlot7.Mainhand, equipment);
    }
  }
});

// data/gametests/src/blocks/disableFall.ts
import { system as system29, world as world30 } from "@minecraft/server";
system29.runInterval(() => {
  world30.getAllPlayers().forEach((player) => {
    if (!player.isValid)
      return;
    const { x, y, z } = player.location;
    const blockPos = {
      x: Math.floor(x),
      y: Math.floor(y),
      z: Math.floor(z)
    };
    let cushionBelow = false;
    for (let offset = 1; offset <= 2; offset++) {
      const block = player.dimension.getBlock({
        x: blockPos.x,
        y: blockPos.y - offset,
        z: blockPos.z
      });
      if (block && block.isValid && block.typeId === "mco_nom:whoopee_cushion" /* WhoopeeCushion */) {
        cushionBelow = true;
        break;
      }
    }
    if (cushionBelow) {
      try {
        player.addEffect("minecraft:slow_falling", 5, {
          amplifier: 0,
          showParticles: false
        });
      } catch {
      }
    }
  });
}, 1);

// data/gametests/src/blocks/rewardsHandler.ts
import { world as world31, Player as Player20, ItemStack as ItemStack13 } from "@minecraft/server";
var CHANCES = {
  common: 4.6,
  uncommon: 1.9,
  rare: 0.8,
  legendary: 0.41
};
var ITEM_TO_REWARD = {
  // === Costumes ===
  "mco_nom:costume_orange": { type: "Costume", id: costumes.indexOf("Orange") },
  "mco_nom:costume_blue": { type: "Costume", id: costumes.indexOf("Blue") },
  "mco_nom:costume_red": { type: "Costume", id: costumes.indexOf("Red") },
  "mco_nom:costume_yellow": { type: "Costume", id: costumes.indexOf("Yellow") },
  "mco_nom:costume_purple": { type: "Costume", id: costumes.indexOf("Purple") },
  "mco_nom:costume_gold": { type: "Costume", id: costumes.indexOf("Gold") },
  "mco_nom:costume_diamond": { type: "Costume", id: costumes.indexOf("Diamond") },
  "mco_nom:costume_love": { type: "Costume", id: costumes.indexOf("Love") },
  "mco_nom:costume_statue": { type: "Costume", id: costumes.indexOf("Stone") },
  "mco_nom:costume_rainbow": { type: "Costume", id: costumes.indexOf("Rainbow") },
  "mco_nom:costume_cutesy": { type: "Costume", id: costumes.indexOf("Cutesy") },
  "mco_nom:costume_old": { type: "Costume", id: costumes.indexOf("Old") },
  "mco_nom:costume_fuzzy": { type: "Costume", id: costumes.indexOf("Fuzzy") },
  "mco_nom:costume_noir": { type: "Costume", id: costumes.indexOf("Noir") },
  "mco_nom:costume_robo": { type: "Costume", id: costumes.indexOf("Robo") },
  "mco_nom:costume_techno": { type: "Costume", id: costumes.indexOf("Techno") },
  "mco_nom:costume_glow": { type: "Costume", id: costumes.indexOf("Glowing") },
  "mco_nom:costume_emerald": { type: "Costume", id: costumes.indexOf("Emerald") },
  "mco_nom:costume_mummy": { type: "Costume", id: costumes.indexOf("Mummy") },
  "mco_nom:costume_vampire": { type: "Costume", id: costumes.indexOf("Vampire") },
  // === Accessories ===
  "mco_nom:yellow_raincoat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Raincoat")
  },
  "mco_nom:hard_hat_accessory": { type: "Accessory", id: accessories.indexOf("Miner") },
  "mco_nom:scientist_goggles_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Nerdy Goggles")
  },
  "mco_nom:nightcap_accessory": { type: "Accessory", id: accessories.indexOf("Nightcap") },
  "mco_nom:beret_accessory": { type: "Accessory", id: accessories.indexOf("Beret") },
  "mco_nom:backwards_cap_and_glasses_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Cap & Glasses")
  },
  "mco_nom:superhero_cape_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Hero Cape")
  },
  "mco_nom:investigator_hat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Detective Hat")
  },
  "mco_nom:headphones_accessory": { type: "Accessory", id: accessories.indexOf("Headphone") },
  "mco_nom:big_curly_mustache_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Mustache")
  },
  "mco_nom:top_hat_and_monocle_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Top Hat & Monacle")
  },
  "mco_nom:holiday_accessory": { type: "Accessory", id: accessories.indexOf("Santa") },
  "mco_nom:vampire_cloak_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Spooky Cape")
  },
  "mco_nom:viking_helmet_accessory": { type: "Accessory", id: accessories.indexOf("Viking") },
  "mco_nom:knight_helmet_accessory": { type: "Accessory", id: accessories.indexOf("Knight") },
  "mco_nom:purple_mushroom_hat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Mush Co Hat")
  },
  "mco_nom:minecraft_diamond_helmet_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Diamond Helmet")
  },
  "mco_nom:clown_hair_and_nose_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Clown")
  },
  "mco_nom:royal_crown_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Royal Crown")
  },
  "mco_nom:jester_hat_accessory": { type: "Accessory", id: accessories.indexOf("Jester") },
  "mco_nom:wizard_hat_and_beard_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Magician")
  },
  "mco_nom:magic_spider_hat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Spider Hat")
  },
  // === Transformations ===
  "mco_nom:pig_nom_transformation": { type: "Transformation", id: forms.indexOf("Pig Nom") },
  "mco_nom:creeper_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Creeper Nom")
  },
  "mco_nom:fire_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Fire Nom")
  },
  "mco_nom:guardian_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Guardian Nom")
  },
  "mco_nom:spooky_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Spooky Nom")
  },
  "mco_nom:mad_scientist_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Mad Scientist Nom")
  },
  "mco_nom:super_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Super Nom")
  },
  "mco_nom:ender_dragon_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Ender Dragon Nom")
  }
};
var LOOT_CONFIG = {
  "minecraft:pig": [{ rewardId: "mco_nom:pig_nom_transformation", rarity: "common" }],
  "minecraft:creeper": [{ rewardId: "mco_nom:creeper_nom_transformation", rarity: "common" }],
  "minecraft:zombie": [
    { rewardId: "mco_nom:costume_orange", rarity: "common" },
    { rewardId: "mco_nom:costume_blue", rarity: "common" },
    { rewardId: "mco_nom:costume_red", rarity: "common" },
    { rewardId: "mco_nom:costume_yellow", rarity: "common" },
    { rewardId: "mco_nom:costume_purple", rarity: "common" },
    { rewardId: "mco_nom:hard_hat_accessory", rarity: "common" },
    { rewardId: "mco_nom:scientist_goggles_accessory", rarity: "common" },
    { rewardId: "mco_nom:nightcap_accessory", rarity: "common" },
    { rewardId: "mco_nom:beret_accessory", rarity: "common" },
    { rewardId: "mco_nom:backwards_cap_and_glasses_accessory", rarity: "common" }
  ],
  "minecraft:piglin": [{ rewardId: "mco_nom:costume_gold", rarity: "uncommon" }],
  "minecraft:bee": [{ rewardId: "mco_nom:costume_love", rarity: "uncommon" }],
  "minecraft:parrot": [
    { rewardId: "mco_nom:costume_rainbow", rarity: "uncommon" },
    { rewardId: "mco_nom:headphones_accessory", rarity: "uncommon" }
  ],
  "minecraft:rabbit": [{ rewardId: "mco_nom:costume_cutesy", rarity: "rare" }],
  "minecraft:witch": [
    { rewardId: "mco_nom:costume_old", rarity: "rare" },
    { rewardId: "mco_nom:mad_scientist_nom_transformation", rarity: "rare" }
  ],
  "minecraft:llama": [{ rewardId: "mco_nom:costume_fuzzy", rarity: "rare" }],
  "minecraft:illusioner": [{ rewardId: "mco_nom:costume_noir", rarity: "rare" }],
  "minecraft:iron_golem": [{ rewardId: "mco_nom:costume_robo", rarity: "rare" }],
  "minecraft:wither_skeleton": [{ rewardId: "mco_nom:costume_techno", rarity: "legendary" }],
  "minecraft:glow_squid": [{ rewardId: "mco_nom:costume_glow", rarity: "legendary" }],
  "minecraft:husk": [{ rewardId: "mco_nom:costume_mummy", rarity: "legendary" }],
  "minecraft:bat": [
    { rewardId: "mco_nom:costume_vampire", rarity: "legendary" },
    { rewardId: "mco_nom:vampire_cloak_accessory", rarity: "rare" }
  ],
  "minecraft:drowned": [{ rewardId: "mco_nom:viking_helmet_accessory", rarity: "rare" }],
  "minecraft:mooshroom": [
    { rewardId: "mco_nom:purple_mushroom_hat_accessory", rarity: "rare" }
  ],
  "minecraft:wandering_trader": [
    { rewardId: "mco_nom:clown_hair_and_nose_accessory", rarity: "legendary" }
  ],
  "minecraft:piglin_brute": [
    { rewardId: "mco_nom:royal_crown_accessory", rarity: "legendary" }
  ],
  "minecraft:silverfish": [{ rewardId: "mco_nom:jester_hat_accessory", rarity: "legendary" }],
  "minecraft:cave_spider": [
    { rewardId: "mco_nom:magic_spider_hat_accessory", rarity: "legendary" }
  ],
  "minecraft:evocation_illager": [
    { rewardId: "mco_nom:super_nom_transformation", rarity: "legendary" }
  ],
  "minecraft:ender_dragon": [
    { rewardId: "mco_nom:ender_dragon_nom_transformation", rarity: "legendary" }
  ]
};
function hasUnlocked(player, rewardId) {
  const entry = ITEM_TO_REWARD[rewardId];
  if (!entry)
    return false;
  const { type, id } = entry;
  const propKey = type === "Costume" ? "mco_nom:unlocked_costumes" : type === "Accessory" ? "mco_nom:unlocked_accessories" : "mco_nom:unlocked_forms";
  const unlocked = player.getDynamicProperty(propKey) ?? ";";
  return unlocked.includes(`;${id};`);
}
world31.afterEvents.entityDie.subscribe((ev) => {
  const { deadEntity, damageSource } = ev;
  if (!deadEntity?.typeId)
    return;
  const killer = damageSource?.damagingEntity;
  if (!(killer instanceof Player20))
    return;
  const mobId = deadEntity.typeId;
  const loots = LOOT_CONFIG[mobId];
  if (!loots)
    return;
  for (const { rewardId, rarity } of loots) {
    const chance = CHANCES[rarity];
    const roll = Math.random();
    if (roll < chance) {
      if (hasUnlocked(killer, rewardId)) {
        continue;
      }
      try {
        const item = new ItemStack13(rewardId, 1);
        killer.dimension.spawnItem(item, deadEntity.location);
      } catch (e) {
      }
    }
  }
});

// data/gametests/src/blocks/rewardUnlock.ts
import {
  world as world33,
  EquipmentSlot as EquipmentSlot8
} from "@minecraft/server";
var _actionBar = ActionBarManager.getInstance();
var ITEM_TO_REWARD2 = {
  // === Costumes ===
  "mco_nom:costume_orange": { type: "Costume", id: costumes.indexOf("Orange") },
  "mco_nom:costume_blue": { type: "Costume", id: costumes.indexOf("Blue") },
  "mco_nom:costume_red": { type: "Costume", id: costumes.indexOf("Red") },
  "mco_nom:costume_yellow": { type: "Costume", id: costumes.indexOf("Yellow") },
  "mco_nom:costume_purple": { type: "Costume", id: costumes.indexOf("Purple") },
  "mco_nom:costume_gold": { type: "Costume", id: costumes.indexOf("Gold") },
  "mco_nom:costume_diamond": { type: "Costume", id: costumes.indexOf("Diamond") },
  "mco_nom:costume_love": { type: "Costume", id: costumes.indexOf("Love") },
  "mco_nom:costume_statue": { type: "Costume", id: costumes.indexOf("Stone") },
  "mco_nom:costume_rainbow": { type: "Costume", id: costumes.indexOf("Rainbow") },
  "mco_nom:costume_cutesy": { type: "Costume", id: costumes.indexOf("Cutesy") },
  "mco_nom:costume_old": { type: "Costume", id: costumes.indexOf("Old") },
  "mco_nom:costume_fuzzy": { type: "Costume", id: costumes.indexOf("Fuzzy") },
  "mco_nom:costume_noir": { type: "Costume", id: costumes.indexOf("Noir") },
  "mco_nom:costume_robo": { type: "Costume", id: costumes.indexOf("Robo") },
  "mco_nom:costume_techno": { type: "Costume", id: costumes.indexOf("Techno") },
  "mco_nom:costume_glow": { type: "Costume", id: costumes.indexOf("Glowing") },
  "mco_nom:costume_emerald": { type: "Costume", id: costumes.indexOf("Emerald") },
  "mco_nom:costume_mummy": { type: "Costume", id: costumes.indexOf("Mummy") },
  "mco_nom:costume_vampire": { type: "Costume", id: costumes.indexOf("Vampire") },
  // === Accessories ===
  "mco_nom:yellow_raincoat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Raincoat")
  },
  "mco_nom:hard_hat_accessory": { type: "Accessory", id: accessories.indexOf("Miner") },
  "mco_nom:scientist_goggles_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Nerdy Goggles")
  },
  "mco_nom:nightcap_accessory": { type: "Accessory", id: accessories.indexOf("Nightcap") },
  "mco_nom:beret_accessory": { type: "Accessory", id: accessories.indexOf("Beret") },
  "mco_nom:backwards_cap_and_glasses_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Cap & Glasses")
  },
  "mco_nom:superhero_cape_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Hero Cape")
  },
  "mco_nom:investigator_hat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Detective Hat")
  },
  "mco_nom:headphones_accessory": { type: "Accessory", id: accessories.indexOf("Headphone") },
  "mco_nom:big_curly_mustache_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Mustache")
  },
  "mco_nom:top_hat_and_monocle_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Top Hat & Monacle")
  },
  "mco_nom:holiday_accessory": { type: "Accessory", id: accessories.indexOf("Santa") },
  "mco_nom:vampire_cloak_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Spooky Cape")
  },
  "mco_nom:viking_helmet_accessory": { type: "Accessory", id: accessories.indexOf("Viking") },
  "mco_nom:knight_helmet_accessory": { type: "Accessory", id: accessories.indexOf("Knight") },
  "mco_nom:purple_mushroom_hat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Mush Co Hat")
  },
  "mco_nom:minecraft_diamond_helmet_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Diamond Helmet")
  },
  "mco_nom:clown_hair_and_nose_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Clown")
  },
  "mco_nom:royal_crown_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Royal Crown")
  },
  "mco_nom:jester_hat_accessory": { type: "Accessory", id: accessories.indexOf("Jester") },
  "mco_nom:wizard_hat_and_beard_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Magician")
  },
  "mco_nom:magic_spider_hat_accessory": {
    type: "Accessory",
    id: accessories.indexOf("Spider Hat")
  },
  // === Transformations ===
  "mco_nom:pig_nom_transformation": { type: "Transformation", id: forms.indexOf("Pig Nom") },
  "mco_nom:creeper_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Creeper Nom")
  },
  "mco_nom:fire_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Fire Nom")
  },
  "mco_nom:guardian_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Guardian Nom")
  },
  "mco_nom:spooky_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Spooky Nom")
  },
  "mco_nom:mad_scientist_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Mad Scientist Nom")
  },
  "mco_nom:super_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Super Nom")
  },
  "mco_nom:ender_dragon_nom_transformation": {
    type: "Transformation",
    id: forms.indexOf("Ender Dragon Nom")
  }
};
function addRewardToPlayer(player, targetOmNom, reward) {
  const propKey = reward.type === "Costume" ? "mco_nom:unlocked_costumes" : reward.type === "Accessory" ? "mco_nom:unlocked_accessories" : "mco_nom:unlocked_forms";
  const unlocked = player.getDynamicProperty(propKey) ?? ";";
  const alreadyUnlocked = unlocked.includes(`;${reward.id};`);
  if (!alreadyUnlocked) {
    player.setDynamicProperty(propKey, `${unlocked}${reward.id};`);
    const inv = player.getComponent("equippable");
    if (inv) {
      const held = inv.getEquipment(EquipmentSlot8.Mainhand);
      if (held) {
        held.amount -= 1;
        inv.setEquipment(EquipmentSlot8.Mainhand, held.amount > 0 ? held : void 0);
      }
    }
    switch (reward.type) {
      case "Transformation":
        targetOmNom.setProperty("mco_nom:form", reward.id);
        break;
      case "Costume":
        targetOmNom.setProperty("mco_nom:form", 0);
        targetOmNom.setProperty("mco_nom:costume", reward.id);
        break;
      case "Accessory":
        targetOmNom.setProperty("mco_nom:form", 0);
        targetOmNom.setProperty("mco_nom:accessory", reward.id);
        break;
    }
    const displayName = reward.type === "Costume" ? costumes[reward.id] : reward.type === "Accessory" ? accessories[reward.id] : forms[reward.id];
    _actionBar.queueRewardUnlockMessage(player, RewardTypes[reward.type], displayName);
  }
}
world33.afterEvents.playerInteractWithEntity.subscribe((ev) => {
  const { player, target, itemStack: held } = ev;
  if (!target) {
    return;
  }
  if (target.typeId !== "mco_nom:om_nom")
    return;
  const tameable = target.getComponent("minecraft:tameable");
  if (!tameable || tameable.tamedToPlayer !== player) {
    return;
  }
  if (!held) {
    return;
  }
  const reward = ITEM_TO_REWARD2[held.typeId];
  if (!reward) {
    return;
  }
  addRewardToPlayer(player, target, reward);
});

// data/gametests/src/blocks/fan.ts
import {
  Player as Player22,
  system as system30
} from "@minecraft/server";
var fanSoundLastTick = /* @__PURE__ */ new Map();
var windSoundLastTick = /* @__PURE__ */ new Map();
var fanParticleLastTick = /* @__PURE__ */ new Map();
var solidBlocks2 = solidBlocks.filter((b) => b !== "mco_nom:fan" /* Fan */);
var fanParticles = {
  west: "mco_nom:fan_wind_left",
  down: "mco_nom:fan_wind",
  north: "mco_nom:fan_wind_front",
  up: "mco_nom:fan_wind_up",
  south: "mco_nom:fan_wind_back",
  east: "mco_nom:fan_wind_right"
};
function posKey(x, y, z) {
  return `${x},${y},${z}`;
}
var FanBlockComponent = class {
  constructor() {
  }
  onTick({ block }) {
    if (!block.matches("mco_nom:fan" /* Fan */))
      return;
    RedstoneManager.redstonePowerAfterEvent(block, {
      onPowered: (b) => b.setPermutation(b.permutation.withState("mco_nom:powered", true)),
      onUnpowered: (b) => b.setPermutation(b.permutation.withState("mco_nom:powered", false))
    });
    const powered = block.permutation.getState("mco_nom:powered");
    if (!powered)
      return;
    const face = block.permutation.getState("minecraft:block_face");
    if (!face)
      return;
    const forward = new Vec3(face[0].toUpperCase() + face.slice(1));
    const maxDistance = 5;
    const baseForce = 0.25;
    const halfNear = 0.5;
    const halfFar = 2;
    const windOrigin = new Vec3(block.location.x, block.location.y, block.location.z);
    const fanMouth = windOrigin.add(forward.multiply(0.25));
    const dir = new Vec3(forward.x, forward.y, forward.z).normalize();
    let tempUp = new Vec3(0, 1, 0);
    if (Math.abs(dir.y) > 0.9)
      tempUp = new Vec3(1, 0, 0);
    const right = dir.cross(tempUp).normalize();
    const up = right.cross(dir).normalize();
    const nearbyEntities = block.dimension.getEntities({
      location: new Vec3(
        block.location.x + 0.5,
        block.location.y + 0.5,
        block.location.z + 0.5
      ),
      maxDistance: 5
    });
    const key = posKey(block.location.x, block.location.y, block.location.z);
    if (nearbyEntities.length > 0) {
      for (let i = 1; i <= maxDistance; i++) {
        const z = i;
        const checkPos = fanMouth.add(dir.multiply(z));
        const checkBlock = block.dimension.getBlock({
          x: Math.floor(checkPos.x),
          y: Math.floor(checkPos.y),
          z: Math.floor(checkPos.z)
        });
        if (checkBlock && solidBlocks2.includes(checkBlock.typeId)) {
          return;
        }
        const halfSize = halfNear + (halfFar - halfNear) / maxDistance * z;
        const strength = (maxDistance - i + 1) / maxDistance;
        const pushForce = baseForce * strength;
        const sliceCenter = fanMouth.add(dir.multiply(z));
        const entities = block.dimension.getEntities({
          location: sliceCenter,
          maxDistance: halfSize * 1.5
        });
        for (const entity of entities) {
          if (!entity.isValid)
            continue;
          if (entity instanceof Player22 && entity.isSneaking)
            continue;
          const offset = new Vec3(
            entity.location.x - sliceCenter.x,
            entity.location.y - sliceCenter.y,
            entity.location.z - sliceCenter.z
          );
          const localX = offset.dot(right);
          const localY = offset.dot(up);
          if (Math.abs(localX) <= halfSize && Math.abs(localY) <= halfSize) {
            const variance = (Math.random() - 0.5) * 0.05;
            if (entity instanceof Player22) {
              const wSoundLastTick = windSoundLastTick.get(key) ?? 0;
              entity.applyKnockback(
                { x: dir.x + variance, z: dir.z + variance },
                dir.y + 0.1
              );
              entity.addEffect("slow_falling", 20 * 2, { amplifier: 0 });
              const pitch = 0.9 + Math.random() * 0.2;
              let WIND_SOUND_COOLDOWN_TICKS = 10;
              if (system30.currentTick - wSoundLastTick >= WIND_SOUND_COOLDOWN_TICKS) {
                windSoundLastTick.set(key, system30.currentTick);
                entity.playSound("mco_nom.fan.wind" /* McoNomFanWind */, {
                  volume: 0.4,
                  pitch
                });
              }
            } else if (entity.typeId === "minecraft:item") {
              const impulse = new Vec3(
                dir.x * pushForce * 3 + variance,
                dir.y * pushForce * 0.5,
                dir.z * pushForce * 3 + variance
              );
              try {
                entity.applyImpulse(impulse);
              } catch {
              }
            } else {
              const impulse = new Vec3(
                dir.x * pushForce + variance,
                dir.y * pushForce,
                dir.z * pushForce + variance
              );
              try {
                entity.applyImpulse(impulse);
              } catch {
              }
            }
          }
        }
      }
    }
    const SoundLastTick = fanSoundLastTick.get(key) ?? 0;
    const lastTick = fanParticleLastTick.get(key) ?? 0;
    let SOUND_COOLDOWN_TICKS = 10 + Math.random() * 10;
    if (system30.currentTick - SoundLastTick >= SOUND_COOLDOWN_TICKS) {
      fanSoundLastTick.set(key, system30.currentTick);
      const pitch = 1;
      block.dimension.playSound("mco_nom.fan.blow" /* McoNomFanBlow */, block.location, {
        volume: 0.4,
        pitch
      });
    }
    if (system30.currentTick - lastTick >= 20) {
      fanParticleLastTick.set(key, system30.currentTick);
      let particleBlocked = false;
      for (let j = 1; j <= 3; j++) {
        const checkPos = fanMouth.add(dir.multiply(j));
        const checkBlock = block.dimension.getBlock({
          x: Math.floor(checkPos.x),
          y: Math.floor(checkPos.y),
          z: Math.floor(checkPos.z)
        });
        if (checkBlock && solidBlocks2.includes(checkBlock.typeId)) {
          particleBlocked = true;
          break;
        }
      }
      if (!particleBlocked) {
        const faceKey = face.toLowerCase();
        const particleId = fanParticles[faceKey];
        if (particleId) {
          const particleOrigin = new Vec3(
            block.location.x + 0.5,
            block.location.y + 0.5,
            block.location.z + 0.5
          ).add(forward.multiply(0.25));
          block.dimension.spawnParticle(particleId, particleOrigin);
        }
      }
    }
  }
};

// data/gametests/src/blocks/magnet.ts
import {
  system as system31
} from "@minecraft/server";
var MAGNETIC_BLOCKS = [
  MinecraftBlockTypes.ActivatorRail,
  MinecraftBlockTypes.Anvil,
  MinecraftBlockTypes.BlastFurnace,
  MinecraftBlockTypes.Cauldron,
  MinecraftBlockTypes.ChippedAnvil,
  MinecraftBlockTypes.Crafter,
  MinecraftBlockTypes.DamagedAnvil,
  MinecraftBlockTypes.DetectorRail,
  MinecraftBlockTypes.HeavyWeightedPressurePlate,
  MinecraftBlockTypes.Hopper,
  MinecraftBlockTypes.IronBars,
  MinecraftBlockTypes.IronBlock,
  MinecraftBlockTypes.IronOre,
  MinecraftBlockTypes.DeepslateIronOre,
  MinecraftBlockTypes.IronTrapdoor,
  MinecraftBlockTypes.Lodestone,
  MinecraftBlockTypes.NetheriteBlock,
  MinecraftBlockTypes.Rail,
  MinecraftBlockTypes.RawIronBlock,
  MinecraftBlockTypes.SmithingTable,
  MinecraftBlockTypes.StonecutterBlock,
  MinecraftBlockTypes.TripWire,
  MinecraftBlockTypes.TripwireHook,
  "mco_nom:fan" /* Fan */
];
var solidBlocks3 = solidBlocks.filter((b) => !MAGNETIC_BLOCKS.includes(b));
var TICK_RATE = 10;
var MAX_RANGE = 6;
function inWorldBounds(pos) {
  return pos.y >= -64 && pos.y <= 320 && pos.x >= -3e7 && pos.x <= 3e7 && pos.z >= -3e7 && pos.z <= 3e7;
}
function samePos(a, b) {
  return a.x === b.x && a.y === b.y && a.z === b.z;
}
function findClosestMagnet(dimension, targetPos) {
  let closest = null;
  let closestDist = Infinity;
  for (let dx = -MAX_RANGE; dx <= MAX_RANGE; dx++) {
    for (let dy = -MAX_RANGE; dy <= MAX_RANGE; dy++) {
      for (let dz = -MAX_RANGE; dz <= MAX_RANGE; dz++) {
        const checkPos = new Vec3(targetPos).add(new Vec3(dx, dy, dz));
        if (!inWorldBounds(checkPos))
          continue;
        const block = dimension.getBlock(checkPos);
        if (!block || block.typeId !== "mco_nom:magnet" /* Magnet */)
          continue;
        const face = block.permutation.getState("minecraft:facing_direction");
        if (!face)
          continue;
        const facingVec = new Vec3(
          face[0].toUpperCase() + face.slice(1)
        );
        for (let i = 1; i <= MAX_RANGE; i++) {
          const rayPos = new Vec3(block.location).add(facingVec.multiply(i));
          if (!inWorldBounds(rayPos))
            break;
          if (samePos(rayPos, targetPos)) {
            const dist = Math.abs(dx) + Math.abs(dy) + Math.abs(dz);
            if (dist < closestDist) {
              closestDist = dist;
              closest = block.location;
            }
            break;
          }
        }
      }
    }
  }
  return closest;
}
var particleMap = {
  north: "mco_nom:magnet_push_front",
  south: "mco_nom:magnet_push_back",
  east: "mco_nom:magnet_push_right",
  west: "mco_nom:magnet_push_left",
  up: "mco_nom:magnet_push_up",
  down: "mco_nom:magnet_push_down"
};
var particleMap2 = {
  north: "mco_nom:magnet_push_front2",
  south: "mco_nom:magnet_push_back2",
  east: "mco_nom:magnet_push_right2",
  west: "mco_nom:magnet_push_left2",
  up: "mco_nom:magnet_push_up2",
  down: "mco_nom:magnet_push_down2"
};
var particleMapPull = {
  north: "mco_nom:magnet_pull_front",
  south: "mco_nom:magnet_pull_back",
  east: "mco_nom:magnet_pull_right",
  west: "mco_nom:magnet_pull_left",
  up: "mco_nom:magnet_pull_up",
  down: "mco_nom:magnet_pull_down"
};
var particleMapPull2 = {
  north: "mco_nom:magnet_pull_front2",
  south: "mco_nom:magnet_pull_back2",
  east: "mco_nom:magnet_pull_right2",
  west: "mco_nom:magnet_pull_left2",
  up: "mco_nom:magnet_pull_up2",
  down: "mco_nom:magnet_pull_down2"
};
var MagnetBlockComponent = class _MagnetBlockComponent {
  onTick({ block, dimension }, { params }) {
    if (system31.currentTick % TICK_RATE !== 0)
      return;
    const powered = RedstoneManager.isPowered(block);
    const mode = powered ? "pull" : "push";
    const currentMode = getCustomState(block, "mco_nom:mode");
    if (mode !== currentMode) {
      block.setPermutation(block.permutation.withState("mco_nom:mode", mode));
      block.dimension.playSound(
        mode === "pull" ? "mco_nom.magnet.activate" /* McoNomMagnetActivate */ : "mco_nom.magnet.dactivate" /* McoNomMagnetDactivate */,
        block.location,
        { volume: 0.7, pitch: Math.random() * 0.2 + 0.9 }
      );
    }
    const face = block.permutation.getState("minecraft:facing_direction");
    if (!face)
      return;
    const facingVec = new Vec3(face[0].toUpperCase() + face.slice(1));
    if (system31.currentTick % 20 === 0) {
      const baseCenter = new Vec3(block.location).add(new Vec3(0.5, 0.5, 0.5));
      const loc1 = baseCenter.add(facingVec);
      const loc2 = baseCenter.add(facingVec.multiply(2));
      if (mode === "push") {
        const p1 = particleMap[face];
        const p2 = particleMap2[face];
        if (p1)
          dimension.spawnParticle(p1, loc1);
        if (p2)
          dimension.spawnParticle(p2, loc2);
      } else {
        const p1 = particleMapPull[face];
        const p2 = particleMapPull2[face];
        if (p1)
          dimension.spawnParticle(p1, loc1);
        if (p2)
          dimension.spawnParticle(p2, loc2);
      }
    }
    const direction = facingVec.multiply(-1);
    if (mode === "pull") {
      _MagnetBlockComponent.pullBlocks(dimension, block.location, direction, MAX_RANGE);
    } else {
      _MagnetBlockComponent.pushBlocks(dimension, block.location, direction, MAX_RANGE);
    }
  }
  static pullBlocks(dimension, magnetPos, direction, range) {
    for (let i = 1; i <= range; i++) {
      const pos = new Vec3(magnetPos).subtract(direction.multiply(i));
      if (!inWorldBounds(pos))
        return;
      const block = dimension.getBlock(pos);
      if (!block)
        continue;
      for (let j = 1; j < i; j++) {
        const checkPos = new Vec3(magnetPos).subtract(direction.multiply(j));
        if (!inWorldBounds(checkPos))
          return;
        const check = dimension.getBlock(checkPos);
        if (check && solidBlocks3.includes(check.typeId))
          return;
      }
      if (MAGNETIC_BLOCKS.includes(block.typeId)) {
        const closest = findClosestMagnet(dimension, pos);
        if (!closest || !samePos(closest, magnetPos))
          return;
        const targetPos = new Vec3(magnetPos).subtract(direction.multiply(i - 1));
        if (!inWorldBounds(targetPos))
          return;
        const target = dimension.getBlock(targetPos);
        if (target && target.isAir) {
          target.setPermutation(block.permutation);
          block.setType(MinecraftBlockTypes.Air);
          dimension.playSound("mco_nom.magnet.move", targetPos, {
            volume: 0.8,
            pitch: 1.1
          });
        }
        return;
      }
    }
  }
  static pushBlocks(dimension, magnetPos, direction, range) {
    for (let i = 1; i < range; i++) {
      const pos = new Vec3(magnetPos).subtract(direction.multiply(i));
      if (!inWorldBounds(pos))
        return;
      const block = dimension.getBlock(pos);
      if (!block)
        continue;
      if (MAGNETIC_BLOCKS.includes(block.typeId)) {
        for (let j = 1; j < i; j++) {
          const checkPos = new Vec3(magnetPos).subtract(direction.multiply(j));
          if (!inWorldBounds(checkPos))
            return;
          const check = dimension.getBlock(checkPos);
          if (check && solidBlocks3.includes(check.typeId))
            return;
        }
        const closest = findClosestMagnet(dimension, pos);
        if (!closest || !samePos(closest, magnetPos))
          return;
        const targetPos = new Vec3(magnetPos).subtract(direction.multiply(i + 1));
        if (!inWorldBounds(targetPos))
          return;
        const target = dimension.getBlock(targetPos);
        if (target && target.isAir) {
          target.setPermutation(block.permutation);
          block.setType(MinecraftBlockTypes.Air);
          dimension.playSound("mco_nom.magnet.move", targetPos, {
            volume: 0.8,
            pitch: Math.random() * 0.2 + 0.7
          });
        }
        return;
      }
    }
  }
};

// data/gametests/src/blocks/jumbo_firework.ts
import {
  BlockPermutation as BlockPermutation6,
  EquipmentSlot as EquipmentSlot9,
  GameMode as GameMode6,
  system as system33,
  world as world34
} from "@minecraft/server";
var PROJECTILE_ID2 = "mco_nom:jumbo_firework_projectile";
var EPS = 1e-3;
var INITIAL_OFFSET = 15e-4;
var ignitionByLauncher = /* @__PURE__ */ new Map();
var desiredYFracByLauncher = /* @__PURE__ */ new Map();
var ignitingKeys = /* @__PURE__ */ new Set();
function launcherKey(loc) {
  return `${Math.floor(loc.x)},${Math.floor(loc.y)},${Math.floor(loc.z)}`;
}
function centerOf(loc) {
  return {
    x: Math.floor(loc.x) + 0.5,
    y: Math.floor(loc.y) + 0.5,
    z: Math.floor(loc.z) + 0.5
  };
}
function setHasFirework(blockTypeId, states, value) {
  return BlockPermutation6.resolve(blockTypeId, {
    ...states,
    ["mco_nom:has_firework"]: value
  });
}
function facingShiftAndYaw(facing) {
  switch (facing) {
    case "north":
      return { dx: 0, dz: -0.1, yaw: 0 };
    case "south":
      return { dx: 0, dz: 0.1, yaw: 180 };
    case "west":
      return { dx: -0.1, dz: 0, yaw: 270 };
    case "east":
      return { dx: 0.1, dz: 0, yaw: 90 };
    default:
      return { dx: 0, dz: 0, yaw: 0 };
  }
}
function smokeStartLocation(blockLoc, facing) {
  const p = { x: blockLoc.x + 0.5, y: blockLoc.y + 0.8, z: blockLoc.z + 0.5 };
  if (facing === "north")
    p.z += 0.55;
  else if (facing === "south")
    p.z -= 0.55;
  else if (facing === "west")
    p.x += 0.55;
  else if (facing === "east")
    p.x -= 0.55;
  return p;
}
var JumboFireworkBlockComponent = class {
  onPlayerInteract({ block, player }) {
    if (!player || !block?.isValid)
      return;
    if (block.typeId !== "mco_nom:jumbo_firework_stand")
      return;
    const states = block.permutation.getAllStates();
    const hasFirework = states["mco_nom:has_firework"];
    const equip = player.getComponent("equippable");
    const held = equip?.getEquipment(EquipmentSlot9.Mainhand);
    if (!held)
      return;
    const key = launcherKey(block.location);
    if (ignitingKeys.has(key)) {
      `[JumboFirework] Ignition ignored (already igniting) at ${key}`;
      return;
    }
    if (!hasFirework && held.typeId === "mco_nom:jumbo_firework") {
      if (player.getGameMode() !== GameMode6.Creative) {
        if ((held.amount ?? 0) > 1) {
          held.amount -= 1;
          equip?.setEquipment(EquipmentSlot9.Mainhand, held);
        } else {
          equip?.setEquipment(EquipmentSlot9.Mainhand, void 0);
        }
      }
      block.setPermutation(setHasFirework(block.typeId, states, true));
      `[JumboFirework] Firework inserted at ${block.location.x},${block.location.y},${block.location.z}`;
      return;
    }
    const isIgniter = hasFirework && (held.typeId === "minecraft:flint_and_steel" || held.typeId === "minecraft:fire_charge");
    if (!isIgniter)
      return;
    `[JumboFirework] Ignition started at ${block.location.x},${block.location.y},${block.location.z}`;
    block.dimension.playSound("random.fuse", block.location);
    ignitingKeys.add(key);
    ignitionByLauncher.set(key, {
      player,
      blockLoc: {
        x: Math.floor(block.location.x),
        y: Math.floor(block.location.y),
        z: Math.floor(block.location.z)
      },
      tick: system33.currentTick
    });
    `[JumboFirework] Tracking igniter ${player.name} at ${key}`;
    const facing = states["minecraft:cardinal_direction"];
    const smokeLoc = smokeStartLocation(block.location, facing);
    let ticks = 0;
    const smokeInterval = system33.runInterval(() => {
      block.dimension.spawnParticle("minecraft:basic_smoke_particle", smokeLoc);
      if (++ticks >= 25)
        system33.clearRun(smokeInterval);
    }, 4);
    system33.runTimeout(() => {
      block.setPermutation(
        setHasFirework(block.typeId, block.permutation.getAllStates(), false)
      );
      block.dimension.playSound("firework.launch", block.location);
      const baseY = Math.floor(block.location.y);
      const spawn = {
        x: block.location.x + 0.5,
        y: baseY + INITIAL_OFFSET,
        z: block.location.z + 0.5
      };
      const { dx, dz, yaw } = facingShiftAndYaw(facing);
      spawn.x += dx;
      spawn.z += dz;
      const cmd = `summon ${PROJECTILE_ID2} ${spawn.x} ${spawn.y} ${spawn.z} ${yaw} 0`;
      block.dimension.runCommand(cmd);
      `[JumboFirework] Summoned projectile at ${spawn.x},${spawn.y},${spawn.z}, facing=${facing}, rotY=${yaw}`;
      ignitingKeys.delete(key);
    }, 100);
  }
};
world34.afterEvents.entitySpawn.subscribe(({ entity }) => {
  if (entity.typeId !== PROJECTILE_ID2)
    return;
  const ex = entity.location.x;
  const ey = entity.location.y;
  const ez = entity.location.z;
  `[JumboFirework] Detected new projectile spawn at ${ex},${ey},${ez}`;
  let matchedKey;
  let matchedRecord;
  for (const [k, rec] of ignitionByLauncher.entries()) {
    const c = centerOf(rec.blockLoc);
    const dist = Math.abs(c.x - ex) + Math.abs(c.y - ey) + Math.abs(c.z - ez);
    if (dist <= 2.5) {
      matchedKey = k;
      matchedRecord = rec;
      break;
    }
  }
  if (!matchedKey)
    matchedKey = launcherKey({ x: ex, y: ey, z: ez });
  const baseY = Math.floor(ey);
  const fracY = ey - baseY;
  const learned = desiredYFracByLauncher.get(matchedKey);
  if (learned === void 0) {
    desiredYFracByLauncher.set(matchedKey, fracY);
    `[JumboFirework] Learned desired Y fraction for ${matchedKey} = ${fracY.toFixed(4)}`;
  } else if (Math.abs(fracY - learned) > EPS) {
    system33.run(() => {
      try {
        entity.teleport(
          { x: ex, y: baseY + learned, z: ez },
          { dimension: entity.dimension, checkForBlocks: false, keepVelocity: true }
        );
        `[JumboFirework] Adjusted rocket Y from ${ey.toFixed(3)} to ${(baseY + learned).toFixed(3)} for ${matchedKey}`;
      } catch (e) {
        `[JumboFirework] Teleport adjust failed: ${e}`;
      }
    });
  }
  if (matchedRecord) {
    const p = matchedRecord.player;
    const withinPlatform = Math.abs(p.location.x - matchedRecord.blockLoc.x - 0.5) <= 1 && Math.abs(p.location.z - matchedRecord.blockLoc.z - 0.5) <= 1 && Math.abs(p.location.y - matchedRecord.blockLoc.y - 1) <= 1;
    if (withinPlatform) {
      const pos = entity.location;
      const rideCmd = `ride "${p.nameTag}" start_riding @e[type=${PROJECTILE_ID2},x=${pos.x},y=${pos.y},z=${pos.z},r=1] teleport_rider`;
      try {
        entity.dimension.runCommand(rideCmd);
        `[JumboFirework] SUCCESS: ${p.nameTag} mounted the rocket!`;
      } catch (e) {
        `[JumboFirework] ERROR trying to mount player: ${e}`;
      }
    } else {
      `[JumboFirework] Player ${p.nameTag} is NOT on the launcher`;
    }
    ignitionByLauncher.delete(matchedKey);
  }
});

// data/gametests/src/blocks/whoopee.ts
import {
  system as system34
} from "@minecraft/server";
function getForwardVector2(face) {
  switch (face) {
    case "north":
      return new Vec3(0, 0, 1);
    case "south":
      return new Vec3(0, 0, -1);
    case "west":
      return new Vec3(1, 0, 0);
    case "east":
      return new Vec3(-1, 0, 0);
    default:
      return new Vec3(0, 0, 0);
  }
}
function getYawFromFace(face) {
  switch (face) {
    case "north":
      return 180;
    case "south":
      return 0;
    case "west":
      return 90;
    case "east":
      return -90;
    default:
      return 0;
  }
}
var entityBounceVelocity = /* @__PURE__ */ new Map();
var DAMPING_FACTOR = 0.65;
var MIN_VERTICAL_VELOCITY = 0.25;
var WALK_ON_BOUNCE_HEIGHT = 2.35;
function knockbackNearbyEntities(source, blockPos) {
  const range = 4;
  const entities = source.dimension.getEntities({
    excludeTypes: ["minecraft:item"],
    location: blockPos,
    maxDistance: range
  });
  for (const e of entities) {
    if (!e.isValid || e.id === source.id || e.typeId === "mco_nom:whoopee_cushion" /* WhoopeeCushion */) {
      continue;
    }
    const dx = e.location.x - blockPos.x;
    const dz = e.location.z - blockPos.z;
    const mag = Math.sqrt(dx * dx + dz * dz);
    if (mag < 1e-3)
      continue;
    const strength = 0.3;
    const impulse = { x: dx / mag * strength, y: 0, z: dz / mag * strength };
    try {
      e.applyImpulse(impulse);
    } catch {
    }
  }
}
var WhoopeeBlockComponent = class {
  onEntityFallOn({ entity, fallDistance }) {
    if (!entity || !entity.isValid || entityBounceVelocity.has(entity.id)) {
      return;
    }
    const g = 0.08;
    const maxHeight = 57.625;
    const k = 60;
    const desiredHeight = fallDistance > 0.3 ? maxHeight * fallDistance / (fallDistance + k) + 2 : WALK_ON_BOUNCE_HEIGHT;
    let verticalVelocity = Math.sqrt(2 * g * desiredHeight);
    const upwardBoost = Math.sqrt(2 * g * 3);
    verticalVelocity += upwardBoost;
    entityBounceVelocity.set(entity.id, verticalVelocity);
  }
  onStepOn({ block, entity }) {
    if (!entity || !entity.isValid)
      return;
    const face = block.permutation.getState("minecraft:cardinal_direction");
    if (!face)
      return;
    const forward = getForwardVector2(face);
    block.setPermutation(block.permutation.withState("mco_nom:is_visible", false));
    const spawnPos = {
      x: block.location.x + 0.5,
      y: block.location.y,
      z: block.location.z + 0.5
    };
    const whoopee = block.dimension.spawnEntity("mco_nom:whoopee_cushion" /* WhoopeeCushion */, spawnPos);
    if (!whoopee || !whoopee.isValid)
      return;
    whoopee.teleport(spawnPos, { dimension: block.dimension, keepVelocity: false });
    whoopee.setRotation({ x: 0, y: getYawFromFace(face) });
    system34.runTimeout(() => {
      if (whoopee.isValid) {
        whoopee.playAnimation("animation.mco_nom.whoopee_cushion.interact");
        try {
          whoopee.triggerEvent("mco_nom:interact");
        } catch {
        }
      }
    }, 3);
    const applyBounce = () => {
      try {
        let vertical;
        const isBouncing = entityBounceVelocity.has(entity.id);
        if (isBouncing) {
          vertical = entityBounceVelocity.get(entity.id);
          const nextVertical = vertical * DAMPING_FACTOR;
          if (nextVertical < MIN_VERTICAL_VELOCITY) {
            entityBounceVelocity.delete(entity.id);
          } else {
            entityBounceVelocity.set(entity.id, nextVertical);
          }
        } else {
          const g = 0.08;
          vertical = Math.sqrt(2 * g * WALK_ON_BOUNCE_HEIGHT);
          const upwardBoost = Math.sqrt(2 * g * 3);
          vertical += upwardBoost;
        }
        const horizontal = isBouncing ? 0.5 : 0.25;
        if (entity.typeId === "minecraft:item") {
          entity.applyImpulse({
            x: forward.x * horizontal,
            y: vertical,
            z: forward.z * horizontal
          });
        } else {
          const yawRad = entity.getRotation().y * Math.PI / 180;
          const dir = {
            x: -Math.sin(yawRad),
            z: Math.cos(yawRad)
          };
          entity.applyImpulse({
            x: dir.x * horizontal,
            y: vertical,
            z: dir.z * horizontal
          });
        }
        knockbackNearbyEntities(entity, block.location);
      } catch {
      }
    };
    system34.runTimeout(applyBounce, 1);
    system34.runTimeout(() => {
      if (block.isValid) {
        block.setPermutation(
          block.permutation.withState("mco_nom:is_visible", true)
        );
      }
      if (whoopee.isValid) {
        whoopee.triggerEvent("mco_nom:despawn");
      }
    }, Math.floor(0.9583 * 20));
    block.dimension.playSound("mco_nom.whoopee.pump" /* McoNomWhoopeePump */, block.location, {
      volume: 0.8,
      pitch: Math.random() * (1.1 - 0.9) + 0.9
    });
  }
};

// data/gametests/src/blocks/block_entity.ts
import {
  system as system35
} from "@minecraft/server";
var BlockEntityBlockComponent = class {
  constructor() {
  }
  beforeOnPlayerPlace({ block }, { params }) {
    system35.run(() => {
      const args = params;
      const entity = block.dimension.spawnEntity(args.entity, block.bottomCenter());
      if (args.rotate ?? false) {
        const face = block.permutation.getState("minecraft:cardinal_direction");
        if (!face)
          return;
        const direction = new Vec3(
          face[0].toUpperCase() + face.slice(1)
        );
        entity.setRotation(direction.rotate({ x: 0, y: 1, z: 0 }, 180).toRotation());
      }
    });
  }
  onPlayerBreak({ block }, { params }) {
    const args = params;
    block.dimension.getEntities({
      location: block.bottomCenter(),
      type: args.entity,
      maxDistance: 0.1
    }).forEach((entity) => entity.remove());
  }
};

// data/gametests/src/blocks/block_set/pane.ts
import {
  BlockPermutation as BlockPermutation7,
  system as system36,
  world as world35
} from "@minecraft/server";
var PANE_TAG = "mco_nom:is_pane";
var CONNECT_TAG2 = "mco_nom:is_connectable";
var CONNECT_SIDES2 = ["north", "south", "east", "west"];
var PaneBlockComponent = class _PaneBlockComponent {
  constructor() {
  }
  beforeOnPlayerPlace({ block }) {
    system36.run(() => {
      _PaneBlockComponent.updatePanesAround(block);
    });
  }
  onPlayerBreak({ block }) {
    _PaneBlockComponent.updatePanesAround(block);
  }
  static updatePaneStates(pane) {
    if (!pane || !pane.isValid)
      return;
    const neighbors = {
      north: pane.north(),
      south: pane.south(),
      east: pane.east(),
      west: pane.west()
    };
    const currentStates = pane.permutation.getAllStates();
    const newStates = {};
    for (const side of CONNECT_SIDES2) {
      const neighbor = neighbors[side];
      let shouldConnect = false;
      if (neighbor && neighbor.isValid) {
        const id = neighbor.typeId;
        shouldConnect = neighbor.hasTag(PANE_TAG) || neighbor.hasTag(CONNECT_TAG2) || connectableBlocks.includes(id) || solidBlocks.includes(id);
      }
      newStates[`mco_nom:connect_${side}`] = shouldConnect;
    }
    pane.setPermutation(
      BlockPermutation7.resolve(pane.typeId, {
        ...currentStates,
        ...newStates
      })
    );
  }
  static updatePanesAround(center) {
    if (!center || !center.isValid)
      return;
    const blocksToUpdate = [
      center,
      center.north(),
      center.south(),
      center.east(),
      center.west()
    ];
    for (const block of blocksToUpdate) {
      if (block && block.isValid && block.hasTag(PANE_TAG)) {
        _PaneBlockComponent.updatePaneStates(block);
      }
    }
  }
};
world35.afterEvents.playerPlaceBlock.subscribe(({ block }) => {
  for (const neighbor of [block.north(), block.south(), block.east(), block.west()]) {
    if (neighbor && neighbor.isValid && neighbor.hasTag(PANE_TAG)) {
      PaneBlockComponent.updatePanesAround(neighbor);
    }
  }
});
world35.afterEvents.playerBreakBlock.subscribe(({ block }) => {
  for (const neighbor of [block.north(), block.south(), block.east(), block.west()]) {
    if (neighbor && neighbor.isValid && neighbor.hasTag(PANE_TAG)) {
      PaneBlockComponent.updatePanesAround(neighbor);
    }
  }
});

// data/gametests/src/blocks/block_set/gate.ts
import {
  BlockPermutation as BlockPermutation8,
  BlockTypes,
  Direction as Direction7,
  EquipmentSlot as EquipmentSlot10,
  GameMode as GameMode7
} from "@minecraft/server";
function getNewCardinalDirection(currentDirection, angle) {
  const direction = directionDisplay(angle);
  if (["north", "south"].includes(currentDirection)) {
    return direction.includes("south") ? "south" : "north";
  } else {
    return direction.includes("west") ? "west" : "east";
  }
}
function directionDisplay(angle) {
  if (Math.abs(angle) > 112.5)
    return "north";
  if (Math.abs(angle) < 67.5)
    return "south";
  if (angle < 157.5 && angle > 22.5)
    return "west";
  if (angle > -157.5 && angle < -22.5)
    return "east";
  return "";
}
var FenceGateComponent = class {
  onPlayerInteract({ block, player, face }) {
    if (!player || !block?.isValid)
      return;
    const equipment = player.getComponent("equippable");
    const selectedItem = equipment?.getEquipment(
      EquipmentSlot10.Mainhand
    );
    if (selectedItem && face === Direction7.Up && BlockTypes.get(selectedItem.typeId)) {
      const aboveBlock = block.above();
      if (aboveBlock && aboveBlock.typeId === "mco_nom:fence_gate") {
        aboveBlock.setType(selectedItem.typeId);
        if (player.getGameMode() !== GameMode7.Creative) {
          if ((selectedItem.amount ?? 0) > 1) {
            selectedItem.amount -= 1;
            equipment?.setEquipment(EquipmentSlot10.Mainhand, selectedItem);
          } else {
            equipment?.setEquipment(EquipmentSlot10.Mainhand, void 0);
          }
        }
        return;
      }
    }
    const currentState = block.permutation.getState("mco_nom:open");
    const newOpenState = !currentState;
    const sound = newOpenState ? "open.fence_gate" : "close.fence_gate";
    const rotationAngle = player.getRotation().y;
    const currentDirection = block.permutation.getState(
      "minecraft:cardinal_direction"
    );
    const newCardinalDirection = getNewCardinalDirection(currentDirection, rotationAngle);
    const newPermutation = BlockPermutation8.resolve(block.typeId, {
      ...block.permutation.getAllStates(),
      ["mco_nom:open"]: newOpenState,
      ["minecraft:cardinal_direction"]: newCardinalDirection
    });
    block.setPermutation(newPermutation);
    block.dimension.playSound(sound, block.location);
  }
};
var FenceGateComponentId = "mco_nom:fence_gate";

// data/gametests/src/blocks/index.ts
system37.beforeEvents.startup.subscribe((event) => {
  const reg = event.blockComponentRegistry;
  reg.registerCustomComponent(SlabComponentId, new SlabBlockComponent());
  reg.registerCustomComponent(SlabDestroyComponentId, new SlabDestroyComponent());
  reg.registerCustomComponent("mco_nom:trapdoor", new TrapdoorBlockComponent());
  reg.registerCustomComponent("mco_nom:fence", new FenceBlockComponent());
  reg.registerCustomComponent("mco_nom:door", new DoorBlockComponent());
  reg.registerCustomComponent("mco_nom:pane", new PaneBlockComponent());
  reg.registerCustomComponent("mco_nom:fan", new FanBlockComponent());
  reg.registerCustomComponent("mco_nom:whoopee", new WhoopeeBlockComponent());
  reg.registerCustomComponent("mco_nom:magnet", new MagnetBlockComponent());
  reg.registerCustomComponent("mco_nom:jumbo_firework", new JumboFireworkBlockComponent());
  reg.registerCustomComponent("mco_nom:block_entity", new BlockEntityBlockComponent());
  reg.registerCustomComponent(FenceGateComponentId, new FenceGateComponent());
  reg.registerCustomComponent(CardboardDestroyComponentId, new CardboardDestroyComponent());
});

// data/gametests/src/mobs/OmNom.js
import { world as world36, system as system38, ItemStack as ItemStack17 } from "@minecraft/server";
import { ActionFormData as ActionFormData3, ModalFormData as ModalFormData3 } from "@minecraft/server-ui";
var log17 = Logger.getLogger("OmNom");
var foodList = [
  "mco_nom:candy",
  "mco_nom:donut",
  "minecraft:stick",
  "minecraft:iron_ingot",
  "minecraft:gold_ingot",
  "minecraft:cobblestone",
  "minecraft:apple",
  "minecraft:baked_potato",
  "minecraft:beef",
  "minecraft:beetroot",
  "minecraft:bread",
  "minecraft:cake",
  "minecraft:carrot",
  "minecraft:chicken",
  "minecraft:chorus_fruit",
  "minecraft:cooked_beef",
  "minecraft:cooked_chicken",
  "minecraft:cooked_cod",
  "minecraft:cooked_mutton",
  "minecraft:cooked_porkchop",
  "minecraft:cooked_rabbit",
  "minecraft:cooked_salmon",
  "minecraft:cookie",
  "minecraft:dried_kelp",
  "minecraft:enchanted_golden_apple",
  "minecraft:glow_berries",
  "minecraft:golden_apple",
  "minecraft:golden_carrot",
  "minecraft:melon_slice",
  "minecraft:mushroom_stew",
  "minecraft:mutton",
  "minecraft:poisonous_potato",
  "minecraft:porkchop",
  "minecraft:pumpkin_pie",
  "minecraft:rabbit",
  "minecraft:rabbit_stew",
  "minecraft:rotten_flesh",
  "minecraft:salmon",
  "minecraft:spider_eye",
  "minecraft:suspicious_stew",
  "minecraft:sweet_berries",
  "minecraft:tropical_fish"
];
world36.afterEvents.entityLoad.subscribe((e) => {
  const entity = e.entity;
  try {
    if (entity.typeId == "mco_nom:om_nom") {
      entity.setProperty("mco_nom:om_nom_action", "none");
    }
  } catch (err) {
    warn(`Om Nom Load Error: ${err}`);
  }
});
world36.afterEvents.entityHitEntity.subscribe((e) => {
  const source = e.damagingEntity;
  const entity = e.hitEntity;
  try {
    if (source.typeId == "mco_nom:om_nom") {
      if (source.getProperty("mco_nom:form") == 2) {
        entity.setOnFire(Math.floor(2 + 5 * Math.random()), true);
      } else if (source.getProperty("mco_nom:form") == 4) {
        entity.applyKnockback({ x: Math.max(Math.min(entity.location.x - source.location.x, 1), -1) * 2, z: Math.max(Math.min(entity.location.z - source.location.z, 1), -1) * 2 }, 0.25);
      }
    } else if (entity.typeId == "mco_nom:om_nom") {
      if (entity.getProperty("mco_nom:form") == 3) {
        if (source.typeId != "minecraft:player")
          source.addEffect("poison", 200);
      } else if (entity.getProperty("mco_nom:form") == 5) {
        if (source.typeId == "minecraft:player") {
          let randPitch = Math.random() * (1.1 - 0.9) + 0.9;
          source.addEffect("night_vision", 200);
          source.playSound("mco_nom.om_nom.ghost.night_vision", { volume: 0.5, pitch: randPitch });
        }
      }
    }
  } catch (err) {
    warn(`Om Nom Damage Effect Error: ${err}`);
  }
});
system38.afterEvents.scriptEventReceive.subscribe((e) => {
  const target = e.sourceEntity;
  if (e.id == "mco_nom:om_nom_open_menu") {
    if (!target) {
      error(`A source entity is required to use ${e.id}.`);
      return;
    } else if (target.typeId != "mco_nom:om_nom") {
      error(`Only Om Nom can use ${e.id}.`);
      return;
    }
    open_menu(target);
    target.runCommand("scriptevent mco_nom:om_nom_reaction interact");
  } else if (e.id == "mco_nom:detonate") {
    if (!target) {
      error(`A source entity is required to use ${e.id}.`);
      return;
    } else if (target.typeId != "mco_nom:om_nom") {
      error(`Only Om Nom can use ${e.id}.`);
      return;
    }
    detonate(target);
  } else if (e.id == "mco_nom:fire_wave") {
    if (!target) {
      error(`A source entity is required to use ${e.id}.`);
      return;
    } else if (target.typeId != "mco_nom:om_nom") {
      error(`Only Om Nom can use ${e.id}.`);
      return;
    }
    fire_wave(target);
  } else if (e.id == "mco_nom:fire_wave_target") {
    if (!target) {
      error(`A source entity is required to use ${e.id}.`);
      return;
    }
    target.setOnFire(Math.floor(2 + 5 * Math.random()), true);
  } else if (e.id == "mco_nom:guardian_nom_tick") {
    if (!target) {
      error(`A source entity is required to use ${e.id}.`);
      return;
    } else if (target.typeId != "mco_nom:om_nom") {
      error(`Only Om Nom can use ${e.id}.`);
      return;
    }
    const tameableComponent = target.getComponent("tameable");
    const inWater = target.isInWater;
    if (tameableComponent) {
      const owner = tameableComponent.tamedToPlayer;
      if (owner) {
        const fatiguePresent = owner.getEffect("mining_fatigue") != null;
        if (inWater) {
          owner.addEffect("haste", 50, { amplifier: fatiguePresent ? 20 : 1 });
          owner.addEffect("water_breathing", 50);
        }
      }
    }
    if (!inWater) {
      target.addEffect("weakness", 50, { showParticles: false });
      target.addEffect("slowness", 50, { showParticles: false });
    }
  }
});
var recipes = [
  //{
  //    ingredients: ['minecraft:stick', 'minecraft:cobblestone', 'minecraft:iron_ingot'],
  //    product: 'minecraft:netherite_ingot',
  //},
  //{
  //    ingredients: ['minecraft:stick', 'minecraft:cobblestone', 'minecraft:gold_ingot'],
  //    product: 'minecraft:diamond',
  //},
  {
    ingredients: ["mco_nom:candy"],
    effect: function(omNom) {
      heal(omNom, 20);
      tame_anim_check(omNom);
    }
  },
  {
    ingredients: ["mco_nom:donut"],
    effect: function(omNom) {
      heal(omNom, 20);
      tame_anim_check(omNom);
    }
  }
];
world36.afterEvents.projectileHitEntity.subscribe((e) => {
  const projectile = e.projectile;
  const entity = e.getEntityHit().entity;
  if (projectile.typeId == "mco_nom:small_fireball") {
    entity.dimension.spawnParticle("mco_nom:fire_proj_explo", entity.location);
    entity.dimension.spawnParticle("mco_nom:fire_proj_explo2", entity.location);
    entity.dimension.spawnParticle("mco_nom:fire_proj_explo3", entity.location);
  }
});
world36.afterEvents.playerInteractWithEntity.subscribe((e) => {
  const target = e.target;
  const player = e.player;
  const itemStack = e.beforeItemStack;
  if (itemStack && foodList.includes(itemStack.typeId) && target.getComponent("is_stunned") == null) {
    decrement_item(player, itemStack.typeId);
    if (target.typeId == "mco_nom:om_nom") {
      const tameableComponent = target.getComponent("tameable");
      if (tameableComponent && tameableComponent.tamedToPlayer == player) {
        if (target.getProperty("mco_nom:om_nom_action") != "none") {
          return;
        }
        target.runCommand("scriptevent mco_nom:om_nom_reaction fed");
        const existingIngredientList = target.getDynamicProperty("mco_nom:crafting_ingredient_list") ?? "";
        const existingIngredients = existingIngredientList.length > 0 ? existingIngredientList.split(";").filter(Boolean) : [];
        existingIngredients.push(itemStack.typeId);
        const recipeList = filterRecipesByIngredients(existingIngredients, recipes);
        info(`Matching recipes: ${recipeList.length}`);
        if (recipeList.length == 1) {
          if (existingIngredients.length == recipeList[0].ingredients.length) {
            info(`Success! ${recipeList[0].product}`);
            reset_recipe_ingredients(target);
            if (recipeList[0].effect != null) {
              recipeList[0].effect(target);
            } else {
              const product = new ItemStack17(recipeList[0].product);
              spit_out_item(target, product);
            }
          } else {
            store_recipe_ingredients(target, existingIngredients);
          }
        } else if (recipeList.length > 0) {
          store_recipe_ingredients(target, existingIngredients);
        } else {
          if (existingIngredients.length >= 1) {
            reject_recipe_ingredients(target, existingIngredients);
          }
        }
      }
    }
  }
});
var windSoundLastTick2 = /* @__PURE__ */ new Map();
function nomFlight(entity, flySpeed = 0.5) {
  const form = entity.getProperty("mco_nom:form") ?? -1;
  if (form != 8)
    return;
  const rideableComponent = entity.getComponent("minecraft:rideable");
  if (!rideableComponent)
    return;
  const riders = rideableComponent.getRiders();
  if (riders.length === 0)
    return;
  const rider = riders[0];
  if (rider.typeId != "minecraft:player")
    return;
  let distance = 10;
  const blockTest = entity.dimension.getBlockFromRay(entity.location, { x: 0, y: -1, z: 0 });
  if (blockTest) {
    distance = entity.location.y - blockTest.block.location.y - blockTest.faceLocation.y;
  }
  if (!entity.isOnGround && distance > 1.5) {
    entity.addEffect("slowness", 3, { amplifier: 20, showParticles: false });
    entity.addEffect("levitation", 1, { amplifier: 20, showParticles: false });
    const inputInfo = rider.inputInfo;
    const movementVector = inputInfo.getMovementVector();
    const rotation = rider.getRotation();
    if (movementVector.x !== 0 || movementVector.y !== 0) {
      const pitch = rotation.x * (Math.PI / 180);
      const yaw = rotation.y * (Math.PI / 180);
      const forwardDirection = {
        x: -Math.sin(yaw) * Math.cos(pitch),
        // X component
        y: -Math.sin(pitch),
        // Y component (up/down)
        z: Math.cos(yaw) * Math.cos(pitch)
        // Z component
      };
      const strafeDirection = {
        x: -Math.sin(yaw + Math.PI / 2),
        // 90 degrees offset from yaw
        y: 0,
        // No vertical component for strafing
        z: Math.cos(yaw + Math.PI / 2)
      };
      const direction = {
        x: (forwardDirection.x * movementVector.y + strafeDirection.x * (movementVector.x * -1)) * flySpeed,
        y: forwardDirection.y * movementVector.y * flySpeed,
        // Vertical based on forward input and pitch
        z: (forwardDirection.z * movementVector.y + strafeDirection.z * (movementVector.x * -1)) * flySpeed
      };
      entity.clearVelocity();
      entity.applyImpulse(direction);
      const currTick = system38.currentTick;
      if (currTick - (windSoundLastTick2.get(rider.id) ?? 0) >= 5) {
        windSoundLastTick2.set(rider.id, currTick);
        playWindSound(rider);
      }
    } else {
      entity.applyImpulse({ x: 0, y: -0.1667, z: 0 });
    }
  }
}
function playWindSound(rider) {
  const randPitch = 0.7 + Math.random() * 0.5;
  rider.playSound("mco_nom.om_nom.flight_wind" /* McoNomOmNomFlightWind */, { volume: 0.15, pitch: randPitch });
}
system38.runInterval(() => {
  const entities = world36.getDimension("overworld").getEntities({ type: "mco_nom:om_nom" });
  for (const entity of entities) {
    nomFlight(entity);
  }
}, 1);
function heal(target, amount = 20) {
  try {
    const healthComponent = target.getComponent("health");
    const value = healthComponent.currentValue;
    healthComponent.setCurrentValue(Math.min(value + amount, healthComponent.effectiveMax));
  } catch (err) {
    error(`Om Nom Heal Error: ${err}`);
  }
}
function reject_recipe_ingredients(omNom, list) {
  try {
    system38.runTimeout(() => {
      for (const itemId of list) {
        const item = new ItemStack17(itemId);
        spit_out_item(omNom, item);
      }
      reset_recipe_ingredients(omNom);
      info("Failed Recipe.");
    }, 15);
  } catch (err) {
    error(`Reject Items Error: ${err}`);
  }
}
function store_recipe_ingredients(omNom, list) {
  try {
    omNom.setDynamicProperty("mco_nom:crafting_ingredient_list", list.join(";"));
    omNom.setProperty("mco_nom:crafting_started", true);
    info(`Stored! ${list.join(";")}`);
  } catch (err) {
    error(`Store Items Error: ${err}`);
  }
}
function reset_recipe_ingredients(omNom) {
  try {
    omNom.setDynamicProperty("mco_nom:crafting_ingredient_list");
    omNom.triggerEvent("mco_nom:stop_crafting_mode");
    info("Recipe reset.");
  } catch (err) {
    error(`Reset Recipe Error: ${err}`);
  }
}
function spit_out_item(omNom, item) {
  system38.runTimeout(() => {
    try {
      omNom.dimension.spawnItem(item, omNom.location);
      omNom.runCommand("scriptevent mco_nom:om_nom_reaction craft");
    } catch (err) {
      error(`Item crafting error: ${err}`);
    }
  }, 10);
}
function filterRecipesByIngredients(itemIds, recipes2) {
  return recipes2.filter((recipe) => {
    const inputCounts = /* @__PURE__ */ new Map();
    itemIds.forEach((id) => inputCounts.set(id, (inputCounts.get(id) || 0) + 1));
    const recipeCounts = /* @__PURE__ */ new Map();
    recipe.ingredients.forEach(
      (id) => recipeCounts.set(id, (recipeCounts.get(id) || 0) + 1)
    );
    return Array.from(inputCounts.keys()).every(
      (id) => inputCounts.get(id) <= (recipeCounts.get(id) || 0)
    );
  });
}
function play_button_sound2(player) {
  player.playSound("mco_nom.ui.button_click" /* McoNomUiButtonClick */);
}
var costumes_icon = {
  None: "textures/mco/nom/items/omnom.png",
  Blue: "textures/mco/nom/items/costume_blue.png",
  Cutesy: "textures/mco/nom/items/costume_cutesy.png",
  Diamond: "textures/mco/nom/items/costume_diamond.png",
  Emerald: "textures/mco/nom/items/costume_emerald.png",
  Fuzzy: "textures/mco/nom/items/costume_fuzzy.png",
  Glowing: "textures/mco/nom/items/costume_glowing.png",
  Gold: "textures/mco/nom/items/costume_gold.png",
  Love: "textures/mco/nom/items/costume_love.png",
  Mummy: "textures/mco/nom/items/costume_mummy.png",
  Noir: "textures/mco/nom/items/costume_noir.png",
  Old: "textures/mco/nom/items/costume_old.png",
  Orange: "textures/mco/nom/items/costume_orange.png",
  Purple: "textures/mco/nom/items/costume_purple.png",
  Rainbow: "textures/mco/nom/items/costume_rainbow.png",
  Red: "textures/mco/nom/items/costume_red.png",
  Robo: "textures/mco/nom/items/costume_robo.png",
  Spirit: "textures/mco/nom/items/costume_spirit.png",
  Stone: "textures/mco/nom/items/costume_statue.png",
  Techno: "textures/mco/nom/items/costume_techno.png",
  Vampire: "textures/mco/nom/items/costume_vampire.png",
  Yellow: "textures/mco/nom/items/costume_yellow.png"
};
var accessories_icons = {
  "None": "textures/mco/nom/items/omnom.png",
  "Viking": "textures/mco/nom/items/accs_viking",
  "Magician": "textures/mco/nom/items/accs_magician",
  "Cap & Glasses": "textures/mco/nom/items/accs_cap_and_glasses",
  "Knight": "textures/mco/nom/items/accs_knight",
  "Beret": "textures/mco/nom/items/accs_beret",
  "Mustache": "textures/mco/nom/items/accs_mustache",
  "Top Hat & Monacle": "textures/mco/nom/items/accs_top_hat_mono",
  "Holiday Hat": "textures/mco/nom/items/accs_santa",
  "Investigator": "textures/mco/nom/items/accs_investigator",
  "Miner": "textures/mco/nom/items/accs_miner_helmet",
  "Jester": "textures/mco/nom/items/accs_jester_hat",
  "Nerdy Goggles": "textures/mco/nom/items/accs_nerdy_goggles",
  "Hero Cape": "textures/mco/nom/items/accs_hero_cape",
  "Spooky Cape": "textures/mco/nom/items/accs_spooky_cape",
  "Diamond Helmet": "textures/mco/nom/items/accs_diamond_helmet",
  "Raincoat": "textures/mco/nom/items/accs_raincoat",
  "Clown": "textures/mco/nom/items/accs_clown",
  "Nightcap": "textures/mco/nom/items/accs_nightcap",
  "Headphone": "textures/mco/nom/items/accs_headphone",
  "Royal Crown": "textures/mco/nom/items/accs_royal_crown",
  "Mush Co Hat": "textures/mco/nom/items/accs_mush_hat",
  "Spider Hat": "textures/mco/nom/items/accs_spider_hat",
  "Detective Hat": "textures/mco/nom/items/accs_investigator_hat"
};
var TransformationIcons = {
  "Om Nom": "textures/mco/nom/items/omnom",
  "Creeper Nom": "textures/mco/nom/items/trans_creeper",
  "Fire Nom": "textures/mco/nom/items/trans_fire",
  "Guardian Nom": "textures/mco/nom/items/trans_guardian",
  "Super Nom": "textures/mco/nom/items/trans_hero",
  "Spooky Nom": "textures/mco/nom/items/trans_spirit.png",
  "Mad Scientist Nom": "textures/mco/nom/items/trans_scientist",
  "Pig Nom": "textures/mco/nom/items/trans_pig",
  "Ender Dragon Nom": "textures/mco/nom/items/trans_dragon"
};
var forms2 = [
  "Om Nom",
  "Creeper Nom",
  "Fire Nom",
  "Guardian Nom",
  "Super Nom",
  "Spooky Nom",
  "Mad Scientist Nom",
  "Pig Nom",
  "Ender Dragon Nom"
];
var bold = "\xA7l";
function pad2(n) {
  return n.toString().padStart(2, "0");
}
function open_menu(omNom, player) {
  try {
    if (player == null) {
      player = omNom.getComponent("tameable")?.tamedToPlayer;
    }
    if (player == null) {
      throw new Error("Player undefined.");
    }
    const currentForm = omNom.getProperty("mco_nom:form");
    const dialog = new ActionFormData3();
    const healthBarLength = 41;
    const healthComponent = omNom.getComponent("minecraft:health");
    const healthRatio = healthComponent.currentValue / healthComponent.effectiveMax;
    const filledBars = Math.ceil(healthBarLength * healthRatio);
    const emptyBars = healthBarLength - filledBars;
    const healthBar = `\xA77\xA7l[\xA7a${"|".repeat(filledBars)}\xA77${"|".repeat(emptyBars)}]\xA7r`;
    let healthMessage = " ".repeat(20) + `\xA77\xA7lHealth
\xA7r`;
    healthMessage += `${" ".repeat(8) + healthBar}
`;
    healthMessage += " ".repeat(19) + `\xA77(${pad2(Math.floor(healthComponent.currentValue))} / ${healthComponent.effectiveMax})`;
    const form = omNom.getProperty("mco_nom:form");
    const canRide = form == 8 || form == 7 && omNom.getComponent("is_saddled");
    dialog.title(`\xA7l${forms2[currentForm]}\xA7r`);
    dialog.body(`${healthMessage}
`);
    dialog.divider();
    dialog.button(`\xA7lBehaviors`, UI_ICONS.Behavior);
    dialog.button(`\xA7lCostumes`, UI_ICONS.Costume);
    dialog.button(`\xA7lAccessories`, UI_ICONS.Accessory);
    dialog.button(`\xA7lTransformations`, UI_ICONS.Transformation);
    if (canRide) {
      dialog.button(`\xA7lRide`);
    }
    dialog.show(player).then((response) => {
      if (response?.selection != null) {
        if (response.selection == 0) {
          open_behavior_menu(omNom, player);
          play_button_sound2(player);
        } else if (response.selection == 1) {
          open_costumes_window(omNom, player);
          play_button_sound2(player);
        } else if (response.selection == 2) {
          open_accessories_window(omNom, player);
          play_button_sound2(player);
        } else if (response.selection == 3) {
          open_tranformations_menu(omNom, player);
          play_button_sound2(player);
        } else if (response.selection == 4 && canRide) {
          omNom.runCommand(`ride "${player.nameTag}" start_riding @s`);
          play_button_sound2(player);
        }
      }
    }).catch((err) => {
      warn(`Om Nom Option Error: ${err}`);
    });
  } catch (err) {
    error(`Om Nom UI error: ${err}`);
  }
}
function open_behavior_menu(omNom, player) {
  try {
    if (player == null) {
      player = omNom.getComponent("tameable")?.tamedToPlayer;
    }
    if (player == null) {
      throw new Error("Player undefined.");
    }
    const dialog = new ModalFormData3();
    const interactionsEnabled = omNom.getProperty("mco_nom:interactions_enabled");
    const abilitiesEnabled = omNom.getProperty("mco_nom:abilities_enabled");
    const godMode = omNom.getProperty("mco_nom:god_mode");
    const targetingOptions = ["Lazy", "Normal", "Brave"];
    let targetType = 0;
    switch ((omNom.getProperty("mco_nom:targeting_type") ?? "Normal").toLowerCase()) {
      case targetingOptions[0].toLowerCase():
        targetType = 0;
        break;
      case targetingOptions[1].toLowerCase():
        targetType = 1;
        break;
      case targetingOptions[2].toLowerCase():
        targetType = 2;
        break;
    }
    dialog.title(bold + `Om Nom's Behavior`);
    dialog.dropdown("\n\xA77Personality", targetingOptions, { defaultValueIndex: targetType ?? 0 });
    dialog.toggle("\xA77Interactions", { defaultValue: interactionsEnabled });
    dialog.toggle("\xA77Abilities", { defaultValue: abilitiesEnabled });
    dialog.show(player).then((formData) => {
      omNom.setProperty(
        "mco_nom:targeting_type",
        targetingOptions[formData.formValues[0]].toLowerCase()
      );
      omNom.setProperty("mco_nom:interactions_enabled", formData.formValues[1]);
      omNom.setProperty("mco_nom:abilities_enabled", formData.formValues[2]);
      play_button_sound2(player);
    }).catch((err) => {
      warn(`Om Nom Behavior Config Error: ${err}`);
      open_menu(omNom, player);
    });
  } catch (err) {
    error(`Om Nom UI error: ${err}`);
  }
}
function open_tranformations_menu(omNom, player) {
  try {
    if (player == null) {
      player = omNom.getComponent("tameable")?.tamedToPlayer;
    }
    if (player == null)
      throw new Error("Player undefined.");
    const dialog = new ActionFormData3();
    dialog.title({ translate: bold + "Transformations", with: { rawtext: [{ text: "\n" }] } });
    dialog.label(`\xA77\xA7lEvolve Om Nom with new powers and abilities.

`);
    const groups = [
      { label: "Common:", items: ["Creeper Nom", "Pig Nom"] },
      { label: "Uncommon:", items: ["Fire Nom", "Guardian Nom"] },
      { label: "Rare:", items: ["Mad Scientist Nom", "Spooky Nom"] },
      { label: "Legendary:", items: ["Ender Dragon Nom", "Super Nom"] }
    ];
    const rewardsUnlocked = Boolean(
      world36.getDynamicProperty("mco_nom:unlock_rewards") ?? false
    );
    const unlockedForms = String(
      player.getDynamicProperty("mco_nom:unlocked_forms") ?? ";"
    );
    const nameToIndex = new Map(forms2.map((name, i) => [name, i]));
    const displayToFormIndex = [];
    displayToFormIndex.push(0);
    dialog.button(bold + forms2[0], TransformationIcons[forms2[0]]);
    for (const g of groups) {
      dialog.label(`\xA7l\xA77${g.label}`);
      for (const name of g.items) {
        const idx = nameToIndex.get(name);
        if (idx == null)
          continue;
        const isUnlocked = rewardsUnlocked || unlockedForms.includes(`;${idx};`) || idx === 0;
        displayToFormIndex.push(idx);
        const label = {
          translate: bold + forms2[idx],
          with: { rawtext: [{ text: "\n" }] }
        };
        if (isUnlocked) {
          dialog.button(label, TransformationIcons[forms2[idx]]);
        } else {
          dialog.button(label, "textures/mco/nom/items/lock");
        }
      }
    }
    dialog.label("\n");
    const BACK_SENTINEL = -1;
    displayToFormIndex.push(BACK_SENTINEL);
    dialog.button(bold + "Back", UI_ICONS.Back);
    dialog.show(player).then((response) => {
      if (response?.selection == null)
        return;
      const mapped = displayToFormIndex[response.selection];
      if (mapped === BACK_SENTINEL) {
        play_button_sound2(player);
        open_menu(omNom, player);
        return;
      }
      if (mapped != null && (rewardsUnlocked || mapped === 0 || unlockedForms.includes(`;${mapped};`))) {
        omNom.setProperty("mco_nom:form", mapped);
        play_button_sound2(player);
      } else {
        open_tranformations_menu(omNom, player);
      }
    }).catch((err) => {
      warn(`Om Nom Transformation Option Error: ${err}`);
    });
  } catch (err) {
    error(`Om Nom Transformation UI error: ${err}`);
  }
}
function open_costumes_window(omNom, player) {
  try {
    if (player == null) {
      player = omNom.getComponent("tameable")?.tamedToPlayer;
    }
    if (player == null)
      throw new Error("Player undefined.");
    const dialog = new ActionFormData3();
    dialog.title({ translate: bold + "Costumes", with: { rawtext: [{ text: "\n" }] } });
    dialog.label(`\xA77\xA7lChange Om Nom's outward appearance.

`);
    const costumes2 = [
      "None",
      "Blue",
      "Cutesy",
      "Diamond",
      "Emerald",
      "Fuzzy",
      "Glowing",
      // internal key
      "Gold",
      "Love",
      "Mummy",
      "Noir",
      "Old",
      "Orange",
      "Purple",
      "Rainbow",
      "Red",
      "Robo",
      "Stone",
      // renamed from “Statue”
      "Techno",
      "Vampire",
      "Yellow"
    ];
    const groups = [
      { label: "Common:", items: ["Blue", "Orange", "Purple", "Red", "Yellow"] },
      { label: "Uncommon:", items: ["Diamond", "Gold", "Love", "Rainbow", "Stone"] },
      { label: "Rare:", items: ["Cutesy", "Fuzzy", "Noir", "Old", "Robo"] },
      { label: "Legendary:", items: ["Emerald", "Glow", "Mummy", "Techno", "Vampire"] }
    ];
    const alias = /* @__PURE__ */ new Map([
      ["Glow", "Glowing"]
    ]);
    const rewardsUnlocked = Boolean(
      world36.getDynamicProperty("mco_nom:unlock_rewards") ?? false
    );
    const unlockedCostumes = String(
      player.getDynamicProperty("mco_nom:unlocked_costumes") ?? ";"
    );
    const nameToIndex = new Map(costumes2.map((name, i) => [name, i]));
    const displayToCostumeIndex = [];
    displayToCostumeIndex.push(0);
    dialog.button("\xA7lNone", TransformationIcons[forms2[0]]);
    for (const g of groups) {
      dialog.label(`\xA7l\xA77${g.label}`);
      for (const displayName of g.items) {
        const internalName = alias.get(displayName) ?? displayName;
        const idx = nameToIndex.get(internalName);
        if (idx == null)
          continue;
        const isUnlocked = rewardsUnlocked || unlockedCostumes.includes(`;${idx};`) || idx === 0;
        displayToCostumeIndex.push(idx);
        const iconPath = costumes_icon?.[internalName];
        if (isUnlocked) {
          dialog.button(`\xA7l${displayName}`, iconPath);
        } else {
          dialog.button(`\xA7l${displayName}`, "textures/mco/nom/items/lock");
        }
      }
    }
    dialog.label("\n");
    const BACK_SENTINEL = -1;
    displayToCostumeIndex.push(BACK_SENTINEL);
    dialog.button("\xA7lBack", UI_ICONS.Back);
    dialog.show(player).then((response) => {
      if (response?.selection == null)
        return;
      const mapped = displayToCostumeIndex[response.selection];
      if (mapped === BACK_SENTINEL) {
        play_button_sound2(player);
        open_menu(omNom, player);
        return;
      }
      if (mapped != null && (rewardsUnlocked || mapped === 0 || unlockedCostumes.includes(`;${mapped};`))) {
        omNom.setProperty("mco_nom:costume", mapped);
        play_button_sound2(player);
      } else {
        open_costumes_window(omNom, player);
      }
    }).catch((err) => {
      warn(`Om Nom Costume Option Error: ${err}`);
    });
  } catch (err) {
    error(`Om Nom Costume UI error: ${err}`);
  }
}
function open_accessories_window(omNom, player) {
  try {
    if (player == null) {
      player = omNom.getComponent("tameable")?.tamedToPlayer;
    }
    if (player == null)
      throw new Error("Player undefined.");
    const dialog = new ActionFormData3();
    dialog.title({ translate: bold + "Accessories", with: { rawtext: [{ text: "\n" }] } });
    dialog.label(`\xA77\xA7lAccessorize Om Nom with cool gear to compliment costumes.

`);
    const accessories2 = [
      "None",
      "Viking",
      "Magician",
      "Cap & Glasses",
      "Knight",
      "Beret",
      "Mustache",
      "Top Hat & Monacle",
      "Holiday Hat",
      "Detective Hat",
      "Miner",
      "Jester",
      "Nerdy Goggles",
      "Hero Cape",
      "Spooky Cape",
      "Diamond Helmet",
      "Raincoat",
      "Clown",
      "Nightcap",
      "Headphone",
      "Royal Crown",
      "Mush Co Hat",
      "Spider Hat"
    ];
    const groups = [
      { label: "Common:", items: [
        "Backwards Cap & Glasses",
        "Beret",
        "Hard Hat",
        "Nightcap",
        "Scientist Goggles",
        "Yellow Raincoat"
      ] },
      { label: "Uncommon:", items: [
        "Big Curly Mustache",
        "Detective Hat",
        "Headphones",
        "Holiday Hat",
        "Superhero Cape",
        "Top Hat & Monocle"
      ] },
      { label: "Rare:", items: [
        "Knight Helmet",
        "Minecraft Diamond Helmet",
        "Purple Mushroom Hat",
        "Vampire Cloak",
        "Viking Helmet"
      ] },
      { label: "Legendary:", items: [
        "Clown Hair & Nose",
        "Jester Hat",
        "Magic Spider Hat",
        "Royal Crown",
        "Wizard Hat & Beard"
      ] }
    ];
    const alias = /* @__PURE__ */ new Map([
      ["Backwards Cap & Glasses", "Cap & Glasses"],
      ["Scientist Goggles", "Nerdy Goggles"],
      ["Yellow Raincoat", "Raincoat"],
      ["Big Curly Mustache", "Mustache"],
      ["Detective Hat", "Detective Hat"],
      ["Headphones", "Headphone"],
      ["Superhero Cape", "Hero Cape"],
      ["Top Hat & Monocle", "Top Hat & Monacle"],
      ["Knight Helmet", "Knight"],
      ["Minecraft Diamond Helmet", "Diamond Helmet"],
      ["Purple Mushroom Hat", "Mush Co Hat"],
      ["Vampire Cloak", "Spooky Cape"],
      ["Viking Helmet", "Viking"],
      ["Clown Hair & Nose", "Clown"],
      ["Jester Hat", "Jester"],
      ["Magic Spider Hat", "Spider Hat"],
      ["Royal Crown", "Royal Crown"],
      ["Wizard Hat & Beard", "Magician"],
      ["Holiday Hat", "Holiday Hat"],
      ["Hard Hat", "Miner"]
    ]);
    const rewardsUnlocked = Boolean(world36.getDynamicProperty("mco_nom:unlock_rewards") ?? false);
    const unlockedAccessories = String(player.getDynamicProperty("mco_nom:unlocked_accessories") ?? ";");
    const nameToIndex = new Map(accessories2.map((name, i) => [name, i]));
    const displayToAccessoryIndex = [];
    displayToAccessoryIndex.push(0);
    dialog.button("\xA7lNone", accessories_icons[accessories2[0]]);
    for (const g of groups) {
      dialog.label(`\xA7l\xA77${g.label}`);
      for (const displayName of g.items) {
        const internalName = alias.get(displayName) ?? displayName;
        const idx = nameToIndex.get(internalName);
        if (idx == null)
          continue;
        const isUnlocked = rewardsUnlocked || unlockedAccessories.includes(`;${idx};`) || idx === 0;
        displayToAccessoryIndex.push(idx);
        const buttonText = `\xA7l${displayName}`;
        if (isUnlocked) {
          dialog.button(buttonText, accessories_icons[accessories2[idx]]);
        } else {
          dialog.button(buttonText, "textures/mco/nom/items/lock");
        }
      }
    }
    dialog.label("\n");
    const BACK_SENTINEL = -1;
    displayToAccessoryIndex.push(BACK_SENTINEL);
    dialog.button("\xA7lBack", UI_ICONS.Back);
    dialog.show(player).then((response) => {
      if (response?.selection == null)
        return;
      const mapped = displayToAccessoryIndex[response.selection];
      if (mapped === BACK_SENTINEL) {
        play_button_sound2(player);
        open_menu(omNom, player);
        return;
      }
      if (mapped != null && (rewardsUnlocked || mapped === 0 || unlockedAccessories.includes(`;${mapped};`))) {
        omNom.setProperty("mco_nom:accessory", mapped);
        play_button_sound2(player);
        player.playSound("mco_nom.om_nom.change_accessory" /* McoNomOmNomChangeAccessory */, {
          pitch: 0.9 + Math.random() * 0.2,
          location: omNom.location
        });
      } else {
        open_accessories_window(omNom, player);
      }
    }).catch((err) => {
      warn(`Om Nom Accessory Option Error: ${err}`);
    });
  } catch (err) {
    error(`Om Nom Accessory UI error: ${err}`);
  }
}
function tame_anim_check(omNom) {
  const ranAnimation = omNom.getDynamicProperty("mco_nom:ran_tamed_anim") ?? false;
  const tamedComponent = omNom.getComponent("is_tamed");
  if (tamedComponent && !ranAnimation) {
    omNom.setDynamicProperty("mco_nom:ran_tamed_anim", true);
    omNom.runCommand("scriptevent mco_nom:om_nom_reaction tamed");
  } else {
    omNom.runCommand("scriptevent mco_nom:om_nom_reaction fed");
  }
}
function decrement_item(player, type, count = 1) {
  const inventory = player.getComponent("inventory");
  if (inventory == null)
    return;
  const container = inventory.container;
  const size = container.size;
  let total = count;
  for (let i = 0; i < size; i++) {
    if (total == 0)
      break;
    const itemInSlot = container.getItem(i);
    if (itemInSlot?.typeId != type)
      continue;
    else {
      const amount = itemInSlot?.amount;
      if (total >= amount) {
        container.setItem(i);
        total -= amount;
      } else {
        itemInSlot.amount -= total;
        container.setItem(i, itemInSlot);
        total = 0;
      }
    }
  }
}
function detonate(omNom) {
  try {
    omNom.dimension.createExplosion(omNom.location, 5, { breaksBlocks: true, source: omNom });
    omNom.dimension.spawnParticle("mco_nom:creeper_explosion", omNom.location);
    omNom.triggerEvent("mco_nom:got_downed");
  } catch (err) {
    warn(`Om Nom Detonate error: ${err}`);
  }
}
function fire_wave(omNom) {
  try {
    for (const entity of omNom.dimension.getEntities({ location: omNom.location, maxDistance: 5, families: ["monster"] })) {
      try {
        entity.setOnFire(Math.floor(2 + 5 * Math.random()), true);
      } catch (err) {
        warn(`Fire wave effect error: ${err}`);
      }
    }
  } catch (err) {
    warn(`Fire wave error: ${err}`);
  }
}

// data/gametests/src/mobs/MinigameEntity.js
import { world as world37, system as system39, ItemStack as ItemStack18 } from "@minecraft/server";
var log18 = Logger.getLogger("Collectable");
system39.afterEvents.scriptEventReceive.subscribe((e) => {
  const target = e.sourceEntity;
  const minigameSystemReady = world37.getDynamicProperty("mco_nom:minigame_system_ready") ?? false;
  if (!minigameSystemReady) {
    return;
  }
  if (e.id == "mco_nom:collectable_collect") {
    if (!target) {
      error(`A source entity is required to use mco_nom:collectable_collect.`);
      return;
    } else if (!target.matches({ families: ["collectable"] })) {
      error(`Only a collectable can use mco_nom:collectable_collect.`);
      return;
    }
    let playerList = target.getDynamicProperty("mco_nom:player_list") ?? "";
    for (const player of target.dimension.getPlayers({
      location: target.location,
      maxDistance: 3
    })) {
      if (!playerList.includes(`${player.id}`)) {
        if (target.typeId == "mco_nom:star") {
          system39.runTimeout(() => {
            try {
              player.playSound("mco_nom.star.collect" /* McoNomStarCollect */, {
                volume: 1,
                pitch: 1
              });
            } catch (error2) {
              target.dimension.playSound(
                "mco_nom.star.collect" /* McoNomStarCollect */,
                target.location,
                {
                  volume: 1,
                  pitch: 1
                }
              );
              error(error2);
            }
          }, 2);
          player.setDynamicProperty(
            "mco_nom:star_count",
            (player.getDynamicProperty("mco_nom:star_count") ?? 0) + 1
          );
          world37.setDynamicProperty(
            "mco_nom:star_count",
            (world37.getDynamicProperty("mco_nom:star_count") ?? 0) + 1
          );
        } else if (target.typeId == "mco_nom:candy") {
          system39.runTimeout(() => {
            try {
              player.playSound("mco_nom.candy.collect" /* McoNomCandyCollect */, {
                volume: 1,
                pitch: 1.1 + Math.random() * 0.2
              });
            } catch (error2) {
              target.dimension.playSound(
                "mco_nom.candy.collect" /* McoNomCandyCollect */,
                target.location,
                {
                  volume: 1,
                  pitch: 1.1 + Math.random() * 0.2
                }
              );
              error(error2);
            }
          }, 2);
          player.setDynamicProperty(
            "mco_nom:candy_count",
            (player.getDynamicProperty("mco_nom:candy_count") ?? 0) + 1
          );
          world37.setDynamicProperty(
            "mco_nom:candy_count",
            (world37.getDynamicProperty("mco_nom:candy_count") ?? 0) + 1
          );
          player.setDynamicProperty("mco_nom:parkour_checkpoint", target.location);
        }
        playerList = `${player.id};${playerList}`;
        target.playAnimation("animation.mco_nom.collectable.collect", {
          players: [player]
        });
        system39.runTimeout(() => {
          const minigameId = target.getDynamicProperty("mco_nom:minigame_id");
          if (!minigameId) {
            target.remove();
          }
        }, 35);
      }
    }
    target.setDynamicProperty("mco_nom:player_list", playerList);
  } else if (e.id == "mco_nom:minigame_entity_refresh") {
    if (!target) {
      error(`A source entity is required to use mco_nom:collectable_refresh.`);
      return;
    } else if (!target.matches({ families: ["nom_minigame_entity"] })) {
      error(`Only a minigame entity can use mco_nom:minigame_entity_refresh.`);
      return;
    }
    const minigameId = target.getDynamicProperty("mco_nom:minigame_id");
    if (minigameId) {
      const activeMinigameList = getRunningMinigames();
      const minigameActive = activeMinigameList.includes(minigameId);
      if (!minigameActive) {
        target.remove();
        return;
      }
    }
    const playerList = target.getDynamicProperty("mco_nom:player_list") ?? "";
    const playerArray = playerList.split(";");
    for (const playerId of playerArray) {
      if (playerId.length == 0) {
        continue;
      }
      const player = world37.getEntity(playerId);
      if (!player) {
        continue;
      }
      target.playAnimation("animation.mco_nom.collectable.collect", {
        players: [player]
      });
    }
  } else if (e.id == "mco_nom:minigame_entity_debug") {
    const entityDebug = world37.getDynamicProperty("mco_nom:minigame_entity_debug") ?? false;
    world37.setDynamicProperty("mco_nom:minigame_entity_debug", !entityDebug);
    if (entityDebug) {
      warn("Minigame Entity debug disabled");
    } else {
      warn("Minigame Entity debug enabled");
    }
  }
});
world37.afterEvents.entityLoad.subscribe((e) => {
  const entity = e.entity;
  try {
    if (["mco_nom:star", "mco_nom:candy"].includes(entity.typeId)) {
      entity.triggerEvent("mco_nom:add_knockback_resistance");
    }
  } catch (err) {
    warn(`Star/Candy Load Error: ${err}`);
  }
});

// data/gametests/src/items/ingredient/Ingredient.ts
import { system as system40, world as world38 } from "@minecraft/server";
var log19 = Logger.getLogger("IngredientAnimationManager");
system40.runInterval(() => {
  updatePlayerAnimations();
}, 10);
function updatePlayerAnimations() {
  const players = world38.getPlayers();
  for (const player of players) {
    try {
      const equipment = player.getComponent("equippable");
      if (!equipment)
        return false;
      const item = equipment.getEquipment("Mainhand");
      if (!item || !item.hasTag("mco_nom:ingredient")) {
        player.playAnimation("animation.mco_nom.player.equip_ingredient", { controller: "controller.animation.mco_nom.player_ingredient_carry", nextState: "animation.mco_nom.collectable.null", stopExpression: "!q.equipped_item_all_tags('slot.weapon.mainhand', 'mco_nom:ingredient')", blendOutTime: 0.1 });
        player.playAnimation("animation.mco_nom.collectable.null", { controller: "controller.animation.mco_nom.player_ingredient_carry", nextState: "animation.mco_nom.player.equip_ingredient", stopExpression: "q.equipped_item_all_tags('slot.weapon.mainhand', 'mco_nom:ingredient')", blendOutTime: 0.1 });
      }
    } catch (error2) {
      warn(`Error updating animation for player ${player.id}:`, error2);
      continue;
    }
  }
}

// data/gametests/src/mobs/Cauldron.ts
import { world as world39 } from "@minecraft/server";
var log20 = Logger.getLogger("CauldronEntity");
world39.afterEvents.entityLoad.subscribe((e) => {
  const entity = e.entity;
  try {
    if (entity.typeId == "mco_nom:cauldron") {
      entity.setDynamicProperty("mco_nom:cauldron_initialized", true);
      entity.runCommand("effect @s invisibility infinite 0 true");
      entity.triggerEvent("mco_nom:add_knockback_resistance");
      info("Cauldron entity initialized");
    }
  } catch (err) {
    warn(`Cauldron Load Error: ${err}`);
  }
});

// data/gametests/src/mobs/JumboCandy.ts
import { world as world40 } from "@minecraft/server";
var logger2 = Logger.getLogger("JumboCandy");
var JumboCandy = class _JumboCandy {
  constructor() {
    this.setUpEventListeners();
  }
  static getInstance() {
    if (!_JumboCandy.instance) {
      _JumboCandy.instance = new _JumboCandy();
    }
    return _JumboCandy.instance;
  }
  setUpEventListeners() {
    world40.afterEvents.entityHurt.subscribe((e) => {
      if (e.hurtEntity.typeId === "mco_nom:jumbo_candy") {
        this.updatePhase(e.hurtEntity);
      }
    });
  }
  updatePhase(entity) {
    try {
      const healthComponent = entity.getComponent("health");
      if (!healthComponent)
        return;
      const currentHealth = healthComponent.currentValue;
      const maxHealth = healthComponent.effectiveMax;
      const healthPercent = currentHealth / maxHealth;
      let newPhase;
      newPhase = healthPercent >= 0.9 ? 0 : healthPercent >= 0.7 ? 1 : healthPercent >= 0.5 ? 2 : healthPercent > 0.25 ? 3 : 4;
      const currentPhase = entity.getProperty("mco_nom:phase") ?? 0;
      if (currentPhase !== newPhase) {
        entity.setProperty("mco_nom:phase", newPhase);
        info(`Jumbo Candy phase updated to ${newPhase} (${Math.round(healthPercent * 100)}% health)`);
      }
    } catch (err) {
      warn(`Jumbo Candy phase update error: ${err}`);
    }
  }
};
var jumboCandy = JumboCandy.getInstance();

// data/gametests/src/mobs/SpiderBulky.ts
import { EntityDamageCause as EntityDamageCause2, system as system43, world as world41 } from "@minecraft/server";
var logger3 = Logger.getLogger("SpiderBulky");
var SpiderBulky = class _SpiderBulky {
  // 5 seconds cooldown (100 ticks)
  constructor() {
    this.lastStompTime = /* @__PURE__ */ new Map();
    this.STOMP_COOLDOWN = 100;
    this.setUpEventListeners();
  }
  static getInstance() {
    if (!_SpiderBulky.instance) {
      _SpiderBulky.instance = new _SpiderBulky();
    }
    return _SpiderBulky.instance;
  }
  setUpEventListeners() {
    world41.afterEvents.entityHitEntity.subscribe((e) => {
      const spiderBulky2 = e.damagingEntity;
      if (spiderBulky2.typeId !== "mco_nom:spider_bulky")
        return;
      const spiderId = spiderBulky2.id;
      const currentTime = system43.currentTick;
      const lastStomp = this.lastStompTime.get(spiderId) || 0;
      if (currentTime - lastStomp < this.STOMP_COOLDOWN) {
        return;
      }
      const rand = Math.random();
      if (rand < 0.3) {
        this.lastStompTime.set(spiderId, currentTime);
        spiderBulky2.playAnimation("smash");
        spiderBulky2.dimension.getEntities({
          location: spiderBulky2.location,
          maxDistance: 6,
          excludeFamilies: ["spider_minigame"]
        }).forEach((e2) => {
          system43.runTimeout(() => {
            e2.applyDamage(5, {
              cause: EntityDamageCause2.entityAttack
            });
            e2.applyKnockback(
              {
                x: e2.location.x - spiderBulky2.location.x,
                z: e2.location.z - spiderBulky2.location.z
              },
              0.3
            );
          }, 20);
        });
      }
    });
  }
};
var spiderBulky = SpiderBulky.getInstance();

// data/gametests/src/player/OmNomActions.js
import {
  world as world42,
  system as system44,
  ItemStack as ItemStack19,
  Player as Player24,
  Entity as Entity18,
  EntityComponentTypes as EntityComponentTypes5,
  EntityIsTamedComponent,
  EffectTypes,
  EffectType as EffectType2
} from "@minecraft/server";
var log21 = Logger.getLogger("OmNomActions");
var mandatoryActions = ["sneezing", "eating"];
system44.afterEvents.scriptEventReceive.subscribe((e) => {
  const target = e.sourceEntity;
  if (e.id == "mco_nom:om_nom_action") {
    if (!target) {
      error(`A source entity is required to use mco_nom:om_nom_action.`);
      return;
    } else if (target.typeId != "mco_nom:om_nom") {
      error(`Only Om Nom can use mco_nom:om_nom_action.`);
      return;
    }
    setOmNomAction(target, e.message);
  } else if (e.id == "mco_nom:om_nom_reaction") {
    if (!target) {
      error(`A source entity is required to use mco_nom:om_nom_reaction.`);
      return;
    } else if (target.typeId != "mco_nom:om_nom") {
      error(`Only Om Nom can use mco_nom:om_nom_reaction.`);
      return;
    }
    const action = e.message;
    switch (action) {
      case "craft":
        setOmNomAction(target, "sneezing", { actionDuration: 1.2 });
        break;
      case "fed":
        setOmNomAction(target, "eating", { actionDuration: 0.75 });
        break;
      case "interact":
        setOmNomAction(target, "waving", { actionDuration: 1.75 });
        break;
      case "food_hidden":
        setOmNomAction(target, "sad", { actionDuration: 2.5 });
        break;
      case "transform_to_blaze":
        setOmNomAction(target, "transforming", { actionDuration: 2.5 });
        break;
      case "transform_to_creeper":
        setOmNomAction(target, "transforming", { actionDuration: 5 });
        break;
      case "transform_to_dragon":
        setOmNomAction(target, "transforming", { actionDuration: 1.5 });
        break;
      case "transform_to_ghost":
        setOmNomAction(target, "transforming", { actionDuration: 2.75 });
        break;
      case "transform_to_guardian":
        setOmNomAction(target, "transforming", { actionDuration: 2.5 });
        break;
      case "transform_to_pig":
        setOmNomAction(target, "transforming", { actionDuration: 2 });
        break;
      case "transform_to_scientist":
        setOmNomAction(target, "transforming", { actionDuration: 3.75 });
        break;
      case "transform_to_super":
        setOmNomAction(target, "transforming", { actionDuration: 3.25 });
        break;
      case "tamed":
        system44.runTimeout(() => {
          setOmNomAction(target, "excited", { actionDuration: 0.75 });
        }, 10);
        break;
    }
  } else if (e.id == "mco_nom:jukebox_check") {
    if (!target) {
      error(`A source entity is required to use mco_nom:jukebox_check.`);
      return;
    } else if (target.typeId != "mco_nom:om_nom") {
      error(`Only Om Nom can use mco_nom:jukebox_check.`);
      return;
    }
    jukeboxCheck(target);
  }
});
world42.afterEvents.playerInteractWithBlock.subscribe((event) => {
  const { block, player } = event;
  const blockID = block?.typeId;
  const interestingBlocks = ["minecraft:crafting_table"];
  const excitingBlocks = [];
  switch (true) {
    case interestingBlocks.includes(blockID):
      sendOmNomActionImpulse(player, "curious");
      break;
    case excitingBlocks.includes(blockID):
      sendOmNomActionImpulse(player, "excited", { actionDuration: 1.5 });
      break;
  }
});
world42.beforeEvents.playerBreakBlock.subscribe((event) => {
  const { block, player } = event;
  const blockID = block?.typeId;
  const excitingBlocks = [];
  switch (true) {
    case excitingBlocks.includes(blockID):
    case blockID.includes(":diamond_ore"):
    case blockID.includes("_diamond_ore"):
      sendOmNomActionImpulse(player, "excited", { actionDuration: 1.5 });
      break;
  }
});
world42.afterEvents.entityHitEntity.subscribe((event) => {
  const { damagingEntity, hitEntity } = event;
  if (damagingEntity.typeId == "minecraft:player" && hitEntity.typeId == "mco_nom:om_nom") {
    setOmNomAction(hitEntity, "petting", { actionDuration: 3.8 });
  }
});
world42.afterEvents.playerInteractWithBlock.subscribe((event) => {
  const { block, player, beforeItemStack } = event;
  if (block.typeId == "minecraft:bed") {
    system44.runTimeout(() => {
      if (player.isSleeping) {
        const omNoms = getNearbyOwnedOmNoms(player);
        omNoms.forEach((nom) => {
          setOmNomAction(nom, "sleeping", {
            shouldInterruptDancing: true,
            isIndefinite: true
          });
        });
      }
    }, 5);
  }
  if (block.typeId == "minecraft:jukebox") {
    const omNoms = getNearbyOwnedOmNoms(player);
    switch (true) {
      case beforeItemStack == void 0:
        for (const nom of omNoms) {
          system44.run(() => {
            nom.setProperty(`mco_nom:om_nom_action`, "none");
          });
        }
        break;
      case beforeItemStack?.typeId.includes(`music_disc_`):
        for (const nom of omNoms) {
          nom.setDynamicProperty("mco_nom:jukebox_location", block.location);
          setOmNomAction(nom, "dancing", { isIndefinite: true });
        }
        break;
    }
  }
});
function getNearbyOwnedOmNoms(owner) {
  const dimension = owner.dimension;
  let ownedNoms = [];
  const nearbyOmNoms = dimension.getEntities({
    location: owner.location,
    maxDistance: 16,
    type: "mco_nom:om_nom"
  });
  nearbyOmNoms.forEach((entity) => {
    const tameableComponent = entity.getComponent("tameable");
    if (tameableComponent && tameableComponent.tamedToPlayer == owner) {
      ownedNoms.push(entity);
    }
  });
  return ownedNoms;
}
function setOmNomAction(omnom, action, options = {
  isInstant: false,
  actionDuration: void 0,
  shouldInterruptDancing: false,
  shouldSuspendMovement: false,
  isIndefinite: false
}) {
  if (action != "eating" && (omnom.getProperty("mco_nom:crafting_mode") || omnom.getProperty("mco_nom:crafting_started")) || !omnom.getProperty("mco_nom:interactions_enabled") && !mandatoryActions.includes(action))
    return;
  system44.run(() => {
    let endDelay = options.actionDuration ?? (options.isInstant ? 0.05 : 3);
    let currentAction = omnom.getProperty(`mco_nom:om_nom_action`);
    if (!options.shouldInterruptDancing) {
      if (currentAction == "dancing")
        return;
    }
    if (options.shouldSuspendMovement) {
      omnom.addEffect("slowness", endDelay * 20, {
        amplifier: 255,
        showParticles: false
      });
    }
    omnom.setProperty(`mco_nom:om_nom_action`, action);
    if (!options.isIndefinite) {
      system44.runTimeout(() => {
        currentAction = omnom.getProperty(`mco_nom:om_nom_action`);
        if (currentAction == "none")
          return;
        omnom.setProperty(`mco_nom:om_nom_action`, `none`);
      }, endDelay * 20);
    }
  });
}
function sendOmNomActionImpulse(player, action, config) {
  const omNoms = getNearbyOwnedOmNoms(player);
  omNoms.forEach((nom) => {
    setOmNomAction(nom, action, config);
  });
}
function jukeboxCheck(omNom) {
  try {
    const loc = omNom.getDynamicProperty("mco_nom:jukebox_location");
    const block = omNom.dimension.getBlock(loc);
    if (block.typeId != "minecraft:jukebox" || block.getRedstonePower() == 0) {
      omNom.setProperty(`mco_nom:om_nom_action`, `none`);
    }
  } catch (err) {
    warn(`Jukebox check error: ${err}`);
    try {
      omNom.setProperty(`mco_nom:om_nom_action`, `none`);
    } catch (err2) {
    }
  }
}

// data/gametests/src/systems/MinigameManager.ts
import { world as world43, system as system45, Player as Player25 } from "@minecraft/server";
var log22 = Logger.getLogger("Minigame Manager");
function test_reload() {
  world43.setDynamicProperty("mco_nom:minigame_system_ready", false);
  if (world43.getPlayers().length < 1) {
    return;
  }
  const activeMinigameList = getRunningMinigames();
  info(`Running minigames: ${activeMinigameList?.length}`);
  try {
    if (activeMinigameList && activeMinigameList.length != 0) {
      info("Closing all minigames from a previous session.");
      for (const activeMinigame of activeMinigameList) {
        try {
          const data = world43.getDynamicProperty(
            `mco_nom:minigame_data_${activeMinigame}`
          );
          if (!data) {
            throw new Error(`Minigame data is blank. Cannot load.`);
          }
          const parsedData = JSON.parse(String(data));
          if (parsedData.type == "ParkourMinigame") {
            let timerSeconds = 0;
            new ParkourMinigame(
              void 0,
              parsedData.level,
              parsedData.origin,
              world43.getDimension(parsedData.dimensionId),
              parsedData.playerIDList,
              {
                formReward: parsedData.formReward,
                costumeReward: parsedData.costumeReward,
                accessoryReward: parsedData.accessoryReward
              },
              true,
              parsedData.minigameId,
              timerSeconds
            );
          } else if (parsedData.type == "CauldronMinigame") {
            let timerSeconds = 0;
            new CauldronMinigame(
              void 0,
              parsedData.level,
              parsedData.origin,
              world43.getDimension(parsedData.dimensionId),
              parsedData.playerIDList,
              {
                formReward: parsedData.formReward,
                costumeReward: parsedData.costumeReward,
                accessoryReward: parsedData.accessoryReward
              },
              true,
              parsedData.minigameId,
              timerSeconds
            );
          } else if (parsedData.type == "SpiderDefenseMinigame") {
            const index = activeMinigameList.indexOf(`${activeMinigame}`);
            if (index != -1) {
              activeMinigameList.splice(index, 1);
              world43.setDynamicProperty(
                `mco_nom:minigame_list`,
                `${activeMinigameList.join(";")}`
              );
            }
          } else {
            throw new Error(`Unsupported Minigame Type: ${parsedData.type}`);
          }
        } catch (err) {
          warn(err);
          const index = activeMinigameList.indexOf(`${activeMinigame}`);
          if (index != -1) {
            activeMinigameList.splice(index, 1);
            world43.setDynamicProperty(
              `mco_nom:minigame_list`,
              `${activeMinigameList.join(";")}`
            );
          }
        }
      }
    }
  } catch (err) {
    warn(`Minigame reload error: ${err}`);
    world43.setDynamicProperty("mco_nom:minigame_active", false);
  } finally {
    system45.clearRun(loadTick);
    world43.setDynamicProperty("mco_nom:minigame_system_ready", true);
  }
}
var loadTick = system45.runInterval(test_reload, 60);
system45.run(test_reload);
system45.afterEvents.scriptEventReceive.subscribe(({ sourceEntity, id }) => {
  if (sourceEntity === void 0 || sourceEntity instanceof Player25 === false)
    return;
  const player = sourceEntity;
  if (id === "nom:get_active_minigames") {
    const activeMinigameString = getRunningMinigames();
    if (!activeMinigameString || activeMinigameString.length == 0) {
      info("No running minigames.");
    } else {
      info(activeMinigameString);
    }
  }
});

// data/gametests/src/main.ts
Polyfill.installConsole();
Polyfill.installPlayer();
