// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/di/container.js
var __classPrivateFieldGet = function(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _Container_instances;
var _Container_throw;
var InjectionError = class extends Error {
  /**
   * @param property The type that was being bound to or injected.
   * @param message The error message.
   */
  constructor(property2, message) {
    super(message != null ? `${property2.name}: ${message}` : property2.name);
    this.property = property2;
  }
};
var BIND_SUBCLASSES_KEY = "__noxcrew_bind_subclasses";
var Container = class _Container {
  constructor() {
    _Container_instances.add(this);
    this.types = /* @__PURE__ */ new Map();
  }
  static bindableTypes(type) {
    const out = [];
    let _proto = type.prototype;
    do {
      const ctor = _proto.constructor;
      if (ctor === type || ctor.hasOwnProperty(BIND_SUBCLASSES_KEY)) {
        out.push(ctor);
      }
      _proto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : void 0;
    } while (_proto != void 0);
    return out;
  }
  /**
   * Binds an instance to a type.
   * @param instance the instance to bind
   * @param type the constructor of the type to bind, or the instance's own constructor by default
   * @throws InjectionError if an instance has already been bound for the type
   */
  bind(instance, type = instance.constructor) {
    const typesToBind = _Container.bindableTypes(type);
    for (const typeToBind of typesToBind) {
      if (this.types.has(typeToBind)) {
        throw new InjectionError(typeToBind, `Attempted re-registration`);
      }
      this.types.set(typeToBind, instance);
    }
  }
  /**
   * Unbinds a given type's bound instance, ignoring {@link BindSubclasses}-marked superclasse.
   * @param type the constructor of the type to unbind
   * @return true if the type had a bound instance which has been removed, false otherwise
   */
  unbindForType(type) {
    return this.types.delete(type);
  }
  /**
   * Unbinds an instance from a type, as well as any {@link BindSubclasses}-marked superclasses it's also bound to.
   * @param instance the instance to unbind
   * @param type the type to unbind from. Defaults to the instance's own constructor
   * @return true if the instance was bound to the type and was unbound, false otherwise
   */
  unbind(instance, type = instance.constructor) {
    let hasRemovedAType = false;
    for (const typeToUnbind of _Container.bindableTypes(type)) {
      if (this.types.get(typeToUnbind) === instance) {
        this.types.delete(typeToUnbind);
        hasRemovedAType = true;
      }
    }
    return hasRemovedAType;
  }
  /**
   * Eagerly fetches a type's bound instance.
   * @param type the type of object to get
   * @return the instance, or undefined if nothing is bound
   */
  getOrNull(type) {
    return this.types.get(type);
  }
  /**
   * Eagerly fetches a type's bound instance, throwing an {@link InjectionError} if nothing is bound.
   * @param type the type of object to get
   * @return the instance
   * @throws InjectionError if there's nothing bound to the type
   */
  get(type) {
    return this.getOrNull(type) ?? __classPrivateFieldGet(this, _Container_instances, "m", _Container_throw).call(this, type);
  }
  inject(type, nullable = false) {
    const realValue = () => nullable ? this.getOrNull(type) : this.get(type);
    return new Proxy({}, {
      set(target, p, newValue, receiver) {
        const value = realValue();
        if (value === void 0)
          return false;
        return Reflect.set(value, p, newValue, receiver);
      },
      get(target, p, receiver) {
        const value = realValue();
        if (value === void 0)
          return void 0;
        const val = Reflect.get(value, p, receiver);
        return typeof val === "function" ? val.bind(realValue()) : val;
      }
    });
  }
};
_Container_instances = /* @__PURE__ */ new WeakSet(), _Container_throw = function _Container_throw2(key) {
  throw new InjectionError(key, `Attempted to inject unbound type`);
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/buildInfo.js
var buildInfo;
async function getBuildInfo() {
  if (buildInfo == null)
    buildInfo = import(
      /*webpackIgnore: true*/
      "noxcrew.creative-toolbox.buildinfo"
    ).then((r) => r.default).catch(() => null);
  return await buildInfo;
}

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/error.js
function formatError(error) {
  if (error instanceof Error) {
    return `${error.name}: ${error.message} ${error.stack}`;
  }
  return `${error}`;
}

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/getPlayersName.js
import { world } from "@minecraft/server";
function GetPlayerFromName(name) {
  return world.getPlayers({ name })[0];
}

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/multimap.js
var Multimap = class extends Map {
  /**
   * Adds a value to a key. If the key doesn't exist, it is created.
   * @param {TKey} key the key to add the value to
   * @param {TVal} value the value to add
   * @returns {Multimap<TKey, TVal>} the Multimap instance
   */
  add(key, value) {
    let array = this.get(key);
    if (!array) {
      array = [];
      super.set(key, array);
    }
    array.push(value);
    return this;
  }
  /**
   * Adds all values from the provided array to a key. If the key doesn't exist, it is created.
   * @param {TKey} key the key to add the values to
   * @param {TVal[]} val the array of values to add
   * @returns {Multimap<TKey, TVal>} The Multimap instance
   */
  addAll(key, val) {
    const existing = this.get(key);
    if (existing == null) {
      this.set(key, val);
      return this;
    }
    existing.push(...val);
    return this;
  }
  /**
   * Removes a value from every element array.
   * @param value the value to remove
   * @return a set of the keys that the element was removed from
   */
  removeValue(value) {
    const keys = /* @__PURE__ */ new Set();
    for (const [key, array] of this) {
      for (let idx = array.indexOf(value); idx != -1; idx = array.indexOf(value)) {
        keys.add(key);
        array.splice(idx, 1);
      }
    }
    return keys;
  }
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/propertyKey.js
function property(key) {
  return key;
}

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/stringToVector3.js
function stringToVector3(input) {
  if (Array.isArray(input)) {
    return input.map((str) => stringToVector3(str));
  } else {
    const values = input.split(" ");
    return { x: parseFloat(values[0]), y: parseFloat(values[1]), z: parseFloat(values[2]) };
  }
}

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/math/clamp.js
function clampNumber(val, min, max) {
  return Math.min(Math.max(val, min), max);
}

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/math/vectorUtils.js
var Vector3Utils = class _Vector3Utils {
  /**
   * equals
   *
   * Check the equality of two vectors
   */
  static equals(v1, v2) {
    return v1.x === v2.x && v1.y === v2.y && v1.z === v2.z;
  }
  /**
   * add
   *
   * Add two vectors to produce a new vector
   */
  static add(v1, v2) {
    return { x: v1.x + v2.x, y: v1.y + v2.y, z: v1.z + v2.z };
  }
  /**
   * subtract
   *
   * Subtract two vectors to produce a new vector (v1-v2)
   */
  static subtract(v1, v2) {
    return { x: v1.x - v2.x, y: v1.y - v2.y, z: v1.z - v2.z };
  }
  /** scale
   *
   * Multiple all entries in a vector by a single scalar value producing a new vector
   */
  static scale(v1, scale) {
    return { x: v1.x * scale, y: v1.y * scale, z: v1.z * scale };
  }
  /**
   * dot
   *
   * Calculate the dot product of two vectors
   */
  static dot(a, b) {
    return a.x * b.x + a.y * b.y + a.z * b.z;
  }
  /**
   * cross
   *
   * Calculate the cross product of two vectors. Returns a new vector.
   */
  static cross(a, b) {
    return {
      x: a.y * b.z - a.z * b.y,
      y: a.z * b.x - a.x * b.z,
      z: a.x * b.y - a.y * b.x
    };
  }
  /**
   * magnitude
   *
   * The magnitude of a vector
   */
  static magnitude(v) {
    return Math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2);
  }
  /**
   * normalize
   *
   * Takes a vector 3 and normalizes it to a unit vector
   */
  static normalize(v) {
    const mag = _Vector3Utils.magnitude(v);
    return { x: v.x / mag, y: v.y / mag, z: v.z / mag };
  }
  /**
   * floor
   *
   * Floor the components of a vector to produce a new vector
   */
  static floor(v) {
    return { x: Math.floor(v.x), y: Math.floor(v.y), z: Math.floor(v.z) };
  }
  /**
   * toString
   *
   * Create a string representation of a vector3
   */
  static toString(v, options) {
    const decimals = options?.decimals ?? 2;
    const str = [v.x.toFixed(decimals), v.y.toFixed(decimals), v.z.toFixed(decimals)];
    return str.join(options?.delimiter ?? ", ");
  }
  /**
   * clamp
   *
   * Clamps the components of a vector to limits to produce a new vector
   */
  static clamp(v, limits) {
    return {
      x: clampNumber(v.x, limits?.min?.x ?? Number.MIN_SAFE_INTEGER, limits?.max?.x ?? Number.MAX_SAFE_INTEGER),
      y: clampNumber(v.y, limits?.min?.y ?? Number.MIN_SAFE_INTEGER, limits?.max?.y ?? Number.MAX_SAFE_INTEGER),
      z: clampNumber(v.z, limits?.min?.z ?? Number.MIN_SAFE_INTEGER, limits?.max?.z ?? Number.MAX_SAFE_INTEGER)
    };
  }
};
var VECTOR3_UP = { x: 0, y: 1, z: 0 };
var VECTOR3_ZERO = { x: 0, y: 0, z: 0 };

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/util/math/vectorWrapper.js
var Vector3Builder = class {
  constructor(first, y, z) {
    if (typeof first === "object") {
      this.x = first.x;
      this.y = first.y;
      this.z = first.z;
    } else {
      this.x = first;
      this.y = y ?? 0;
      this.z = z ?? 0;
    }
  }
  /**
   * Assigns the values of the passed in vector to this vector. Returns itself.
   */
  assign(vec) {
    this.x = vec.x;
    this.y = vec.y;
    this.z = vec.z;
    return this;
  }
  /**
   * equals
   *
   * Check the equality of two vectors
   */
  equals(v) {
    return Vector3Utils.equals(this, v);
  }
  /**
   * add
   *
   * Adds the vector v to this, returning itself.
   */
  add(v) {
    return this.assign(Vector3Utils.add(this, v));
  }
  /**
   * subtract
   *
   * Subtracts the vector v from this, returning itself.
   */
  subtract(v) {
    return this.assign(Vector3Utils.subtract(this, v));
  }
  /** scale
   *
   * Scales this by the passed in value, returning itself.
   */
  scale(val) {
    return this.assign(Vector3Utils.scale(this, val));
  }
  /**
   * dot
   *
   * Computes the dot product of this and the passed in vector.
   */
  dot(vec) {
    return Vector3Utils.dot(this, vec);
  }
  /**
   * cross
   *
   * Computes the cross product of this and the passed in vector, returning itself.
   */
  cross(vec) {
    return this.assign(Vector3Utils.cross(this, vec));
  }
  /**
   * magnitude
   *
   * The magnitude of the vector
   */
  magnitude() {
    return Vector3Utils.magnitude(this);
  }
  /**
   * normalize
   *
   * Normalizes this vector, returning itself.
   */
  normalize() {
    return this.assign(Vector3Utils.normalize(this));
  }
  /**
   * floor
   *
   * Floor the components of a vector to produce a new vector
   */
  floor() {
    return this.assign(Vector3Utils.floor(this));
  }
  /**
   * toString
   *
   * Create a string representation of a vector
   */
  toString(options) {
    return Vector3Utils.toString(this, options);
  }
  /**
   * clamp
   *
   * Clamps the components of a vector to limits to produce a new vector
   */
  clamp(limits) {
    return this.assign(Vector3Utils.clamp(this, limits));
  }
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/module/module.js
var __classPrivateFieldGet2 = function(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
};
var _Module_isActive;
var _Module_hasBeenSetUp;
var _Module_childModules;
function Hook(event) {
  return (method, context) => {
    context.addInitializer(function() {
      if (this[method.name] !== method) {
        throw new Error(`Child classes must not override hooks (${method.name} overrides ${this.constructor.name})`);
      }
      this.registerHook(event, method);
    });
    return method;
  };
}
var Module = class {
  constructor(container) {
    this.container = container;
    this.listeners = new Multimap();
    this.lifecycleHooks = new Multimap();
    _Module_isActive.set(this, false);
    _Module_hasBeenSetUp.set(this, false);
    _Module_childModules.set(this, /* @__PURE__ */ new Set());
  }
  /**
   * Registers a hook to be called on when a lifecycle event is triggered. Hooks are invoked in register order.
   * @param event the lifecycle event to listen for
   * @param handler the hook function, called with the module as `this`
   */
  registerHook(event, handler) {
    this.lifecycleHooks.add(event, handler);
  }
  invokeHook(event) {
    const hooks = this.lifecycleHooks.get(event);
    if (hooks == void 0)
      return;
    for (const hook of hooks) {
      hook.call(this);
    }
  }
  /**
   * Sets up the module.
   * @deprecated Replace with a {@link LifecycleEvent.Setup} hook.
   */
  setup() {
  }
  /**
   * Override this method to add custom setup logic.
   * @deprecated Replace with a {@link LifecycleEvent.Activate} hook.
   */
  onActivate() {
  }
  /**
   * Override this method to add custom teardown logic.
   * @deprecated Replace with a {@link LifecycleEvent.Deactivate} hook.
   */
  onDeactivate() {
  }
  /**
   * Listens for an event, tied to the lifecycle of the module.
   * @param signal the signal to listen for events from
   * @param callback the callback to invoke for the event
   * @protected
   */
  listenFor(signal, callback) {
    this.listeners.add(signal, callback);
    if (this.isActive) {
      signal.subscribe(callback);
    }
  }
  get isActive() {
    return __classPrivateFieldGet2(this, _Module_isActive, "f");
  }
  activate() {
    if (__classPrivateFieldGet2(this, _Module_isActive, "f"))
      throw new Error("Module is already active");
    if (!__classPrivateFieldGet2(this, _Module_hasBeenSetUp, "f")) {
      this.invokeHook(
        "setup"
        /* LifecycleEvent.Setup */
      );
      this.setup();
      __classPrivateFieldSet(this, _Module_hasBeenSetUp, true, "f");
    }
    try {
      this.onActivate();
      this.invokeHook(
        "activate"
        /* LifecycleEvent.Activate */
      );
      this.listeners.forEach((value, key) => {
        for (const callback of value) {
          key.subscribe(callback);
        }
      });
      __classPrivateFieldSet(this, _Module_isActive, true, "f");
      for (const childModule of __classPrivateFieldGet2(this, _Module_childModules, "f")) {
        childModule.activate();
      }
    } catch (e) {
      console.error(`Failed to activate ${this.constructor.name}. Deactivating.`);
      console.error(e);
      this.deactivate();
    }
  }
  deactivate() {
    if (!__classPrivateFieldGet2(this, _Module_isActive, "f"))
      throw new Error("Can't deactivate an already inactive module");
    try {
      this.onDeactivate();
      this.invokeHook(
        "deactivate"
        /* LifecycleEvent.Deactivate */
      );
    } catch (ex) {
      console.error(`While deactivating ${this.constructor.name}: ${ex}`);
      console.error(formatError(ex));
    }
    this.listeners.forEach((value, key) => {
      for (const callback of value) {
        key.unsubscribe(callback);
      }
    });
    __classPrivateFieldSet(this, _Module_isActive, false, "f");
    for (const childModule of __classPrivateFieldGet2(this, _Module_childModules, "f")) {
      try {
        if (childModule.isActive) {
          childModule.deactivate();
        } else {
          console.warn(`Tried to deactivate inactive child ${childModule.constructor.name} (child of ${this.constructor.name})`);
        }
      } catch (ex) {
        console.error(`While deactivating ${childModule.constructor.name} (child of ${this.constructor.name}): ${formatError(ex)}`);
      }
    }
  }
  get children() {
    return __classPrivateFieldGet2(this, _Module_childModules, "f");
  }
  /**
   * Registers a module as a child of this module.
   * Its activation state will be synchronised with this module.
   * @param child the module to register
   * @throws Error if the module has already been registered with this module or is already active
   */
  registerChild(child) {
    if (__classPrivateFieldGet2(this, _Module_childModules, "f").has(child))
      throw new Error("Can't re-register an already registered child module");
    if (child.isActive)
      throw new Error("Can't register an already active child module");
    __classPrivateFieldGet2(this, _Module_childModules, "f").add(child);
    if (this.isActive) {
      child.activate();
    }
  }
  /**
   * Unregisters a module as a child of this module.
   * Its activation state will be synchronised with this module.
   * @param child the module to unregister
   * @throws Error if the module has already been registered with this module or is already active
   */
  unregisterChild(child) {
    if (!__classPrivateFieldGet2(this, _Module_childModules, "f").has(child))
      throw new Error("Can't unregister a child module that's not registered");
    __classPrivateFieldGet2(this, _Module_childModules, "f").delete(child);
    if (child.isActive) {
      child.deactivate();
    }
  }
};
_Module_isActive = /* @__PURE__ */ new WeakMap(), _Module_hasBeenSetUp = /* @__PURE__ */ new WeakMap(), _Module_childModules = /* @__PURE__ */ new WeakMap();

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/module/autoload.js
var AutoLoaderModule = class _AutoLoaderModule extends Module {
  constructor(container) {
    super(container);
  }
  setup() {
  }
  static async loadDependency(dependency) {
    return (await import(`${dependency}/__autoload.js`)).default;
  }
  /** Creates an {@link AutoLoaderModule} and auto-loads modules if needed. */
  static async createIfNeeded(entrypoint) {
    const buildInfo2 = await getBuildInfo();
    if (buildInfo2 == null || buildInfo2.autoload.length == 0)
      return;
    const modules = [];
    await Promise.all(buildInfo2.autoload.map(async (moduleName) => {
      try {
        const module = await this.loadDependency(moduleName);
        if (!(module instanceof Module)) {
          throw new TypeError(`Default export was not a module`);
        }
        modules.push(module);
      } catch (e) {
        console.error(`Error while autoloading ${moduleName}:`, e);
      }
    }));
    if (modules.length == 0)
      return;
    const autoloadModule = new _AutoLoaderModule(entrypoint);
    for (const child of modules) {
      autoloadModule.registerChild(child);
    }
    return autoloadModule;
  }
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/debugReport.js
import { system, Player } from "@minecraft/server";
var DebugReportModule = class _DebugReportModule extends Module {
  /**
   * Creates a debug report.
   */
  async createReport() {
    const out = ["---"];
    const buildInfo2 = await getBuildInfo();
    if (buildInfo2 == null) {
      out.push("No build info");
    } else {
      out.push(buildInfo2.buildConfiguration);
      out.push("Modules:");
      for (const [name, version] of Object.entries(buildInfo2.modules)) {
        out.push(`${name} v${version}`);
      }
    }
    out.push("--");
    out.push("Loaded registerables:");
    this.pushRegisterable(this.container, out);
    out.push("---");
    return out.join("\n");
  }
  /**
   * Puts registerable names into {@link out}, recursively adding children if the registerable is also a {@link RegisterableHolder}.
   * @param registerable the registerable
   * @param out the output array
   * @param depth the current parent depth. Should be 0 when calling externally.
   */
  pushRegisterable(registerable, out, depth = 0) {
    out.push(`| `.repeat(depth) + `${registerable.constructor.name}`);
    if ("children" in registerable && registerable.children instanceof Set) {
      for (const child of registerable.children) {
        this.pushRegisterable(child, out, depth + 1);
      }
    }
  }
  setup() {
    this.listenFor(system.afterEvents.scriptEventReceive, (e) => {
      if (e.id != _DebugReportModule.EVENT_NAME || e.initiator instanceof Player)
        return;
      this.createReport().then(console.error);
    });
  }
};
DebugReportModule.EVENT_NAME = "noxcrew.common.scripting:debug";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/module/entrypoint.js
var Entrypoint = class _Entrypoint extends Container {
  constructor() {
    super();
    this.modules = /* @__PURE__ */ new Set();
    this.hasBeenStarted = false;
  }
  get children() {
    return this.modules;
  }
  /**
   * Registers a module. It will be loaded when the entrypoint is launched.
   * @param module the module to register
   */
  register(module) {
    if (module.isActive)
      throw new Error(`Cannot register already active module ${module.constructor.name}!`);
    this.modules.add(module);
    if (this.hasBeenStarted)
      module.activate();
  }
  /**
   * Binds and registers a module.
   * @see Container.bind
   * @see register
   */
  bindAndRegister(module) {
    this.bind(module);
    this.register(module);
  }
  /**
   * Unregisters a module.
   */
  unregister(module) {
    if (!this.modules.delete(module))
      return;
    if (module.isActive)
      module.deactivate();
  }
  /**
   * Launches an entrypoint.
   * @param initFn an init function to bind and register modules with
   */
  static async launch(initFn) {
    const entrypoint = new _Entrypoint();
    await initFn.call(entrypoint);
    const autoloader = await AutoLoaderModule.createIfNeeded(entrypoint);
    if (autoloader != null)
      entrypoint.register(autoloader);
    entrypoint.register(new DebugReportModule(entrypoint));
    for (const module of entrypoint.modules) {
      module.activate();
    }
    entrypoint.hasBeenStarted = true;
    return entrypoint;
  }
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/invokeFunctionOnButtonPress.js
import { world as world2 } from "@minecraft/server";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/invokeFunctionOnUseItem.js
import { world as world3 } from "@minecraft/server";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/dimensionPlayerGroup.js
import { world as world5 } from "@minecraft/server";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/playerGroup.js
import { system as system2, world as world4 } from "@minecraft/server";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/api/events/dispatcher.js
var EventDispatcher = class {
  constructor() {
    this.listeners = [];
  }
  subscribe(callback) {
    this.listeners.push(callback);
    return callback;
  }
  unsubscribe(callback) {
    const index = this.listeners.indexOf(callback);
    if (index == -1)
      return;
    this.listeners.splice(index, 1);
  }
  /**
   * Dispatches an event.
   * @param event the event
   */
  dispatch(event) {
    for (const listener of this.listeners) {
      try {
        listener(event);
      } catch (e) {
        console.error(`Caught exception in event handler: ${e}`);
      }
    }
  }
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/playerGroup.js
var __runInitializers = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var PlayerGroup = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupPlayerGroup_decorators;
  return _a = class PlayerGroup extends _classSuper {
    constructor() {
      super(...arguments);
      this.events = (__runInitializers(this, _instanceExtraInitializers), new EventDispatcher());
      this.players = /* @__PURE__ */ new Set();
    }
    setupPlayerGroup() {
      this.listenFor(world4.beforeEvents.playerLeave, (e) => {
        system2.run(() => {
          this.removePlayer(e.player);
        });
      });
    }
    addPlayer(player) {
      if (this.players.has(player))
        return;
      this.players.add(player);
      this.events.dispatch({
        type: "add",
        player
      });
    }
    removePlayer(player) {
      if (!this.players.delete(player))
        return;
      this.events.dispatch({
        type: "remove",
        player
      });
      if (this.players.size == 0) {
        this.events.dispatch({ type: "disband" });
      }
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupPlayerGroup_decorators = [Hook(
      "setup"
      /* LifecycleEvent.Setup */
    )];
    __esDecorate(_a, null, _setupPlayerGroup_decorators, { kind: "method", name: "setupPlayerGroup", static: false, private: false, access: { has: (obj) => "setupPlayerGroup" in obj, get: (obj) => obj.setupPlayerGroup }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/dimensionPlayerGroup.js
var __runInitializers2 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate2 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var DimensionPlayerGroup = (() => {
  var _a;
  let _classSuper = PlayerGroup;
  let _instanceExtraInitializers = [];
  let _setupDimensionPlayerGroup_decorators;
  return _a = class DimensionPlayerGroup extends _classSuper {
    constructor(container, dimension) {
      super(container);
      this.dimension = (__runInitializers2(this, _instanceExtraInitializers), dimension);
      for (const player of dimension.getPlayers()) {
        this.players.add(player);
      }
    }
    setupDimensionPlayerGroup() {
      this.listenFor(world5.beforeEvents.playerLeave, (e) => {
        this.removePlayer(e.player);
      });
      this.listenFor(world5.afterEvents.playerDimensionChange, (e) => {
        if (e.toDimension == this.dimension) {
          this.players.add(e.player);
        } else {
          this.players.delete(e.player);
        }
      });
      this.listenFor(world5.afterEvents.playerSpawn, (e) => {
        if (e.initialSpawn && e.player.dimension == this.dimension) {
          this.players.add(e.player);
        }
      });
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupDimensionPlayerGroup_decorators = [Hook(
      "setup"
      /* LifecycleEvent.Setup */
    )];
    __esDecorate2(_a, null, _setupDimensionPlayerGroup_decorators, { kind: "method", name: "setupDimensionPlayerGroup", static: false, private: false, access: { has: (obj) => "setupDimensionPlayerGroup" in obj, get: (obj) => obj.setupDimensionPlayerGroup }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/globalPlayerGroups.js
import { world as world6 } from "@minecraft/server";
var __runInitializers3 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate3 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var GlobalPlayerGroups = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupGlobalPlayerGroups_decorators;
  return _a = class GlobalPlayerGroups extends _classSuper {
    constructor() {
      super(...arguments);
      this.overworld = (__runInitializers3(this, _instanceExtraInitializers), void 0);
    }
    setupGlobalPlayerGroups() {
      this.overworld = new DimensionPlayerGroup(this.container, world6.getDimension("overworld"));
      this.registerChild(this.overworld);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupGlobalPlayerGroups_decorators = [Hook(
      "setup"
      /* LifecycleEvent.Setup */
    )];
    __esDecorate3(_a, null, _setupGlobalPlayerGroups_decorators, { kind: "method", name: "setupGlobalPlayerGroups", static: false, private: false, access: { has: (obj) => "setupGlobalPlayerGroups" in obj, get: (obj) => obj.setupGlobalPlayerGroups }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/tickingModule.js
import { system as system3 } from "@minecraft/server";
var TickingModule = class extends Module {
  constructor(container, tickInterval) {
    super(container);
    this.tickInterval = tickInterval;
  }
  /** This method is not used by {@link TickingModule} and may be overridden. */
  setup() {
  }
  onActivate() {
    this.handle = system3.runInterval(this.tick.bind(this), this.tickInterval);
  }
  /** Must be invoked by subclasses. */
  onDeactivate() {
    if (this.handle != null) {
      system3.clearRun(this.handle);
      this.handle = void 0;
    }
  }
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/playerLocation.js
import { world as world7 } from "@minecraft/server";
var PlayerLocationManager = class _PlayerLocationManager extends TickingModule {
  constructor(container, playerLocations) {
    super(container, 1);
    this.playerLocations = playerLocations;
    this.objective = world7.scoreboard.getObjective("p.loc") ?? world7.scoreboard.addObjective("p.loc", "Player Loc");
  }
  onActivate() {
    super.onActivate();
  }
  /**
   * Loop function, called once after every specified time delay
   *
   * Handles all players leaving, joining, and ticking for given locations
   */
  tick() {
    for (const player of world7.getAllPlayers()) {
      const playerScoreID = player.scoreboardIdentity;
      if (playerScoreID == void 0) {
        this.objective.setScore(player, -1);
        return;
      }
      const currentLocation = this.objective.getScore(playerScoreID) ?? -1;
      if (currentLocation == -1 || !this.playerLocations[currentLocation].bounds(player)) {
        if (currentLocation != -1) {
          this.leaveLocation(player, currentLocation);
        }
        for (let i = 0; i < this.playerLocations.length; ++i) {
          if (i != currentLocation) {
            if (this.playerLocations[i].bounds(player)) {
              this.joinLocation(player, i);
              break;
            }
          }
        }
      } else if (currentLocation == -1) {
        const location = this.playerLocations[currentLocation];
        location.handleTick(player);
        _PlayerLocationManager.events.dispatch({ type: "tick", player, location });
      }
    }
  }
  /**
   * Set player's active room to specified location
   * @param player The player to set
   * @param location The index of the location in the data array
   */
  joinLocation(player, locationIdx) {
    this.objective.setScore(player, locationIdx);
    const location = this.playerLocations[locationIdx];
    location.handleJoin(player);
    _PlayerLocationManager.events.dispatch({ type: "join", player, location });
  }
  /**
   * Clear player's active room from the specified location
   * @param player The player to clear
   * @param location The index of the location in the data array
   */
  leaveLocation(player, locationIdx) {
    this.objective.setScore(player, -1);
    const location = this.playerLocations[locationIdx];
    location.handleLeave(player);
    _PlayerLocationManager.events.dispatch({ type: "leave", player, location });
  }
};
PlayerLocationManager.events = new EventDispatcher();

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/playerMap.js
import { world as world8 } from "@minecraft/server";
var __runInitializers4 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate4 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var PlayerMap = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupPlayerMap_decorators;
  return _a = class PlayerMap extends _classSuper {
    constructor() {
      super(...arguments);
      this.data = (__runInitializers4(this, _instanceExtraInitializers), /* @__PURE__ */ new Map());
    }
    setupPlayerMap() {
      this.listenFor(world8.afterEvents.playerLeave, (e) => {
        this.data.delete(e.playerId);
      });
    }
    /**
     * @see Map.get
     */
    get(player) {
      return this.data.get(player.id);
    }
    /**
     * @see Map.set
     */
    set(player, value) {
      return this.data.set(player.id, value);
    }
    /**
     * @see Map.delete
     */
    delete(player) {
      return this.data.delete(player.id);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupPlayerMap_decorators = [Hook(
      "setup"
      /* LifecycleEvent.Setup */
    )];
    __esDecorate4(_a, null, _setupPlayerMap_decorators, { kind: "method", name: "setupPlayerMap", static: false, private: false, access: { has: (obj) => "setupPlayerMap" in obj, get: (obj) => obj.setupPlayerMap }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/player/playerSpecificModule.js
import { world as world9 } from "@minecraft/server";
var __runInitializers5 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate5 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var __classPrivateFieldGet3 = function(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet2 = function(receiver, state, value, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
};
var PlayerSpecificModule = (() => {
  var _a, _PlayerSpecificModule_playerHasLeft;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupPlayerSpecificModule_decorators;
  let _activatePlayerSpecificModule_decorators;
  return _a = class PlayerSpecificModule extends _classSuper {
    constructor(parent, player) {
      super(parent.container);
      this.parent = (__runInitializers5(this, _instanceExtraInitializers), parent);
      this.player = player;
      _PlayerSpecificModule_playerHasLeft.set(this, false);
    }
    get playerHasLeft() {
      return __classPrivateFieldGet3(this, _PlayerSpecificModule_playerHasLeft, "f");
    }
    unload() {
      this.parent.unregisterChild(this);
    }
    setupPlayerSpecificModule() {
      this.listenFor(world9.afterEvents.playerLeave, (e) => {
        if (e.playerId !== this.player.id)
          return;
        __classPrivateFieldSet2(this, _PlayerSpecificModule_playerHasLeft, true, "f");
        this.unload();
      });
    }
    activatePlayerSpecificModule() {
      if (!this.player.isValid()) {
        throw new Error(`Can't activate player-specific module for invalid player ${this.player.id}`);
      }
    }
    unregisterChild(child) {
      super.unregisterChild(child);
    }
  }, _PlayerSpecificModule_playerHasLeft = /* @__PURE__ */ new WeakMap(), (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupPlayerSpecificModule_decorators = [Hook(
      "setup"
      /* LifecycleEvent.Setup */
    )];
    _activatePlayerSpecificModule_decorators = [Hook(
      "activate"
      /* LifecycleEvent.Activate */
    )];
    __esDecorate5(_a, null, _setupPlayerSpecificModule_decorators, { kind: "method", name: "setupPlayerSpecificModule", static: false, private: false, access: { has: (obj) => "setupPlayerSpecificModule" in obj, get: (obj) => obj.setupPlayerSpecificModule }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate5(_a, null, _activatePlayerSpecificModule_decorators, { kind: "method", name: "activatePlayerSpecificModule", static: false, private: false, access: { has: (obj) => "activatePlayerSpecificModule" in obj, get: (obj) => obj.activatePlayerSpecificModule }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var PlayerModuleProvider = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupPlayerModuleProvider_decorators;
  return _a = class PlayerModuleProvider extends _classSuper {
    constructor(parent, moduleFactory) {
      super(parent.container);
      this.parent = (__runInitializers5(this, _instanceExtraInitializers), parent);
      this.moduleFactory = moduleFactory;
    }
    setupPlayerModuleProvider() {
      this.listenFor(world9.afterEvents.playerSpawn, (e) => {
        if (!e.initialSpawn)
          return;
        this.parent.registerChild(this.moduleFactory(this, e.player));
      });
    }
    static forModule(parent, module) {
      return new _a(parent, (provider, player) => new module(provider, player));
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupPlayerModuleProvider_decorators = [Hook(
      "setup"
      /* LifecycleEvent.Setup */
    )];
    __esDecorate5(_a, null, _setupPlayerModuleProvider_decorators, { kind: "method", name: "setupPlayerModuleProvider", static: false, private: false, access: { has: (obj) => "setupPlayerModuleProvider" in obj, get: (obj) => obj.setupPlayerModuleProvider }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/titleManager.js
import { world as world10 } from "@minecraft/server";
var TitleManager = class _TitleManager extends TickingModule {
  constructor(container, titleOptions) {
    super(container, 10);
    this.titleOptions = titleOptions;
    this.playerTitles = /* @__PURE__ */ new Map();
  }
  setup() {
    this.listenFor(world10.afterEvents.playerSpawn, (e) => {
      this.checkPlayerRejoin(e.player);
    });
  }
  tick() {
    this.playerTitles.forEach((val, key) => {
      const player = GetPlayerFromName(key);
      if (player == null)
        return;
      this.sendTitles(player, val);
    });
  }
  //#region Internal Implementation Functions
  /**
   * Display all of a player's highest weight title elements
   * @param player the player to send the elements to
   * @param playerTitle the player's title data
   * @param skipTickCheck if true, ignores the element's tick value and always prints the element
   */
  sendTitles(player, playerTitle, skipTickCheck = false) {
    const titleText = this.getStringFromElement(playerTitle, "title", skipTickCheck);
    const subtitleText = this.getStringFromElement(playerTitle, "subtitle", skipTickCheck);
    const actionbarText = this.getStringFromElement(playerTitle, "actionbar", skipTickCheck);
    if (titleText != void 0) {
      player.onScreenDisplay.setTitle(titleText, _TitleManager.titleTimes);
    }
    if (subtitleText != void 0) {
      if (titleText == void 0) {
        player.onScreenDisplay.setTitle(" ", _TitleManager.titleTimes);
      }
      player.onScreenDisplay.updateSubtitle(subtitleText);
    }
    if (actionbarText != void 0) {
      player.onScreenDisplay.setActionBar(actionbarText);
    }
  }
  /**
   * Converts title element to printable text
   * @param playerTitle player's title data
   * @param type which element to use
   * @param skipTickCheck if true, ignores the element's tick value and always prints the element
   * @returns printable text, either as string or as translated rawtext object
   */
  getStringFromElement(playerTitle, type, skipTickCheck) {
    const element = playerTitle[type];
    if (element == void 0) {
      return void 0;
    }
    if (!skipTickCheck && !element.tick) {
      return void 0;
    }
    return element.text;
  }
  /**
   * Find player's highest weight version of each element from available active titles and apply new titles
   * @param player the player reciving the titles
   * @param playerTitle the player's title data
   */
  findHighestPriorityTitles(player, playerTitle) {
    playerTitle.activeTitles.sort((a, b) => this.titleOptions.get(b).weight - this.titleOptions.get(a).weight);
    const groups = playerTitle.activeTitles.map((name) => this.titleOptions.get(name));
    playerTitle.title = groups.find((it) => !!it?.title)?.title;
    playerTitle.subtitle = groups.find((it) => !!it?.subtitle)?.subtitle;
    playerTitle.actionbar = groups.find((it) => !!it?.actionbar)?.actionbar;
    this.sendTitles(player, playerTitle, true);
  }
  /**
   * Check if player has titles on rejoin and resend
   * @param player the player reciving the titles
   */
  checkPlayerRejoin(player) {
    let playerTitle = this.playerTitles.get(player.name);
    if (playerTitle == void 0) {
      const storedTitles = player.getDynamicProperty(_TitleManager.titleStorageId);
      if (typeof storedTitles !== "string")
        return;
      const titleList = storedTitles.split(",");
      playerTitle = this.addPlayerToList(player, titleList);
    }
    this.findHighestPriorityTitles(player, playerTitle);
  }
  /**
   * Give player a new entry in the title list
   * @param player player recieving entry
   * @param activeTitles currently active titles, defaults to empty
   * @returns player's new title entry
   */
  addPlayerToList(player, activeTitles = []) {
    const playerTitle = { activeTitles, title: void 0, subtitle: void 0, actionbar: void 0 };
    this.playerTitles.set(player.name, playerTitle);
    return playerTitle;
  }
  //#endregion
  //#region Pubic Accessor Functions
  /**
   * Add new title to player's active title list and recheck/resend priority elements
   * @param player player recieving the title
   * @param title the title's name
   */
  add(player, title) {
    if (!this.titleOptions.has(title)) {
      return;
    }
    let playerTitle = this.playerTitles.get(player.name);
    if (playerTitle == void 0) {
      playerTitle = this.addPlayerToList(player);
    } else if (playerTitle.activeTitles.includes(title)) {
      return;
    }
    playerTitle.activeTitles.push(title);
    this.findHighestPriorityTitles(player, playerTitle);
    player.setDynamicProperty(_TitleManager.titleStorageId, playerTitle.activeTitles.toString());
  }
  /**
   * Remove active title from player's active title list and recheck/resend priority elements
   * @param player player losing the title
   * @param title the title's name
   */
  remove(player, title) {
    const playerTitle = this.playerTitles.get(player.name);
    if (playerTitle == void 0 || !playerTitle.activeTitles.includes(title)) {
      return;
    }
    const findIndex = playerTitle.activeTitles.indexOf(title, 0);
    playerTitle.activeTitles.splice(findIndex, 1);
    if (playerTitle.activeTitles.length == 0) {
      this.playerTitles.delete(player.name);
      player.setDynamicProperty(_TitleManager.titleStorageId, void 0);
      return;
    }
    this.findHighestPriorityTitles(player, playerTitle);
    player.setDynamicProperty(_TitleManager.titleStorageId, playerTitle.activeTitles.toString());
  }
  /**
   * Reset the whole of the players title list to make sure the player is properly reset and done with titles
   * @param player player losing the title
   */
  reset(player) {
    const playerTitle = this.playerTitles.get(player.name);
    if (playerTitle == void 0) {
      return;
    }
    if (playerTitle.activeTitles.length >= 0) {
      this.playerTitles.delete(player.name);
      player.setDynamicProperty(_TitleManager.titleStorageId, void 0);
      return;
    }
  }
};
TitleManager.titleTimes = {
  stayDuration: 20,
  fadeInDuration: 0,
  fadeOutDuration: 4
};
TitleManager.titleStorageId = "noxcrew.proj:activeTitles";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/titleManagerV2.js
import { world as world11 } from "@minecraft/server";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/util/scopedTimer.js
import { system as system4 } from "@minecraft/server";
var ScopedTimer = class _ScopedTimer extends Module {
  constructor(container, timeout, action, repeating = false) {
    super(container);
    this.timeout = timeout;
    this.action = action;
    this.repeating = repeating;
    this.handle = null;
  }
  setup() {
  }
  cancel() {
    if (this.handle != null) {
      system4.clearRun(this.handle);
    }
    this.handle = null;
  }
  onActivate() {
    this.handle = system4[this.repeating ? "runInterval" : "runTimeout"](() => this.action(this.cancel.bind(this)), this.timeout);
  }
  onDeactivate() {
    this.cancel();
  }
  static schedule(module, timeout, action, repeating = false) {
    const timer = new _ScopedTimer(module.container, timeout, action, repeating);
    module.registerChild(timer);
  }
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/titleManagerV2.js
var TitleManagerV2 = class _TitleManagerV2 extends TickingModule {
  constructor(container) {
    super(container, 15);
    this.counter = 0;
    this.registeredTitles = /* @__PURE__ */ new Map();
    this.playerTitles = new Multimap();
    this.tickingTitles = /* @__PURE__ */ new Map();
  }
  setup() {
  }
  /**
   * Adds a title event.
   * @returns a unique handle for the title
   */
  addTitle(event) {
    const newTitleId = ++this.counter;
    this.registeredTitles.set(newTitleId, event);
    for (const target of event.targets ?? world11.getAllPlayers()) {
      this.playerTitles.add(target.id, newTitleId);
      this.playerTitles.get(target.id)?.sort((one, two) => (this.registeredTitles.get(two)?.weight ?? 0) - (this.registeredTitles.get(one)?.weight ?? 0));
      this.updateTitles(target.id);
    }
    if (event.type == "one-off") {
      ScopedTimer.schedule(this, event.duration, () => this.removeTitle(newTitleId));
    }
    return newTitleId;
  }
  /**
   * Removes a title event.
   * @param event the title event's handle, as returned by {@link add}
   */
  removeTitle(event) {
    for (const player of this.playerTitles.removeValue(event)) {
      this.updateTitles(player);
    }
  }
  /** Replaces all text components for a registered title. */
  replaceTitle(handle, titles) {
    const event = this.registeredTitles.get(handle);
    if (event == null)
      return;
    event.components = titles;
    this.tick();
  }
  updateTitles(playerId) {
    const player = world11.getEntity(playerId);
    if (player == void 0) {
      this.playerTitles.delete(playerId);
      return;
    }
    const titleIds = this.playerTitles.get(playerId);
    if (titleIds == void 0)
      return;
    const titles = titleIds.map((id) => [id, this.registeredTitles.get(id)]);
    const title = titles.find((it) => !!it[1]?.components.title);
    const subtitle = titles.find((it) => !!it[1]?.components.subtitle);
    const actionbar = titles.find((it) => !!it[1]?.components.actionbar);
    const titleIsUiTrigger = title?.[1]?.type == "one-off" && title[1].isUi == true;
    this.tickingTitles.set(playerId, {
      title: titleIsUiTrigger ? void 0 : title?.[0],
      subtitle: subtitle?.[0],
      actionbar: actionbar?.[0]
    });
    this.sendTitles(player, {
      title: title?.[1]?.components.title,
      subtitle: subtitle?.[1]?.components.subtitle,
      actionbar: subtitle?.[1]?.components.actionbar
    });
  }
  sendTitles(player, titles) {
    if (titles.title != void 0) {
      player.onScreenDisplay.setTitle(titles.title, _TitleManagerV2.titleTimes);
    }
    if (titles.subtitle != void 0) {
      if (titles.title == void 0) {
        player.onScreenDisplay.setTitle(" ", _TitleManagerV2.titleTimes);
      }
      player.onScreenDisplay.updateSubtitle(titles.subtitle);
    }
    if (titles.actionbar != void 0) {
      player.onScreenDisplay.setActionBar(titles.actionbar);
    }
  }
  tick() {
    for (const [playerId, titles] of this.tickingTitles) {
      const player = world11.getEntity(playerId);
      if (player == void 0)
        continue;
      const title = titles.title ? this.registeredTitles.get(titles.title) : void 0;
      const subtitle = titles.subtitle ? this.registeredTitles.get(titles.subtitle) : void 0;
      const actionbar = titles.actionbar ? this.registeredTitles.get(titles.actionbar) : void 0;
      this.sendTitles(player, {
        title: title?.components.title,
        subtitle: subtitle?.components.subtitle,
        actionbar: actionbar?.components.actionbar
      });
    }
  }
};
TitleManagerV2.titleTimes = {
  stayDuration: 20,
  fadeInDuration: 0,
  fadeOutDuration: 4
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/sequence/target.js
import { Player as Player2 } from "@minecraft/server";

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/sequence/manager.js
import { world as world12 } from "@minecraft/server";
var __classPrivateFieldGet4 = function(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _SequenceManager_instances;
var _SequenceManager_runningSequences;
var _SequenceManager_callbacks;
var _SequenceManager_stop;
_SequenceManager_runningSequences = /* @__PURE__ */ new WeakMap(), _SequenceManager_callbacks = /* @__PURE__ */ new WeakMap(), _SequenceManager_instances = /* @__PURE__ */ new WeakSet(), _SequenceManager_stop = function _SequenceManager_stop2(instance, success) {
  __classPrivateFieldGet4(this, _SequenceManager_runningSequences, "f").delete(instance);
  __classPrivateFieldGet4(this, _SequenceManager_callbacks, "f").get(instance)?.forEach((callback) => callback(success));
};

// ../../../../../../../home/node/.creative-toolbox-packages/noxcrew.common.scripting/ct@0.21.1/scripts/modules/sequence/multistage.js
import { world as world13 } from "@minecraft/server";
var STAGE_CONDITION = Symbol();

// initializeAddon.js
import { ItemStack, system as system5, world as world14 } from "@minecraft/server";
var __runInitializers6 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate6 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var InitializeAddon = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupAddon_decorators;
  return _a = class InitializeAddon extends _classSuper {
    setupAddon() {
      world14.scoreboard.getObjective(`${_a.ADDON_IDENTIFIER}:var`) ?? world14.scoreboard.addObjective(`${_a.ADDON_IDENTIFIER}:var`, "");
      world14.scoreboard.getObjective(`${_a.ADDON_IDENTIFIER}:jig_computer.addon_stats`) ?? world14.scoreboard.addObjective(`${_a.ADDON_IDENTIFIER}:jig_computer.addon_stats`, "");
      this.listenFor(world14.afterEvents.playerSpawn, (e) => {
        const player = e.player;
        const playerVersion = player.getDynamicProperty(_a.PLAYER_VERSION) ?? "0.0.0";
        if (e.initialSpawn && playerVersion !== _a.ADDON_VERSION) {
          this.giveTutorialBook(player);
          ScopedTimer.schedule(this, 20, (cancel) => {
            if (!player.isValid())
              return;
            for (const message of _a.WELCOME_MSG) {
              player.sendMessage({ translate: message });
            }
            cancel();
          }, true);
          player.setDynamicProperty(_a.PLAYER_VERSION, _a.ADDON_VERSION);
        }
      });
      this.listenFor(system5.afterEvents.scriptEventReceive, (e) => {
        if (e.id === "noxcrew_mf:drop_item") {
          e.sourceEntity?.dimension.spawnItem(new ItemStack(`${e.sourceEntity.typeId}_spawn_egg`), e.sourceEntity.location);
          e.sourceEntity?.remove();
        }
      });
    }
    giveTutorialBook(player) {
      if (player.dimension.getBlock(player.location) === void 0)
        return;
      player.dimension.spawnItem(new ItemStack(`noxcrew_mf:guide_addon`), player.location);
    }
    constructor() {
      super(...arguments);
      __runInitializers6(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupAddon_decorators = [Hook("setup")];
    __esDecorate6(_a, null, _setupAddon_decorators, { kind: "method", name: "setupAddon", static: false, private: false, access: { has: (obj) => "setupAddon" in obj, get: (obj) => obj.setupAddon }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a.ADDON_VERSION = "0.0.3", _a.ADDON_IDENTIFIER = "noxcrew_mf", _a.PLAYER_VERSION = property("noxcrew_mf:version"), _a.WELCOME_MSG = [
    "noxcrew_mf:txt.install.1",
    "noxcrew_mf:txt.install.2",
    "noxcrew_mf:txt.install.3"
  ], _a;
})();

// effects/manager.js
import { system as system7, TicksPerSecond as TicksPerSecond5, world as world20 } from "@minecraft/server";

// util/prefix.js
var PREFIX = "noxcrew_mf:";
var prefix_default = PREFIX;

// effects/customEffect.js
import { system as system6, TicksPerSecond, world as world15 } from "@minecraft/server";
var __runInitializers7 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate7 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var CustomEffect = (() => {
  var _a;
  let _classSuper = PlayerSpecificModule;
  let _instanceExtraInitializers = [];
  let _setupTimer_decorators;
  return _a = class CustomEffect extends _classSuper {
    constructor(parent, player, duration, strength) {
      super(parent, player);
      this.duration = (__runInitializers7(this, _instanceExtraInitializers), duration);
      this.strength = strength;
      this._startTick = 0;
    }
    get startTick() {
      return this._startTick;
    }
    setupTimer() {
      this._startTick = system6.currentTick;
      ScopedTimer.schedule(this, this.duration * TicksPerSecond, () => this.parent.unregisterChild(this));
      this.listenFor(world15.afterEvents.playerSpawn, (e) => {
        if (e.initialSpawn || e.player !== this.player)
          return;
        this.parent.unregisterChild(this);
      });
      this.listenFor(world15.afterEvents.itemCompleteUse, (e) => {
        if (e.itemStack.typeId !== "minecraft:milk_bucket" || e.source !== this.player)
          return;
        this.player.onScreenDisplay.setActionBar({ translate: `noxcrew_mf:txt.food_hint.milk` });
        this.parent.unregisterChild(this);
      });
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupTimer_decorators = [Hook("setup")];
    __esDecorate7(_a, null, _setupTimer_decorators, { kind: "method", name: "setupTimer", static: false, private: false, access: { has: (obj) => "setupTimer" in obj, get: (obj) => obj.setupTimer }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// effects/bloom.js
import { TicksPerSecond as TicksPerSecond2 } from "@minecraft/server";

// growing/Grower.js
var Grower = class {
};

// growing/Grower/FernGrower.js
var FernGrower = class extends Grower {
  grow(block) {
    let above = block.above(1);
    if (above == void 0 || above.typeId != "minecraft:air") {
      return;
    }
    block.setType("minecraft:large_fern");
    block.setPermutation(block.permutation.withState("upper_block_bit", false));
    above.setType("minecraft:large_fern");
    above.setPermutation(block.permutation.withState("upper_block_bit", true));
  }
};

// growing/Grower/GlowBerriesGrower.js
var GlowBerriesGrower = class extends Grower {
  constructor() {
    super(...arguments);
    this.belowBlocks = [
      "minecraft:cave_vines",
      "minecraft:cave_vines_body_with_berries",
      "minecraft:cave_vines_head_with_berries"
    ];
  }
  grow(block) {
    if (this.belowBlocks.includes(block.below(1)?.typeId ?? "")) {
      block.setType("cave_vines_body_with_berries");
    } else {
      block.setType("cave_vines_head_with_berries");
    }
  }
};

// growing/Grower/GrassGrower.js
var GrassGrower = class extends Grower {
  grow(block) {
    let above = block.above(1);
    if (above == void 0 || above.typeId != "minecraft:air") {
      return;
    }
    block.setType("minecraft:tall_grass");
    block.setPermutation(block.permutation.withState("upper_block_bit", false));
    above.setType("minecraft:tall_grass");
    above.setPermutation(block.permutation.withState("upper_block_bit", true));
  }
};

// growing/Grower/HeightGrower.js
var HeightGrower = class extends Grower {
  grow(block) {
    let start = this.findRoot(block);
    let end = this.findEnd(block);
    if (!this.belowMaxHeight(start, end)) {
      return;
    }
    let next = this.getNextBlock(end);
    if (!this.canGrow(next)) {
      return;
    }
    next?.setType(this.blockID);
  }
  findRoot(block) {
    return this.find(block, this.rootDirection);
  }
  findEnd(block) {
    return this.find(block, -this.rootDirection);
  }
  find(block, direction) {
    let end = block;
    let next = block;
    do {
      end = next;
      next = end.above(direction);
      if (next == void 0) {
        break;
      }
    } while (next.typeId == this.blockID);
    return end;
  }
  getHeight(root, end) {
    return Math.abs(root.y - end.y) + 1;
  }
  belowMaxHeight(root, end) {
    return this.getHeight(root, end) < this.maxHeight;
  }
  canGrow(next) {
    return next != void 0 && this.travelBlocks.includes(next.typeId);
  }
  getNextBlock(end) {
    return end.above(-this.rootDirection);
  }
};

// growing/Grower/HeightGrower/Bamboo.js
var BambooGrower = class extends HeightGrower {
  constructor() {
    super(...arguments);
    this.maxHeight = 16;
    this.rootDirection = -1;
    this.blockID = "minecraft:bamboo";
    this.travelBlocks = ["minecraft:air"];
  }
};

// growing/Grower/HeightGrower/BigDripleafGrower.js
var BigDripleafGrower = class extends HeightGrower {
  constructor() {
    super(...arguments);
    this.maxHeight = 1e4;
    this.rootDirection = -1;
    this.blockID = "minecraft:big_dripleaf";
    this.travelBlocks = ["minecraft:water", "minecraft:air"];
  }
};

// growing/Grower/HeightGrower/CactusGrower.js
var CactusGrower = class extends HeightGrower {
  constructor() {
    super(...arguments);
    this.maxHeight = 3;
    this.rootDirection = -1;
    this.blockID = "minecraft:cactus";
    this.travelBlocks = ["minecraft:air"];
  }
};

// growing/Grower/HeightGrower/AgeHeightGrower.js
var AgeHeightGrower = class extends HeightGrower {
  grow(block) {
    let end = this.findEnd(block);
    let age = Number(end.permutation.getState(this.ageProperty));
    if (isNaN(age) || age >= this.maxHeight)
      return;
    let next = this.getNextBlock(end);
    if (!this.canGrow(next))
      return;
    if (next == void 0)
      return;
    next.setType(this.blockID);
    next.setPermutation(next.permutation.withState(this.ageProperty, age + 1));
  }
};

// growing/Grower/HeightGrower/KelpGrower.js
var KelpGrower = class extends AgeHeightGrower {
  constructor() {
    super(...arguments);
    this.ageProperty = "kelp_age";
    this.maxHeight = 25;
    this.rootDirection = -1;
    this.blockID = "minecraft:kelp";
    this.travelBlocks = ["minecraft:water"];
  }
};

// growing/Grower/HeightGrower/SugarcaneGrower.js
var SugarcaneGrower = class extends HeightGrower {
  constructor() {
    super(...arguments);
    this.maxHeight = 3;
    this.rootDirection = -1;
    this.blockID = "minecraft:reeds";
    this.travelBlocks = ["minecraft:air"];
  }
};

// growing/Grower/HeightGrower/TwistingVinesGrower.js
var TwistingVinesGrower = class extends AgeHeightGrower {
  constructor() {
    super(...arguments);
    this.ageProperty = "twisting_vines_age";
    this.maxHeight = 25;
    this.rootDirection = -1;
    this.blockID = "minecraft:twisting_vines";
    this.travelBlocks = ["minecraft:air"];
  }
};

// growing/Grower/HeightGrower/WeepingVinesGrower.js
var WeepingVinesGrower = class extends AgeHeightGrower {
  constructor() {
    super(...arguments);
    this.ageProperty = "weeping_vines_age";
    this.maxHeight = 25;
    this.rootDirection = 1;
    this.blockID = "minecraft:weeping_vines";
    this.travelBlocks = ["minecraft:air"];
  }
};

// growing/Grower/SeagrassGrower.js
var SeagrassGrower = class extends Grower {
  grow(block) {
    if (block.permutation.getState("sea_grass_type") != "default") {
      return;
    }
    let above = block.above(1);
    if (above == void 0 || above.typeId != "minecraft:water") {
      return;
    }
    block.setPermutation(block.permutation.withState("sea_grass_type", "double_bot"));
    above.setType("minecraft:seagrass");
    above.setPermutation(block.permutation.withState("sea_grass_type", "double_top"));
  }
};

// util/getRandomInt.js
function getRandomInt(min, max) {
  return Math.round(Math.random() * (max - min) + min);
}

// growing/Grower/SmallDripleafGrower.js
var SmallDripleafGrower = class extends Grower {
  constructor() {
    super(...arguments);
    this.allowedBlocks = ["minecraft:water", "minecraft:air", "minecraft:small_dripleaf_block"];
    this.maxGrowth = 5;
  }
  grow(block) {
    let availableBlocks = 0;
    while (availableBlocks < this.maxGrowth && this.allowedBlocks.includes(block.above(availableBlocks + 1)?.typeId ?? "")) {
      availableBlocks++;
    }
    let growHeight = getRandomInt(0, availableBlocks + 1);
    let below = block.below(1);
    if (below?.typeId == "minecraft:small_dripleaf_block") {
      below.setType("minecraft:big_dripleaf");
    }
    for (let i = 0; i <= growHeight; ++i) {
      let setBlock = block.above(i);
      setBlock?.setType("minecraft:big_dripleaf");
    }
  }
};

// growing/Grower/StateGrower.js
var StateGrower = class {
  grow(block) {
    let value = Number(block.permutation.getState(this.property));
    if (value == void 0 || isNaN(value) || value >= this.max) {
      return;
    }
    block.setPermutation(block.permutation.withState(this.property, value + 1));
  }
};

// growing/Grower/StateGrower/BeetrootGrower.js
var BeetrootGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 7;
    this.property = "growth";
  }
};

// growing/Grower/StateGrower/CarrotGrower.js
var CarrotGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 7;
    this.property = "growth";
  }
};

// growing/Grower/StateGrower/CocoaBeanGrower.js
var CocoaBeanGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 2;
    this.property = "age";
  }
};

// growing/Grower/StateGrower/MelonGrower.js
var MelonGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 7;
    this.property = "growth";
  }
};

// growing/Grower/StateGrower/NetherWartGrower.js
var NetherWartGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 3;
    this.property = "age";
  }
};

// growing/Grower/StateGrower/PitcherPodGrower.js
var PitcherPodGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 5;
    this.property = "growth";
    this.allowedAboveBlocks = ["minecraft:air", "minecraft:pitcher_crop"];
  }
  grow(block) {
    if (block.permutation.getState("upper_block_bit") === true) {
      this.growTop(block);
    } else {
      this.growBottom(block);
    }
  }
  growTop(block) {
    let below = block.below(1);
    if (below == void 0)
      return;
    super.grow(block);
    super.grow(below);
  }
  growBottom(block) {
    let value = Number(block.permutation.getState(this.property));
    if (value == void 0 || isNaN(value))
      return;
    let above = block.above(1);
    if (value < 2) {
      super.grow(block);
    } else if (above != void 0 && this.allowedAboveBlocks.includes(above?.typeId)) {
      super.grow(block);
      above.setType("minecraft:pitcher_crop");
      above.setPermutation(block.permutation.withState("growth", value).withState("upper_block_bit", true));
    }
  }
};

// growing/Grower/StateGrower/PotatoGrower.js
var PotatoGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 7;
    this.property = "growth";
  }
};

// growing/Grower/StateGrower/PumpkinGrower.js
var PumpkinGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 7;
    this.property = "growth";
  }
};

// growing/Grower/StateGrower/SweetBerryGrower.js
var SweetBerryGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 2;
    this.property = "growth";
  }
};

// growing/Grower/StateGrower/WheatGrower.js
var WheatGrower = class extends StateGrower {
  constructor() {
    super(...arguments);
    this.max = 7;
    this.property = "growth";
  }
};

// growing/Grower/TorchflowerGrower.js
var TorchflowerGrower = class extends Grower {
  constructor() {
    super(...arguments);
    this.property = "growth";
  }
  grow(block) {
    let value = block.permutation.getState(this.property);
    if (value === 0) {
      block.setPermutation(block.permutation.withState(this.property, 1));
    } else if (value === 1) {
      block.setType("minecraft:torchflower");
    }
  }
};

// growing/Grower/TreeGrower.js
import { StructureRotation, world as world17 } from "@minecraft/server";

// growing/growUtils.js
import { Direction, world as world16 } from "@minecraft/server";
var GrowUtil = class {
  static fill(from, to, dimension, block, includeBlocks = []) {
    let start = this.vec3(Math.min(from.x, to.x), Math.min(from.y, to.y), Math.min(from.z, to.z));
    let diff = this.vec3(Math.abs(to.x - from.x), Math.abs(to.y - from.y), Math.abs(to.z - from.z));
    for (let x = 0; x <= diff.x; ++x) {
      for (let y = 0; y <= diff.y; ++y) {
        for (let z = 0; z <= diff.z; ++z) {
          let worldPosition = Vector3Utils.add(start, this.vec3(x, y, z));
          if (includeBlocks.length != 0) {
            let blockID = dimension.getBlock(worldPosition)?.typeId;
            if (blockID == void 0 || !includeBlocks.includes(blockID, 0)) {
              continue;
            }
          }
          dimension.setBlockType(worldPosition, block);
        }
      }
    }
  }
  static vec3(x, y, z) {
    return { x, y, z };
  }
  static negateVec3(vector) {
    return this.vec3(-vector.x, -vector.y, -vector.z);
  }
  static printVec3(vector, pre = "", post = "") {
    world16.sendMessage(`${pre} <${vector.x} ${vector.y} ${vector.z}> ${post}`);
  }
  static offsetFromDirection(direction) {
    switch (direction) {
      case Direction.Up:
        return this.vec3(0, 1, 0);
      case Direction.Down:
        return this.vec3(0, -1, 0);
      case Direction.North:
        return this.vec3(0, 0, -1);
      case Direction.South:
        return this.vec3(0, 0, 1);
      case Direction.East:
        return this.vec3(1, 0, 0);
      case Direction.West:
        return this.vec3(-1, 0, 0);
      default:
        return this.vec3(0, 0, 0);
    }
  }
};

// growing/Grower/TreeGrower.js
var TreeGrower = class extends Grower {
  constructor() {
    super(...arguments);
    this.replacableBlocks = [
      "minecraft:air",
      "minecraft:short_grass",
      "minecraft:tall_grass",
      "minecraft:acacia_leaves",
      "minecraft:birch_leaves",
      "minecraft:cherry_leaves",
      "minecraft:dark_oak_leaves",
      "minecraft:jungle_leaves",
      "minecraft:mangrove_leaves",
      "minecraft:oak_leaves",
      "minecraft:spruce_leaves"
    ];
  }
  getStructure(info) {
    return world17.structureManager.get(info.name);
  }
  canPlaceStructure(structure, block, rotation = StructureRotation.None) {
    for (let x = 0; x < structure.size.x; ++x) {
      for (let y = 0; y < structure.size.y; ++y) {
        for (let z = 0; z < structure.size.z; ++z) {
          let localPosition = GrowUtil.vec3(x, y, z);
          if (structure.getBlockPermutation(localPosition) == void 0) {
            continue;
          }
          if (rotation != StructureRotation.None) {
            localPosition = this.rotate(localPosition, structure.size, rotation);
          }
          let worldSpaceBlock = block.offset(localPosition);
          if (worldSpaceBlock == void 0 || !this.isReplacableBlock(worldSpaceBlock)) {
            return false;
          }
        }
      }
    }
    return true;
  }
  getTopOffset(info, structure, rotation) {
    if (info.stumpOffset == void 0) {
      return GrowUtil.vec3(Math.floor((structure?.size.x - 0.5) / 2), 0, Math.floor((structure?.size.z - 0.5) / 2));
    }
    return this.rotate(info.stumpOffset, structure.size, this.getInvertedRotation(rotation));
  }
  getStructureInstance(origin, options = {}) {
    if (options.structureChoices == void 0) {
      options.structureChoices = this.structures;
    }
    const ran = getRandomInt(0, options.structureChoices.length - 1);
    let structureInfo = options.structureChoices[ran];
    let structure = this.getStructure(structureInfo);
    if (structure === void 0) {
      return void 0;
    }
    if (options.rotation == void 0) {
      options.rotation = this.getRandomRotation();
    }
    let stumpOffset = GrowUtil.negateVec3(this.getTopOffset(structureInfo, structure, options.rotation));
    if ((options.wide ?? false) && structureInfo.stumpOffset != void 0) {
      stumpOffset = Vector3Utils.add(this.getWideStumpRotationOffset(options.rotation), stumpOffset);
    }
    let corner = origin.offset(stumpOffset);
    if (corner == void 0) {
      return void 0;
    }
    if (!this.canPlaceStructure(structure, corner, options.rotation)) {
      return void 0;
    }
    return { structure, rotation: options.rotation, corner };
  }
  placeStructureInstance(instance) {
    world17.structureManager.place(instance.structure, instance.corner.dimension, instance.corner.location, {
      rotation: instance.rotation
    });
  }
  isReplacableBlock(block) {
    return this.replacableBlocks.includes(block.typeId, 0);
  }
  getStumpSize() {
    return getRandomInt(this.minHeight, this.maxHeight + 1);
  }
  canPlaceStump(block, height, width = 1) {
    for (let x = 0; x < width; ++x) {
      for (let z = 0; z < width; ++z) {
        for (let y = 1; y < height; ++y) {
          let checkBlock = block.offset(GrowUtil.vec3(x, y, z));
          if (checkBlock == void 0 || !this.replacableBlocks.includes(checkBlock.typeId)) {
            return void 0;
          }
        }
      }
    }
    return block.above(height);
  }
  placeStump(block, height) {
    for (let y = 0; y < height; ++y) {
      block.above(y)?.setType(this.stumpBlock);
    }
  }
  findWideStump(block) {
    let upLeft = block.offset(GrowUtil.vec3(1, 0, 1));
    let up = block.offset(GrowUtil.vec3(0, 0, 1));
    let left = block.offset(GrowUtil.vec3(1, 0, 0));
    if (this.checkWideStumpOption(block, upLeft, up, left)) {
      return block;
    }
    let upRight = block.offset(GrowUtil.vec3(-1, 0, 1));
    let right = block.offset(GrowUtil.vec3(-1, 0, 0));
    if (this.checkWideStumpOption(block, upRight, up, right)) {
      return right;
    }
    let downLeft = block.offset(GrowUtil.vec3(1, 0, -1));
    let down = block.offset(GrowUtil.vec3(0, 0, -1));
    if (this.checkWideStumpOption(block, downLeft, down, left)) {
      return down;
    }
    let downRight = block.offset(GrowUtil.vec3(-1, 0, -1));
    if (this.checkWideStumpOption(block, downRight, down, right)) {
      return downRight;
    }
    return void 0;
  }
  checkWideStumpOption(blockA, blockB, blockC, blockD) {
    return blockB?.typeId == blockA?.typeId && blockC?.typeId == blockA?.typeId && blockD?.typeId == blockA?.typeId;
  }
  getWideStumpRotationOffset(rotation) {
    return this.rotate(VECTOR3_ZERO, GrowUtil.vec3(2, 0, 2), this.getInvertedRotation(rotation));
  }
  getRandomRotation() {
    let randomNumber = getRandomInt(0, 4);
    switch (randomNumber) {
      case 1:
        return StructureRotation.Rotate90;
      case 2:
        return StructureRotation.Rotate180;
      case 3:
        return StructureRotation.Rotate270;
      default:
        return StructureRotation.None;
    }
  }
  getInvertedRotation(rotation) {
    switch (rotation) {
      case StructureRotation.Rotate180:
        return StructureRotation.Rotate180;
      case StructureRotation.Rotate90:
        return StructureRotation.Rotate270;
      case StructureRotation.Rotate270:
        return StructureRotation.Rotate90;
      default:
        return StructureRotation.None;
    }
  }
  rotate(vector, size, rotation) {
    switch (rotation) {
      case StructureRotation.Rotate90:
        return this.swapXZ(this.flipX(vector, size));
      case StructureRotation.Rotate180:
        return this.flipXZ(vector, size);
      case StructureRotation.Rotate270:
        return this.swapXZ(this.flipZ(vector, size));
      default:
        return vector;
    }
  }
  swapXZ(vector) {
    return GrowUtil.vec3(vector.z, vector.y, vector.x);
  }
  flipX(vector, size) {
    return GrowUtil.vec3(size.x - vector.x - 1, vector.y, vector.z);
  }
  flipZ(vector, size) {
    return GrowUtil.vec3(vector.x, vector.y, size.z - vector.z - 1);
  }
  flipXZ(vector, size) {
    return this.flipX(this.flipZ(vector, size), size);
  }
};

// growing/Grower/TreeGrower/ThinTreeGrower.js
var ThinTreeGrower = class extends TreeGrower {
  grow(block) {
    let stumpHeight = this.getStumpSize();
    let topBlock = this.canPlaceStump(block, stumpHeight);
    if (topBlock == void 0) {
      return;
    }
    let structureInstance = this.getStructureInstance(topBlock);
    if (structureInstance == void 0) {
      return;
    }
    this.placeStump(block, stumpHeight);
    this.placeStructureInstance(structureInstance);
  }
};

// growing/Grower/TreeGrower/ThinTreeGrower/JungleSmall.js
var SmallJungleTreeGrower = class extends ThinTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/junglesmall0" },
      { name: "noxcrew_mf:trees/junglesmall1" },
      { name: "noxcrew_mf:trees/junglesmall2" }
    ];
    this.minHeight = 3;
    this.maxHeight = 7;
    this.stumpBlock = "minecraft:jungle_log";
  }
};

// growing/Grower/TreeGrower/WideTreeGrower/JungleBig.js
var BigJungleTreeGrower = class extends TreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [{ name: "noxcrew_mf:trees/junglebig0" }];
    this.minHeight = 15;
    this.maxHeight = 25;
    this.stumpBlock = "minecraft:jungle_log";
    this.branchStructures = [
      { name: "noxcrew_mf:trees/junglebranch0", stumpOffset: GrowUtil.vec3(-2, 0, 2) },
      { name: "noxcrew_mf:trees/junglebranch1", stumpOffset: GrowUtil.vec3(3, 0, 3) },
      { name: "noxcrew_mf:trees/junglebranch2", stumpOffset: GrowUtil.vec3(0, 0, 4) },
      { name: "noxcrew_mf:trees/junglebranch3", stumpOffset: GrowUtil.vec3(5, 0, 2) },
      { name: "noxcrew_mf:trees/junglebranch4", stumpOffset: GrowUtil.vec3(-2, 0, 3) },
      { name: "noxcrew_mf:trees/junglebranch5", stumpOffset: GrowUtil.vec3(-2, 0, 3) }
    ];
  }
  grow(block) {
    let stumpBlocks = [
      block.offset(GrowUtil.vec3(1, 0, 0)),
      block.offset(GrowUtil.vec3(0, 0, 1)),
      block.offset(GrowUtil.vec3(1, 0, 1)),
      block
    ];
    let stumpHeight = this.getStumpSize();
    let topBlock;
    for (let i = 0; i < stumpBlocks.length; ++i) {
      if (stumpBlocks[i] == void 0) {
        return;
      }
      topBlock = this.canPlaceStump(block, stumpHeight);
    }
    if (topBlock == void 0) {
      return;
    }
    let structureInstance = this.getStructureInstance(topBlock, { wide: true });
    if (structureInstance == void 0) {
      return;
    }
    let maxBranches = Math.max(1, (stumpHeight - 10) / 3);
    let branchCount = getRandomInt(1, maxBranches + 1);
    let branches = [];
    for (let i = 0; i < branchCount; ++i) {
      let height;
      do {
        height = getRandomInt(10, stumpHeight - 3);
      } while (branches.some((e) => e.height == height));
      let originBlock = block.above(height);
      if (originBlock == void 0) {
        continue;
      }
      let branchInstance = this.getStructureInstance(originBlock, {
        wide: true,
        structureChoices: this.branchStructures
      });
      if (branchInstance == void 0) {
        continue;
      }
      branches.push({
        placement: branchInstance,
        height
      });
    }
    for (let i = 0; i < stumpBlocks.length; ++i) {
      let placingStump = stumpBlocks[i];
      if (placingStump == void 0) {
        continue;
      }
      this.placeStump(placingStump, stumpHeight);
    }
    this.placeStructureInstance(structureInstance);
    for (let i = 0; i < branches.length; ++i) {
      this.placeStructureInstance(branches[i].placement);
    }
  }
};

// growing/Grower/TreeGrower/Jungle.js
var JungleTreeGrower = class extends TreeGrower {
  constructor() {
    super(...arguments);
    this.smallGrower = new SmallJungleTreeGrower();
    this.bigGrower = new BigJungleTreeGrower();
    this.minHeight = 0;
    this.maxHeight = 0;
    this.stumpBlock = "";
    this.structures = [];
  }
  grow(block) {
    let stumpBlock = this.findWideStump(block);
    if (stumpBlock == void 0) {
      this.smallGrower.grow(block);
    } else {
      this.bigGrower.grow(stumpBlock);
    }
  }
};

// growing/Grower/TreeGrower/SplitTreeGrower.js
var SplitTreeGrower = class extends TreeGrower {
  grow(block) {
    let stumpHeight = this.getStumpSize();
    let topBlock = this.canPlaceStump(block, stumpHeight);
    if (topBlock == void 0) {
      return;
    }
    let topInstance = this.getStructureInstance(topBlock);
    if (topInstance == void 0) {
      return;
    }
    let lowerBlock = topBlock.below(getRandomInt(this.lowerOffsetMin, this.lowerOffsetMax + 1));
    if (lowerBlock == void 0) {
      return;
    }
    let bottomRotation = this.getRandomRotation();
    let bottomInstance = void 0;
    if (bottomRotation != topInstance.rotation) {
      bottomInstance = this.getStructureInstance(lowerBlock, {
        structureChoices: this.lowerStructures,
        rotation: bottomRotation
      });
      if (bottomInstance == void 0) {
        return;
      }
    }
    if (bottomInstance != void 0) {
      this.placeStructureInstance(bottomInstance);
    }
    this.placeStump(block, stumpHeight);
    this.placeStructureInstance(topInstance);
  }
};

// growing/Grower/TreeGrower/SplitTreeGrower/Acacia.js
var AcaciaTreeGrower = class extends SplitTreeGrower {
  constructor() {
    super(...arguments);
    this.lowerOffsetMin = 1;
    this.lowerOffsetMax = 2;
    this.minHeight = 3;
    this.maxHeight = 8;
    this.stumpBlock = "minecraft:acacia_log";
    this.structures = [
      { name: "noxcrew_mf:trees/acacia0", stumpOffset: GrowUtil.vec3(3, 0, 2) },
      { name: "noxcrew_mf:trees/acacia1", stumpOffset: GrowUtil.vec3(3, 0, 1) },
      { name: "noxcrew_mf:trees/acacia2", stumpOffset: GrowUtil.vec3(3, 0, 2) },
      { name: "noxcrew_mf:trees/acacia3", stumpOffset: GrowUtil.vec3(3, 0, 0) }
    ];
    this.lowerStructures = [
      { name: "noxcrew_mf:trees/acacialower0", stumpOffset: GrowUtil.vec3(2, 0, 1) },
      { name: "noxcrew_mf:trees/acacialower1", stumpOffset: GrowUtil.vec3(2, 0, -1) },
      { name: "noxcrew_mf:trees/acacialower2", stumpOffset: GrowUtil.vec3(2, 0, 0) }
    ];
  }
};

// growing/Grower/TreeGrower/SplitTreeGrower/Cherry.js
var CherryTreeGrower = class extends SplitTreeGrower {
  constructor() {
    super(...arguments);
    this.lowerOffsetMin = 1;
    this.lowerOffsetMax = 1;
    this.minHeight = 3;
    this.maxHeight = 5;
    this.stumpBlock = "minecraft:cherry_log";
    this.structures = [
      { name: "noxcrew_mf:trees/cherry0", stumpOffset: GrowUtil.vec3(3, 1, -1) },
      { name: "noxcrew_mf:trees/cherry1", stumpOffset: GrowUtil.vec3(3, 1, -1) },
      { name: "noxcrew_mf:trees/cherry2", stumpOffset: GrowUtil.vec3(3, 2, 1) },
      { name: "noxcrew_mf:trees/cherry3", stumpOffset: GrowUtil.vec3(3, 1, 0) },
      { name: "noxcrew_mf:trees/cherry4", stumpOffset: GrowUtil.vec3(3, 1, 0) }
    ];
    this.lowerStructures = [
      { name: "noxcrew_mf:trees/cherry0", stumpOffset: GrowUtil.vec3(3, 1, -1) },
      { name: "noxcrew_mf:trees/cherry1", stumpOffset: GrowUtil.vec3(3, 1, -1) },
      { name: "noxcrew_mf:trees/cherry2", stumpOffset: GrowUtil.vec3(3, 2, 1) },
      { name: "noxcrew_mf:trees/cherry3", stumpOffset: GrowUtil.vec3(3, 1, 0) },
      { name: "noxcrew_mf:trees/cherry4", stumpOffset: GrowUtil.vec3(3, 1, 0) }
    ];
  }
};

// growing/Grower/TreeGrower/Spruce.js
var SpruceTreeGrower = class extends ThinTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/spruce0" },
      { name: "noxcrew_mf:trees/spruce1" },
      { name: "noxcrew_mf:trees/spruce2" },
      { name: "noxcrew_mf:trees/spruce3" },
      { name: "noxcrew_mf:trees/spruce4" },
      { name: "noxcrew_mf:trees/spruce5" }
    ];
    this.minHeight = 1;
    this.maxHeight = 2;
    this.stumpBlock = "minecraft:spruce_log";
  }
};

// growing/Grower/TreeGrower/ThinTreeGrower/Azalea.js
var AzaleaTreeGrower = class extends ThinTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/azalea0", stumpOffset: GrowUtil.vec3(0, 0, 2) },
      { name: "noxcrew_mf:trees/azalea1", stumpOffset: GrowUtil.vec3(0, 0, 2) },
      { name: "noxcrew_mf:trees/azalea2", stumpOffset: GrowUtil.vec3(5, 0, 2) },
      { name: "noxcrew_mf:trees/azalea3", stumpOffset: GrowUtil.vec3(5, 0, 2) },
      { name: "noxcrew_mf:trees/azalea4", stumpOffset: GrowUtil.vec3(5, 0, 2) }
    ];
    this.minHeight = 2;
    this.maxHeight = 2;
    this.stumpBlock = "minecraft:oak_log";
  }
};

// growing/Grower/TreeGrower/ThinTreeGrower/Birch.js
var BirchTreeGrower = class extends ThinTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/birch0" },
      { name: "noxcrew_mf:trees/birch1" },
      { name: "noxcrew_mf:trees/birch2" }
    ];
    this.minHeight = 2;
    this.maxHeight = 7;
    this.stumpBlock = "minecraft:birch_log";
  }
};

// growing/Grower/TreeGrower/ThinTreeGrower/Crimson.js
var CrimsonTreeGrower = class extends ThinTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/crimson0" },
      { name: "noxcrew_mf:trees/crimson1" },
      { name: "noxcrew_mf:trees/crimson2" },
      { name: "noxcrew_mf:trees/crimson3" },
      { name: "noxcrew_mf:trees/crimson4" },
      { name: "noxcrew_mf:trees/crimson5" }
    ];
    this.minHeight = 1;
    this.maxHeight = 15;
    this.stumpBlock = "minecraft:crimson_stem";
  }
};

// growing/Grower/TreeGrower/ThinTreeGrower/Oak.js
var OakTreeGrower = class extends ThinTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/oak0" },
      { name: "noxcrew_mf:trees/oak1" },
      { name: "noxcrew_mf:trees/oak2" },
      { name: "noxcrew_mf:trees/oak3" }
    ];
    this.minHeight = 1;
    this.maxHeight = 3;
    this.stumpBlock = "minecraft:oak_log";
  }
};

// growing/Grower/TreeGrower/ThinTreeGrower/Warped.js
var WarpedTreeGrower = class extends ThinTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/warped0" },
      { name: "noxcrew_mf:trees/warped1" },
      { name: "noxcrew_mf:trees/warped2" },
      { name: "noxcrew_mf:trees/warped3" },
      { name: "noxcrew_mf:trees/warped4" },
      { name: "noxcrew_mf:trees/warped5" },
      { name: "noxcrew_mf:trees/warped6" }
    ];
    this.minHeight = 1;
    this.maxHeight = 15;
    this.stumpBlock = "minecraft:warped_stem";
  }
};

// growing/Grower/TreeGrower/WideTreeGrower.js
var WideTreeGrower = class extends TreeGrower {
  grow(block) {
    let stumpBlock = this.findWideStump(block);
    if (stumpBlock == void 0) {
      return;
    }
    let stumpBlocks = [
      stumpBlock.offset(GrowUtil.vec3(1, 0, 0)),
      stumpBlock.offset(GrowUtil.vec3(0, 0, 1)),
      stumpBlock.offset(GrowUtil.vec3(1, 0, 1)),
      stumpBlock
    ];
    let stumpHeight = this.getStumpSize();
    let topBlock;
    for (let i = 0; i < stumpBlocks.length; ++i) {
      if (stumpBlocks[i] == void 0) {
        return;
      }
      topBlock = this.canPlaceStump(stumpBlock, stumpHeight);
    }
    if (topBlock == void 0) {
      return;
    }
    let structureInstance = this.getStructureInstance(topBlock, { wide: true });
    if (structureInstance == void 0) {
      return;
    }
    for (let i = 0; i < stumpBlocks.length; ++i) {
      let placingStump = stumpBlocks[i];
      if (placingStump == void 0) {
        continue;
      }
      this.placeStump(placingStump, stumpHeight);
    }
    this.placeStructureInstance(structureInstance);
  }
};

// growing/Grower/TreeGrower/WideTreeGrower/DarkOak.js
var DarkOakTreeGrower = class extends WideTreeGrower {
  constructor() {
    super(...arguments);
    this.structures = [
      { name: "noxcrew_mf:trees/darkoak0", stumpOffset: GrowUtil.vec3(2, 0, 2) },
      { name: "noxcrew_mf:trees/darkoak1", stumpOffset: GrowUtil.vec3(2, 0, 2) },
      { name: "noxcrew_mf:trees/darkoak2", stumpOffset: GrowUtil.vec3(2, 0, 2) },
      { name: "noxcrew_mf:trees/darkoak3", stumpOffset: GrowUtil.vec3(2, 0, 2) }
    ];
    this.minHeight = 2;
    this.maxHeight = 4;
    this.stumpBlock = "minecraft:dark_oak_log";
  }
};

// effects/bloom.js
var __runInitializers8 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate8 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var BloomCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateBloomCustomEffect_decorators;
  return _a = class BloomCustomEffect extends _classSuper {
    constructor() {
      super(...arguments);
      this.PLANTS = (__runInitializers8(this, _instanceExtraInitializers), /* @__PURE__ */ new Map([
        ["minecraft:wheat", new WheatGrower()],
        ["minecraft:pumpkin_stem", new PumpkinGrower()],
        ["minecraft:melon_stem", new MelonGrower()],
        ["minecraft:carrots", new CarrotGrower()],
        ["minecraft:potatoes", new PotatoGrower()],
        ["minecraft:beetroot", new BeetrootGrower()],
        ["minecraft:torchflower_crop", new TorchflowerGrower()],
        ["minecraft:sweet_berry_bush", new SweetBerryGrower()],
        ["minecraft:nether_wart", new NetherWartGrower()],
        ["minecraft:cocoa", new CocoaBeanGrower()],
        ["minecraft:pitcher_crop", new PitcherPodGrower()],
        ["minecraft:cactus", new CactusGrower()],
        ["minecraft:reeds", new SugarcaneGrower()],
        ["minecraft:big_dripleaf", new BigDripleafGrower()],
        ["minecraft:kelp", new KelpGrower()],
        ["minecraft:twisting_vines", new TwistingVinesGrower()],
        ["minecraft:weeping_vines", new WeepingVinesGrower()],
        ["minecraft:bamboo", new BambooGrower()],
        ["minecraft:bamboo_sapling", new BambooGrower()],
        ["minecraft:short_grass", new GrassGrower()],
        ["minecraft:fern", new FernGrower()],
        ["minecraft:seagrass", new SeagrassGrower()],
        ["minecraft:small_dripleaf_block", new SmallDripleafGrower()],
        ["minecraft:cave_vines", new GlowBerriesGrower()],
        ["minecraft:oak_sapling", new OakTreeGrower()],
        ["minecraft:birch_sapling", new BirchTreeGrower()],
        ["minecraft:spruce_sapling", new SpruceTreeGrower()],
        ["minecraft:dark_oak_sapling", new DarkOakTreeGrower()],
        ["minecraft:jungle_sapling", new JungleTreeGrower()],
        ["minecraft:acacia_sapling", new AcaciaTreeGrower()],
        ["minecraft:cherry_sapling", new CherryTreeGrower()],
        ["minecraft:crimson_fungus", new CrimsonTreeGrower()],
        ["minecraft:warped_fungus", new WarpedTreeGrower()],
        ["minecraft:azalea", new AzaleaTreeGrower()],
        ["minecraft:flowering_azalea", new AzaleaTreeGrower()]
      ]));
    }
    activateBloomCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:bloom", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 5 * TicksPerSecond2, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.growInRadius(this.player.location, this.player.dimension, 3, 3, 3);
      }, true);
      ScopedTimer.schedule(this, 1, () => {
        const block = this.player.dimension.getBlock(this.player.location);
        if (block === void 0)
          return;
        const belowBlock = block.below(1);
        if (belowBlock?.typeId === "minecraft:dirt") {
          belowBlock?.setType("minecraft:grass_block");
        } else if (belowBlock?.typeId === "minecraft:grass_block") {
          if (block.typeId !== "minecraft:air")
            return;
          block.setType("minecraft:pink_petals");
        }
      }, true);
    }
    growInRadius(location, dimension, topOffset, bottomOffset, radius) {
      for (let x = -radius; x <= radius; ++x) {
        for (let z = -radius; z <= radius; ++z) {
          if (x * x + z * z <= radius * radius) {
            this.grow({ x: location.x + x, y: location.y, z: location.z + z }, dimension, topOffset, bottomOffset);
          }
        }
      }
    }
    grow(location, dimension, topOffset, bottomOffset) {
      for (let y = location.y + topOffset; y >= location.y - bottomOffset; --y) {
        let block = dimension.getBlock({ x: location.x, y, z: location.z });
        if (block === void 0)
          return;
        this.PLANTS.get(block.typeId)?.grow(block);
      }
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateBloomCustomEffect_decorators = [Hook("activate")];
    __esDecorate8(_a, null, _activateBloomCustomEffect_decorators, { kind: "method", name: "activateBloomCustomEffect", static: false, private: false, access: { has: (obj) => "activateBloomCustomEffect" in obj, get: (obj) => obj.activateBloomCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// effects/curses.js
import { world as world18, Player as Player3, TicksPerSecond as TicksPerSecond3 } from "@minecraft/server";

// util/localCoords.js
function localCoords(entity, localOffset) {
  const zVec = new Vector3Builder(entity.getViewDirection());
  const xVec = new Vector3Builder({ x: zVec.z, y: 0, z: -zVec.x }).normalize();
  const yVec = new Vector3Builder(zVec).cross(xVec).normalize();
  const localCoords2 = xVec.scale(localOffset.x).add(yVec.scale(localOffset.y)).add(zVec.scale(localOffset.z));
  return localCoords2;
}

// effects/curses.js
var __runInitializers9 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate9 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var GassyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateGassyCustomEffect_decorators;
  let _setupGassyCustomEffect_decorators;
  let _deactivateGassyCustomEffect_decorators;
  return _a = class GassyCustomEffect extends _classSuper {
    activateGassyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:gassy", this.player.location);
      }, true);
    }
    setupGassyCustomEffect() {
      this.listenFor(world18.afterEvents.entityDie, (e) => {
        if (!(e.damageSource.damagingEntity instanceof Player3) || this.player.dimension.getBlock(e.deadEntity.location) === void 0)
          return;
        this.player.dimension.playSound("noxcrew_mf:gassy", e.deadEntity.location);
        this.player.dimension.spawnEntity("minecraft:wind_charge_projectile", e.deadEntity.location).applyImpulse({
          x: 0,
          y: -1,
          z: 0
        });
      });
    }
    deactivateGassyCustomEffect() {
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateGassyCustomEffect_decorators = [Hook("activate")];
    _setupGassyCustomEffect_decorators = [Hook("setup")];
    _deactivateGassyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateGassyCustomEffect_decorators, { kind: "method", name: "activateGassyCustomEffect", static: false, private: false, access: { has: (obj) => "activateGassyCustomEffect" in obj, get: (obj) => obj.activateGassyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _setupGassyCustomEffect_decorators, { kind: "method", name: "setupGassyCustomEffect", static: false, private: false, access: { has: (obj) => "setupGassyCustomEffect" in obj, get: (obj) => obj.setupGassyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateGassyCustomEffect_decorators, { kind: "method", name: "deactivateGassyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateGassyCustomEffect" in obj, get: (obj) => obj.deactivateGassyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var StickyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateStickyCustomEffect_decorators;
  let _setupStickyCustomEffect_decorators;
  let _deactivateStickyCustomEffect_decorators;
  return _a = class StickyCustomEffect extends _classSuper {
    activateStickyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:webs", this.player.location);
      }, true);
    }
    setupStickyCustomEffect() {
      this.listenFor(world18.afterEvents.entityDie, (e) => {
        if (!(e.damageSource.damagingEntity instanceof Player3))
          return;
        if (!world18.gameRules.mobGriefing)
          return;
        const negCorner = Vector3Utils.subtract(e.deadEntity.location, { x: 3, y: 0, z: 3 });
        this.placeWebs(negCorner);
      });
    }
    placeWebs(location) {
      let amount = getRandomInt(1, 3);
      for (let i = 0; i < 5; i++) {
        if (amount <= 0)
          return;
        for (let j = 0; j < 5; j++) {
          if (Math.round(Math.random()) === 0)
            continue;
          if (amount <= 0)
            return;
          const coords = Vector3Utils.add(location, { x: i, y: 0, z: j });
          const block = this.player.dimension.getBlock(coords);
          if (block?.typeId !== "minecraft:air")
            continue;
          this.player.dimension.setBlockType(coords, "minecraft:web");
          --amount;
        }
      }
    }
    deactivateStickyCustomEffect() {
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateStickyCustomEffect_decorators = [Hook("activate")];
    _setupStickyCustomEffect_decorators = [Hook("setup")];
    _deactivateStickyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateStickyCustomEffect_decorators, { kind: "method", name: "activateStickyCustomEffect", static: false, private: false, access: { has: (obj) => "activateStickyCustomEffect" in obj, get: (obj) => obj.activateStickyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _setupStickyCustomEffect_decorators, { kind: "method", name: "setupStickyCustomEffect", static: false, private: false, access: { has: (obj) => "setupStickyCustomEffect" in obj, get: (obj) => obj.setupStickyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateStickyCustomEffect_decorators, { kind: "method", name: "deactivateStickyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateStickyCustomEffect" in obj, get: (obj) => obj.deactivateStickyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var SnottyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateSnottyCustomEffect_decorators;
  let _setupSnottyCustomEffect_decorators;
  let _deactivateSnottyCustomEffect_decorators;
  return _a = class SnottyCustomEffect extends _classSuper {
    activateSnottyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:snotty", this.player.location);
      }, true);
    }
    setupSnottyCustomEffect() {
      this.listenFor(world18.afterEvents.entityDie, (e) => {
        if (!(e.damageSource.damagingEntity instanceof Player3))
          return;
        try {
          this.player.dimension.spawnEntity("minecraft:slime", e.deadEntity.location);
          this.player.dimension.spawnEntity("minecraft:slime", e.deadEntity.location);
        } catch (error) {
          e.damageSource.damagingEntity.sendMessage({ translate: "noxcrew_mf:txt.error.difficulty" });
        }
      });
    }
    deactivateSnottyCustomEffect() {
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateSnottyCustomEffect_decorators = [Hook("activate")];
    _setupSnottyCustomEffect_decorators = [Hook("setup")];
    _deactivateSnottyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateSnottyCustomEffect_decorators, { kind: "method", name: "activateSnottyCustomEffect", static: false, private: false, access: { has: (obj) => "activateSnottyCustomEffect" in obj, get: (obj) => obj.activateSnottyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _setupSnottyCustomEffect_decorators, { kind: "method", name: "setupSnottyCustomEffect", static: false, private: false, access: { has: (obj) => "setupSnottyCustomEffect" in obj, get: (obj) => obj.setupSnottyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateSnottyCustomEffect_decorators, { kind: "method", name: "deactivateSnottyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateSnottyCustomEffect" in obj, get: (obj) => obj.deactivateSnottyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var WormsCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateWormsCustomEffect_decorators;
  let _deactivateWormsCustomEffect_decorators;
  return _a = class WormsCustomEffect extends _classSuper {
    activateWormsCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:worms", this.player.location);
      }, true);
      this.player.addEffect("infested", this.duration * TicksPerSecond3, { amplifier: this.strength });
    }
    deactivateWormsCustomEffect() {
      this.player.removeEffect("infested");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateWormsCustomEffect_decorators = [Hook("activate")];
    _deactivateWormsCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateWormsCustomEffect_decorators, { kind: "method", name: "activateWormsCustomEffect", static: false, private: false, access: { has: (obj) => "activateWormsCustomEffect" in obj, get: (obj) => obj.activateWormsCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateWormsCustomEffect_decorators, { kind: "method", name: "deactivateWormsCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateWormsCustomEffect" in obj, get: (obj) => obj.deactivateWormsCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var SpicyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateSpicyCustomEffect_decorators;
  let _deactivateSpicyCustomEffect_decorators;
  return _a = class SpicyCustomEffect extends _classSuper {
    activateSpicyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:spicy", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 1, () => {
        const offset = localCoords(this.player, { x: 0, y: 0, z: -2.5 });
        const newCoord = Vector3Utils.add(this.player.location, { x: offset.x, y: 0, z: offset.z });
        const block = this.player.dimension.getBlock(newCoord);
        if (!block || !_a.REPLACEABLE_BLOCKS.includes(block?.typeId))
          return;
        this.player.dimension.setBlockType(newCoord, "minecraft:fire");
      }, true);
    }
    deactivateSpicyCustomEffect() {
      this.player.removeEffect("infested");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateSpicyCustomEffect_decorators = [Hook("activate")];
    _deactivateSpicyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateSpicyCustomEffect_decorators, { kind: "method", name: "activateSpicyCustomEffect", static: false, private: false, access: { has: (obj) => "activateSpicyCustomEffect" in obj, get: (obj) => obj.activateSpicyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateSpicyCustomEffect_decorators, { kind: "method", name: "deactivateSpicyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateSpicyCustomEffect" in obj, get: (obj) => obj.deactivateSpicyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a.REPLACEABLE_BLOCKS = ["minecraft:air", "minecraft:snow_layer", "minecraft:snow"], _a;
})();
var LoopyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateLoopyCustomEffect_decorators;
  let _deactivateLoopyCustomEffect_decorators;
  return _a = class LoopyCustomEffect extends _classSuper {
    activateLoopyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:loopy", this.player.location);
      }, true);
      this.player.addEffect("nausea", this.duration * TicksPerSecond3, { amplifier: this.strength });
    }
    deactivateLoopyCustomEffect() {
      this.player.removeEffect("nausea");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateLoopyCustomEffect_decorators = [Hook("activate")];
    _deactivateLoopyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateLoopyCustomEffect_decorators, { kind: "method", name: "activateLoopyCustomEffect", static: false, private: false, access: { has: (obj) => "activateLoopyCustomEffect" in obj, get: (obj) => obj.activateLoopyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateLoopyCustomEffect_decorators, { kind: "method", name: "deactivateLoopyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateLoopyCustomEffect" in obj, get: (obj) => obj.deactivateLoopyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var SleepyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateSleepyCustomEffect_decorators;
  let _deactivateSleepyCustomEffect_decorators;
  return _a = class SleepyCustomEffect extends _classSuper {
    activateSleepyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:sleepy", this.player.location);
      }, true);
      this.player.addEffect("darkness", this.duration * TicksPerSecond3, { amplifier: this.strength });
    }
    deactivateSleepyCustomEffect() {
      this.player.removeEffect("darkness");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateSleepyCustomEffect_decorators = [Hook("activate")];
    _deactivateSleepyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateSleepyCustomEffect_decorators, { kind: "method", name: "activateSleepyCustomEffect", static: false, private: false, access: { has: (obj) => "activateSleepyCustomEffect" in obj, get: (obj) => obj.activateSleepyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateSleepyCustomEffect_decorators, { kind: "method", name: "deactivateSleepyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateSleepyCustomEffect" in obj, get: (obj) => obj.deactivateSleepyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var HungryCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateHungryCustomEffect_decorators;
  let _deactivateHungryCustomEffect_decorators;
  return _a = class HungryCustomEffect extends _classSuper {
    activateHungryCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:hungry", this.player.location);
      }, true);
      this.player.addEffect("hunger", this.duration * TicksPerSecond3, { amplifier: this.strength });
    }
    deactivateHungryCustomEffect() {
      this.player.removeEffect("hunger");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateHungryCustomEffect_decorators = [Hook("activate")];
    _deactivateHungryCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateHungryCustomEffect_decorators, { kind: "method", name: "activateHungryCustomEffect", static: false, private: false, access: { has: (obj) => "activateHungryCustomEffect" in obj, get: (obj) => obj.activateHungryCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateHungryCustomEffect_decorators, { kind: "method", name: "deactivateHungryCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateHungryCustomEffect" in obj, get: (obj) => obj.deactivateHungryCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var HateCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateHateCustomEffect_decorators;
  let _deactivateHateCustomEffect_decorators;
  return _a = class HateCustomEffect extends _classSuper {
    activateHateCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:hatred", this.player.location);
      }, true);
      this.player.addEffect("raid_omen", this.duration * TicksPerSecond3, { amplifier: this.strength });
    }
    deactivateHateCustomEffect() {
      this.player.removeEffect("raid_omen");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateHateCustomEffect_decorators = [Hook("activate")];
    _deactivateHateCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateHateCustomEffect_decorators, { kind: "method", name: "activateHateCustomEffect", static: false, private: false, access: { has: (obj) => "activateHateCustomEffect" in obj, get: (obj) => obj.activateHateCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateHateCustomEffect_decorators, { kind: "method", name: "deactivateHateCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateHateCustomEffect" in obj, get: (obj) => obj.deactivateHateCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var LazyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateLazyCustomEffect_decorators;
  let _deactivateLazyCustomEffect_decorators;
  return _a = class LazyCustomEffect extends _classSuper {
    activateLazyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:lazy", this.player.location);
      }, true);
      this.player.addEffect("mining_fatigue", this.duration * TicksPerSecond3, { amplifier: this.strength });
    }
    deactivateLazyCustomEffect() {
      this.player.removeEffect("mining_fatigue");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateLazyCustomEffect_decorators = [Hook("activate")];
    _deactivateLazyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateLazyCustomEffect_decorators, { kind: "method", name: "activateLazyCustomEffect", static: false, private: false, access: { has: (obj) => "activateLazyCustomEffect" in obj, get: (obj) => obj.activateLazyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateLazyCustomEffect_decorators, { kind: "method", name: "deactivateLazyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateLazyCustomEffect" in obj, get: (obj) => obj.deactivateLazyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var SunburnCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateSunburnCustomEffect_decorators;
  let _deactivateSunburnCustomEffect_decorators;
  return _a = class SunburnCustomEffect extends _classSuper {
    activateSunburnCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:sunburn", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 15 * TicksPerSecond3, () => {
        if (getRandomInt(1, 4) != 1)
          return;
        this.player.setOnFire(3);
      }, true);
    }
    deactivateSunburnCustomEffect() {
      this.player.extinguishFire();
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateSunburnCustomEffect_decorators = [Hook("activate")];
    _deactivateSunburnCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateSunburnCustomEffect_decorators, { kind: "method", name: "activateSunburnCustomEffect", static: false, private: false, access: { has: (obj) => "activateSunburnCustomEffect" in obj, get: (obj) => obj.activateSunburnCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateSunburnCustomEffect_decorators, { kind: "method", name: "deactivateSunburnCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateSunburnCustomEffect" in obj, get: (obj) => obj.deactivateSunburnCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var DryCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateDryCustomEffect_decorators;
  let _deactivateDryCustomEffect_decorators;
  return _a = class DryCustomEffect extends _classSuper {
    activateDryCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:dry", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 1 * TicksPerSecond3, () => {
        if (!this.player.isInWater)
          return;
        this.player.addEffect("wither", 30, { amplifier: this.strength });
      }, true);
    }
    deactivateDryCustomEffect() {
      this.player.removeEffect("wither");
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateDryCustomEffect_decorators = [Hook("activate")];
    _deactivateDryCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateDryCustomEffect_decorators, { kind: "method", name: "activateDryCustomEffect", static: false, private: false, access: { has: (obj) => "activateDryCustomEffect" in obj, get: (obj) => obj.activateDryCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateDryCustomEffect_decorators, { kind: "method", name: "deactivateDryCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateDryCustomEffect" in obj, get: (obj) => obj.deactivateDryCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var StaticCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateStaticCustomEffect_decorators;
  let _deactivateStaticCustomEffect_decorators;
  return _a = class StaticCustomEffect extends _classSuper {
    activateStaticCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:static", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 30 * TicksPerSecond3, () => {
        this.player.dimension.spawnEntity("minecraft:lightning_bolt", this.player.location);
      }, true);
    }
    deactivateStaticCustomEffect() {
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateStaticCustomEffect_decorators = [Hook("activate")];
    _deactivateStaticCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateStaticCustomEffect_decorators, { kind: "method", name: "activateStaticCustomEffect", static: false, private: false, access: { has: (obj) => "activateStaticCustomEffect" in obj, get: (obj) => obj.activateStaticCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateStaticCustomEffect_decorators, { kind: "method", name: "deactivateStaticCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateStaticCustomEffect" in obj, get: (obj) => obj.deactivateStaticCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var BeastCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateBeastCustomEffect_decorators;
  let _deactivateBeastCustomEffect_decorators;
  return _a = class BeastCustomEffect extends _classSuper {
    activateBeastCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:beasty", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 2, () => {
        const entities = this.player.dimension.getEntities({
          location: this.player.location,
          maxDistance: 1.5
        });
        for (const entity of entities) {
          if (_a.NEUTRAL_MOBS.includes(entity.typeId)) {
            entity.kill();
            this.player.playSound("random.eat");
          }
        }
      }, true);
    }
    deactivateBeastCustomEffect() {
    }
    constructor() {
      super(...arguments);
      __runInitializers9(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateBeastCustomEffect_decorators = [Hook("activate")];
    _deactivateBeastCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate9(_a, null, _activateBeastCustomEffect_decorators, { kind: "method", name: "activateBeastCustomEffect", static: false, private: false, access: { has: (obj) => "activateBeastCustomEffect" in obj, get: (obj) => obj.activateBeastCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate9(_a, null, _deactivateBeastCustomEffect_decorators, { kind: "method", name: "deactivateBeastCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateBeastCustomEffect" in obj, get: (obj) => obj.deactivateBeastCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a.NEUTRAL_MOBS = [
    "minecraft:allay",
    "minecraft:armadillo",
    "minecraft:axolotl",
    "minecraft:bat",
    "minecraft:camel",
    "minecraft:cat",
    "minecraft:chicken",
    "minecraft:cod",
    "minecraft:cow",
    "minecraft:donkey",
    "minecraft:fox",
    "minecraft:frog",
    "minecraft:glow_squid",
    "minecraft:horse",
    "minecraft:mooshroom",
    "minecraft:mule",
    "minecraft:ocelot",
    "minecraft:parrot",
    "minecraft:pig",
    "minecraft:pufferfish",
    "minecraft:rabbit",
    "minecraft:salmon",
    "minecraft:sheep",
    "minecraft:skeleton_horse",
    "minecraft:sniffer",
    "minecraft:snow_golem",
    "minecraft:squid",
    "minecraft:strider",
    "minecraft:tadpole",
    "minecraft:tropicalfish",
    "minecraft:turtle",
    "minecraft:villager",
    "minecraft:wandering_trader",
    "minecraft:bee",
    "minecraft:cave_spider",
    "minecraft:dolphin",
    "minecraft:enderman",
    "minecraft:goat",
    "minecraft:iron_golem",
    "minecraft:llama",
    "minecraft:panda",
    "minecraft:piglin",
    "minecraft:polar_bear",
    "minecraft:wolf"
  ], _a;
})();

// effects/powers.js
import { world as world19, EntityComponentTypes, TicksPerSecond as TicksPerSecond4 } from "@minecraft/server";
var __runInitializers10 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate10 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var FrostyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateFrostyCustomEffect_decorators;
  let _deactivateFrostyCustomEffect_decorators;
  return _a = class FrostyCustomEffect extends _classSuper {
    activateFrostyCustomEffect() {
      ScopedTimer.schedule(this, 50, () => {
        this.player.dimension.spawnParticle("noxcrew_mf:frosty", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 1, () => {
        const block = this.player.dimension.getBlock(this.player.location)?.below(1);
        if (!block)
          return;
        const placeLoc = Vector3Utils.subtract(block.location, { x: 1, y: 0, z: 1 });
        for (let i = 0; i < 3; i++) {
          for (let j = 0; j < 3; j++) {
            const coords = Vector3Utils.add(placeLoc, { x: i, y: 0, z: j });
            const block2 = this.player.dimension.getBlock(coords);
            if (block2?.typeId === "minecraft:water") {
              this.player.dimension.setBlockType(coords, "minecraft:frosted_ice");
            } else if (block2?.typeId === "minecraft:lava") {
              this.player.dimension.setBlockType(coords, "minecraft:obsidian");
            }
          }
        }
      }, true);
    }
    deactivateFrostyCustomEffect() {
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateFrostyCustomEffect_decorators = [Hook("activate")];
    _deactivateFrostyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateFrostyCustomEffect_decorators, { kind: "method", name: "activateFrostyCustomEffect", static: false, private: false, access: { has: (obj) => "activateFrostyCustomEffect" in obj, get: (obj) => obj.activateFrostyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateFrostyCustomEffect_decorators, { kind: "method", name: "deactivateFrostyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateFrostyCustomEffect" in obj, get: (obj) => obj.deactivateFrostyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var HastyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateHastyCustomEffect_decorators;
  let _deactivateHastyCustomEffect_decorators;
  return _a = class HastyCustomEffect extends _classSuper {
    activateHastyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:hasty", this.player.location);
      }, true);
      this.player.addEffect("haste", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateHastyCustomEffect() {
      this.player.removeEffect("haste");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateHastyCustomEffect_decorators = [Hook("activate")];
    _deactivateHastyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateHastyCustomEffect_decorators, { kind: "method", name: "activateHastyCustomEffect", static: false, private: false, access: { has: (obj) => "activateHastyCustomEffect" in obj, get: (obj) => obj.activateHastyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateHastyCustomEffect_decorators, { kind: "method", name: "deactivateHastyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateHastyCustomEffect" in obj, get: (obj) => obj.deactivateHastyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var FastCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateFastCustomEffect_decorators;
  let _deactivateFastCustomEffect_decorators;
  return _a = class FastCustomEffect extends _classSuper {
    activateFastCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:fast", this.player.location);
      }, true);
      this.player.addEffect("speed", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateFastCustomEffect() {
      this.player.removeEffect("speed");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateFastCustomEffect_decorators = [Hook("activate")];
    _deactivateFastCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateFastCustomEffect_decorators, { kind: "method", name: "activateFastCustomEffect", static: false, private: false, access: { has: (obj) => "activateFastCustomEffect" in obj, get: (obj) => obj.activateFastCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateFastCustomEffect_decorators, { kind: "method", name: "deactivateFastCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateFastCustomEffect" in obj, get: (obj) => obj.deactivateFastCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var HealthyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateHealthyCustomEffect_decorators;
  let _deactivateHealthyCustomEffect_decorators;
  return _a = class HealthyCustomEffect extends _classSuper {
    activateHealthyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:healthy", this.player.location);
      }, true);
      this.player.addEffect("instant_health", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateHealthyCustomEffect() {
      this.player.removeEffect("instant_health");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateHealthyCustomEffect_decorators = [Hook("activate")];
    _deactivateHealthyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateHealthyCustomEffect_decorators, { kind: "method", name: "activateHealthyCustomEffect", static: false, private: false, access: { has: (obj) => "activateHealthyCustomEffect" in obj, get: (obj) => obj.activateHealthyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateHealthyCustomEffect_decorators, { kind: "method", name: "deactivateHealthyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateHealthyCustomEffect" in obj, get: (obj) => obj.deactivateHealthyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var CharmCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateCharmCustomEffect_decorators;
  let _deactivateCharmCustomEffect_decorators;
  return _a = class CharmCustomEffect extends _classSuper {
    activateCharmCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:charm", this.player.location);
      }, true);
      this.player.addEffect("village_hero", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateCharmCustomEffect() {
      this.player.removeEffect("village_hero");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateCharmCustomEffect_decorators = [Hook("activate")];
    _deactivateCharmCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateCharmCustomEffect_decorators, { kind: "method", name: "activateCharmCustomEffect", static: false, private: false, access: { has: (obj) => "activateCharmCustomEffect" in obj, get: (obj) => obj.activateCharmCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateCharmCustomEffect_decorators, { kind: "method", name: "deactivateCharmCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateCharmCustomEffect" in obj, get: (obj) => obj.deactivateCharmCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var SturdyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateSturdyCustomEffect_decorators;
  let _deactivateSturdyCustomEffect_decorators;
  return _a = class SturdyCustomEffect extends _classSuper {
    activateSturdyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:sturdy", this.player.location);
      }, true);
      this.player.addEffect("resistance", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateSturdyCustomEffect() {
      this.player.removeEffect("resistance");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateSturdyCustomEffect_decorators = [Hook("activate")];
    _deactivateSturdyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateSturdyCustomEffect_decorators, { kind: "method", name: "activateSturdyCustomEffect", static: false, private: false, access: { has: (obj) => "activateSturdyCustomEffect" in obj, get: (obj) => obj.activateSturdyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateSturdyCustomEffect_decorators, { kind: "method", name: "deactivateSturdyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateSturdyCustomEffect" in obj, get: (obj) => obj.deactivateSturdyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var BuffCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateBuffCustomEffect_decorators;
  let _deactivateBuffCustomEffect_decorators;
  return _a = class BuffCustomEffect extends _classSuper {
    activateBuffCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:buff", this.player.location);
      }, true);
      this.player.addEffect("strength", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateBuffCustomEffect() {
      this.player.removeEffect("strength");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateBuffCustomEffect_decorators = [Hook("activate")];
    _deactivateBuffCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateBuffCustomEffect_decorators, { kind: "method", name: "activateBuffCustomEffect", static: false, private: false, access: { has: (obj) => "activateBuffCustomEffect" in obj, get: (obj) => obj.activateBuffCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateBuffCustomEffect_decorators, { kind: "method", name: "deactivateBuffCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateBuffCustomEffect" in obj, get: (obj) => obj.deactivateBuffCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var HeartyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateHeartyCustomEffect_decorators;
  let _deactivateHeartyCustomEffect_decorators;
  return _a = class HeartyCustomEffect extends _classSuper {
    activateHeartyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:hearty", this.player.location);
      }, true);
      this.player.addEffect("health_boost", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateHeartyCustomEffect() {
      this.player.removeEffect("health_boost");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateHeartyCustomEffect_decorators = [Hook("activate")];
    _deactivateHeartyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateHeartyCustomEffect_decorators, { kind: "method", name: "activateHeartyCustomEffect", static: false, private: false, access: { has: (obj) => "activateHeartyCustomEffect" in obj, get: (obj) => obj.activateHeartyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateHeartyCustomEffect_decorators, { kind: "method", name: "deactivateHeartyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateHeartyCustomEffect" in obj, get: (obj) => obj.deactivateHeartyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var FishyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateFishyCustomEffect_decorators;
  let _deactivateFishyCustomEffect_decorators;
  return _a = class FishyCustomEffect extends _classSuper {
    activateFishyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:wet", this.player.location);
      }, true);
      this.player.addEffect("conduit_power", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateFishyCustomEffect() {
      this.player.removeEffect("conduit_power");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateFishyCustomEffect_decorators = [Hook("activate")];
    _deactivateFishyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateFishyCustomEffect_decorators, { kind: "method", name: "activateFishyCustomEffect", static: false, private: false, access: { has: (obj) => "activateFishyCustomEffect" in obj, get: (obj) => obj.activateFishyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateFishyCustomEffect_decorators, { kind: "method", name: "deactivateFishyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateFishyCustomEffect" in obj, get: (obj) => obj.deactivateFishyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var DragonCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateDragonCustomEffect_decorators;
  let _setupDragonCustomEffect_decorators;
  let _deactivateDragonCustomEffect_decorators;
  return _a = class DragonCustomEffect extends _classSuper {
    activateDragonCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:dragon", this.player.location);
      }, true);
      this.player.addEffect("fire_resistance", this.duration * TicksPerSecond4, { amplifier: this.strength });
      ScopedTimer.schedule(this, 15, () => {
        const throwPower = Vector3Utils.scale(this.player.getViewDirection(), 1);
        const local = localCoords(this.player, { x: 0, y: 1.5, z: 1 });
        const playerLoc = Vector3Utils.add(this.player.location, local);
        const dragon = this.player.dimension.spawnEntity("noxcrew_mf:projectile_fireball", playerLoc);
        const projectile = dragon.getComponent(EntityComponentTypes.Projectile);
        if (!projectile)
          return;
        projectile.owner = this.player;
        projectile.shoot(throwPower);
      }, true);
    }
    setupDragonCustomEffect() {
      this.listenFor(world19.afterEvents.projectileHitBlock, (e) => {
        const hitBlock = e.dimension.getBlock(e.location);
        if (hitBlock?.typeId !== "minecraft:fire") {
          e.dimension.setBlockType(e.location, "minecraft:fire");
        }
        if (!e.projectile.isValid)
          return;
        try {
          e.projectile.remove();
        } catch (e2) {
        }
      });
      this.listenFor(world19.afterEvents.projectileHitEntity, (e) => {
        if (!e.projectile.isValid)
          return;
        try {
          e.projectile.remove();
        } catch (e2) {
        }
      });
    }
    deactivateDragonCustomEffect() {
      this.player.removeEffect("fire_resistance");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateDragonCustomEffect_decorators = [Hook("activate")];
    _setupDragonCustomEffect_decorators = [Hook("setup")];
    _deactivateDragonCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateDragonCustomEffect_decorators, { kind: "method", name: "activateDragonCustomEffect", static: false, private: false, access: { has: (obj) => "activateDragonCustomEffect" in obj, get: (obj) => obj.activateDragonCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _setupDragonCustomEffect_decorators, { kind: "method", name: "setupDragonCustomEffect", static: false, private: false, access: { has: (obj) => "setupDragonCustomEffect" in obj, get: (obj) => obj.setupDragonCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateDragonCustomEffect_decorators, { kind: "method", name: "deactivateDragonCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateDragonCustomEffect" in obj, get: (obj) => obj.deactivateDragonCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var BouncyCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateBouncyCustomEffect_decorators;
  let _deactivateBouncyCustomEffect_decorators;
  return _a = class BouncyCustomEffect extends _classSuper {
    activateBouncyCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:bouncy", this.player.location);
      }, true);
      this.player.addEffect("jump_boost", this.duration * TicksPerSecond4, { amplifier: this.strength });
      this.player.addEffect("slow_falling", this.duration * TicksPerSecond4, { amplifier: this.strength });
    }
    deactivateBouncyCustomEffect() {
      this.player.removeEffect("jump_boost");
      this.player.removeEffect("slow_falling");
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateBouncyCustomEffect_decorators = [Hook("activate")];
    _deactivateBouncyCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateBouncyCustomEffect_decorators, { kind: "method", name: "activateBouncyCustomEffect", static: false, private: false, access: { has: (obj) => "activateBouncyCustomEffect" in obj, get: (obj) => obj.activateBouncyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateBouncyCustomEffect_decorators, { kind: "method", name: "deactivateBouncyCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateBouncyCustomEffect" in obj, get: (obj) => obj.deactivateBouncyCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();
var BaitCustomEffect = (() => {
  var _a;
  let _classSuper = CustomEffect;
  let _instanceExtraInitializers = [];
  let _activateBaitCustomEffect_decorators;
  let _deactivateBaitCustomEffect_decorators;
  return _a = class BaitCustomEffect extends _classSuper {
    activateBaitCustomEffect() {
      ScopedTimer.schedule(this, 40, () => {
        if (this.player.dimension.getBlock(this.player.location) === void 0)
          return;
        this.player.dimension.spawnParticle("noxcrew_mf:bait", this.player.location);
      }, true);
      ScopedTimer.schedule(this, 5 * TicksPerSecond4, () => {
        if (!this.player.isInWater)
          return;
        this.spawnFish();
      }, true);
    }
    spawnFish() {
      const fish = ["minecraft:pufferfish", "minecraft:tropicalfish", "minecraft:cod", "minecraft:salmon"];
      const spawnFish = Vector3Utils.add(this.player.location, {
        x: getRandomInt(-2, 2),
        y: getRandomInt(-2, 2),
        z: getRandomInt(-2, 2)
      });
      const spawnBlock = this.player.dimension.getBlock(spawnFish);
      if (spawnBlock?.typeId !== "minecraft:water") {
        this.spawnFish();
        return;
      }
      const num = getRandomInt(0, fish.length - 1);
      this.player.dimension.spawnEntity(fish[num], spawnFish);
    }
    deactivateBaitCustomEffect() {
    }
    constructor() {
      super(...arguments);
      __runInitializers10(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _activateBaitCustomEffect_decorators = [Hook("activate")];
    _deactivateBaitCustomEffect_decorators = [Hook("deactivate")];
    __esDecorate10(_a, null, _activateBaitCustomEffect_decorators, { kind: "method", name: "activateBaitCustomEffect", static: false, private: false, access: { has: (obj) => "activateBaitCustomEffect" in obj, get: (obj) => obj.activateBaitCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate10(_a, null, _deactivateBaitCustomEffect_decorators, { kind: "method", name: "deactivateBaitCustomEffect", static: false, private: false, access: { has: (obj) => "deactivateBaitCustomEffect" in obj, get: (obj) => obj.deactivateBaitCustomEffect }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// util/registry.js
var Registry;
(function(Registry2) {
  function of(entries) {
    return new InMemoryRegistry(entries).freeze();
  }
  Registry2.of = of;
  function empty() {
    return EMPTY_REGISTRY;
  }
  Registry2.empty = empty;
  function create() {
    return new InMemoryRegistry({});
  }
  Registry2.create = create;
})(Registry || (Registry = {}));
var InMemoryRegistry = class {
  constructor(values) {
    this.isFrozen = false;
    this.values = { ...values };
  }
  freeze() {
    if (!this.isFrozen) {
      this.isFrozen = true;
      Object.freeze(this.values);
    }
    return this;
  }
  keys() {
    return Object.keys(this.values);
  }
  set(key, value) {
    if (this.isFrozen)
      throw new Error("Registry is not writable");
    const keyString = typeof key == "string" ? key : key.name;
    const oldValue = this.values[keyString];
    this.values[keyString] = value;
    return oldValue;
  }
  get(name) {
    return this.values[name];
  }
  getTyped(key) {
    const value = this.get(key.name);
    if (value === void 0)
      return void 0;
    if (!(value instanceof key.type)) {
      throw new Error(`Expected value type did not match (expected ${key.type.name}, found ${value?.constructor?.name})`);
    }
    return value;
  }
  isWritable() {
    return !this.isFrozen;
  }
  [Symbol.iterator]() {
    return Object.entries(this.values)[Symbol.iterator]();
  }
};
var EMPTY_REGISTRY = Registry.of({});

// effects/manager.js
var __runInitializers11 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate11 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var EffectsManager = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupFoodListeners_decorators;
  return _a = class EffectsManager extends _classSuper {
    setupFoodListeners() {
      this.listenFor(system7.afterEvents.scriptEventReceive, (e) => {
        if (e.id !== "noxcrew_mf:effect" || !e.sourceEntity)
          return;
        for (const effect of e.sourceEntity?.getEffects()) {
          console.error(effect.typeId);
        }
      });
      this.listenFor(world20.afterEvents.itemCompleteUse, (e) => {
        const { itemStack, source } = e;
        if (!itemStack.typeId.startsWith(prefix_default))
          return;
        const itemString = itemStack.typeId.substring(prefix_default.length);
        const foodEffect = _a.FOOD_ITEMS[itemString] ?? void 0;
        source.onScreenDisplay.setActionBar({ translate: `noxcrew_mf:txt.food_hint.${itemString}` });
        for (const effects of foodEffect.effects) {
          this.registerChild(new effects.effect(this, source, effects.duration, effects.strength));
        }
      });
      this.listenFor(world20.beforeEvents.playerLeave, (e) => {
        const effects = [];
        for (const child of this.children) {
          if (child instanceof CustomEffect && child.player.id == e.player.id) {
            effects.push(child);
          }
        }
        const effectsStr = JSON.stringify(effects.map((e2) => ({
          name: e2.constructor.name,
          strength: e2.strength,
          duration: e2.duration * TicksPerSecond5 - (system7.currentTick - e2.startTick)
        })));
        e.player.setDynamicProperty(_a.ACTIVE_EFFECTS_KEY, effectsStr);
      });
      this.listenFor(world20.afterEvents.playerSpawn, (e) => {
        if (!e.initialSpawn)
          return;
        const properties = e.player.getDynamicProperty(_a.ACTIVE_EFFECTS_KEY);
        if (properties == void 0)
          return;
        const parsed = JSON.parse(properties);
        for (const effect of parsed) {
          const ctor = _a.EFFECTS_REGISTRY.get(effect.name);
          if (ctor == void 0) {
            continue;
          }
          this.registerChild(new ctor(this, e.player, effect.duration / TicksPerSecond5, effect.strength));
        }
        e.player.setDynamicProperty(_a.ACTIVE_EFFECTS_KEY, void 0);
      });
    }
    constructor() {
      super(...arguments);
      __runInitializers11(this, _instanceExtraInitializers);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupFoodListeners_decorators = [Hook("setup")];
    __esDecorate11(_a, null, _setupFoodListeners_decorators, { kind: "method", name: "setupFoodListeners", static: false, private: false, access: { has: (obj) => "setupFoodListeners" in obj, get: (obj) => obj.setupFoodListeners }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a.FOOD_ITEMS = {
    battered_breeze_balls: {
      effects: [
        { effect: GassyCustomEffect, duration: 180, strength: 1 },
        { effect: BouncyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    blaze_cocoa: {
      effects: [
        { effect: SpicyCustomEffect, duration: 120, strength: 1 },
        { effect: HealthyCustomEffect, duration: 20, strength: 1 }
      ]
    },
    bogged_stew: {
      effects: [
        { effect: LoopyCustomEffect, duration: 15, strength: 1 },
        { effect: BloomCustomEffect, duration: 90, strength: 1 }
      ]
    },
    bone_shake: {
      effects: [
        { effect: HungryCustomEffect, duration: 20, strength: 1 },
        { effect: FrostyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    boomstick_popsicle: {
      effects: [{ effect: GassyCustomEffect, duration: 90, strength: 1 }]
    },
    brain_juice: {
      effects: [
        { effect: HungryCustomEffect, duration: 90, strength: 1 },
        { effect: HeartyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    crispy_horse_ribs: {
      effects: [
        { effect: SunburnCustomEffect, duration: 180, strength: 1 },
        { effect: HastyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    crunchy_cupcake: {
      effects: [
        { effect: HateCustomEffect, duration: 240, strength: 1 },
        { effect: BuffCustomEffect, duration: 180, strength: 1 }
      ]
    },
    dragon_hotpot: {
      effects: [
        { effect: SpicyCustomEffect, duration: 60, strength: 1 },
        { effect: DragonCustomEffect, duration: 60, strength: 1 }
      ]
    },
    drowned_stew: {
      effects: [
        { effect: FishyCustomEffect, duration: 180, strength: 1 },
        { effect: LoopyCustomEffect, duration: 15, strength: 1 }
      ]
    },
    elder_guardian_sushi: {
      effects: [
        { effect: BeastCustomEffect, duration: 180, strength: 1 },
        { effect: BaitCustomEffect, duration: 180, strength: 1 }
      ]
    },
    ender_emonade: {
      effects: [
        { effect: LoopyCustomEffect, duration: 15, strength: 1 },
        { effect: CharmCustomEffect, duration: 180, strength: 1 }
      ]
    },
    ender_eye_skewer: {
      effects: [
        { effect: LoopyCustomEffect, duration: 15, strength: 1 },
        { effect: CharmCustomEffect, duration: 480, strength: 1 }
      ]
    },
    fried_bone_chips: {
      effects: [{ effect: LazyCustomEffect, duration: 30, strength: 1 }]
    },
    ghast_cake: {
      effects: [
        { effect: DryCustomEffect, duration: 240, strength: 1 },
        { effect: DragonCustomEffect, duration: 40, strength: 1 }
      ]
    },
    glazed_illage_skewer: {
      effects: [
        { effect: HateCustomEffect, duration: 180, strength: 1 },
        { effect: HealthyCustomEffect, duration: 20, strength: 1 }
      ]
    },
    green_ham_and_eggs: {
      effects: [{ effect: HungryCustomEffect, duration: 30, strength: 1 }]
    },
    guardian_broth: {
      effects: [{ effect: FishyCustomEffect, duration: 180, strength: 1 }]
    },
    guardian_sushi: {
      effects: [{ effect: BaitCustomEffect, duration: 90, strength: 1 }]
    },
    hoglin_broth: {
      effects: [
        { effect: BeastCustomEffect, duration: 180, strength: 1 },
        { effect: HeartyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    hot_chocolate_churro: {
      effects: [
        { effect: SpicyCustomEffect, duration: 60, strength: 1 },
        { effect: DragonCustomEffect, duration: 20, strength: 1 }
      ]
    },
    illage_burger: {
      effects: [
        { effect: HateCustomEffect, duration: 180, strength: 1 },
        { effect: HeartyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    magma_cream_cob: {
      effects: [
        { effect: SpicyCustomEffect, duration: 120, strength: 1 },
        { effect: HeartyCustomEffect, duration: 180, strength: 1 }
      ]
    },
    mummy_wrap: {
      effects: [{ effect: DryCustomEffect, duration: 90, strength: 1 }]
    },
    nightmare_boba_tea: {
      effects: [
        { effect: StaticCustomEffect, duration: 180, strength: 1 },
        { effect: FastCustomEffect, duration: 180, strength: 2 }
      ]
    },
    ominous_berry_pie: {
      effects: [
        { effect: HateCustomEffect, duration: 240, strength: 1 },
        { effect: SturdyCustomEffect, duration: 180, strength: 1 }
      ]
    },
    piglin_pizza: {
      effects: [{ effect: DryCustomEffect, duration: 90, strength: 1 }]
    },
    poisoned_cream_cone: {
      effects: [
        { effect: HungryCustomEffect, duration: 40, strength: 1 },
        { effect: FrostyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    ravager_steak: {
      effects: [
        { effect: HateCustomEffect, duration: 180, strength: 1 },
        { effect: BuffCustomEffect, duration: 480, strength: 1 }
      ]
    },
    rotten_nosemallow: {
      effects: [
        { effect: HungryCustomEffect, duration: 20, strength: 1 },
        { effect: HealthyCustomEffect, duration: 20, strength: 1 }
      ]
    },
    rotten_ribs: {
      effects: [
        { effect: HungryCustomEffect, duration: 40, strength: 1 },
        { effect: SturdyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    shulker_spaghetti: {
      effects: [{ effect: BouncyCustomEffect, duration: 180, strength: 1 }]
    },
    silver_seafood: {
      effects: [{ effect: WormsCustomEffect, duration: 30, strength: 1 }]
    },
    slime_stew: {
      effects: [{ effect: SnottyCustomEffect, duration: 90, strength: 1 }]
    },
    soda_breeze: {
      effects: [
        { effect: GassyCustomEffect, duration: 180, strength: 1 },
        { effect: HealthyCustomEffect, duration: 20, strength: 1 }
      ]
    },
    soul_flask: {
      effects: [
        { effect: LoopyCustomEffect, duration: 15, strength: 1 },
        { effect: HealthyCustomEffect, duration: 20, strength: 1 }
      ]
    },
    soul_slorp: {
      effects: [
        { effect: LoopyCustomEffect, duration: 15, strength: 1 },
        { effect: FastCustomEffect, duration: 90, strength: 1 }
      ]
    },
    stuffed_endermite: {
      effects: [
        { effect: WormsCustomEffect, duration: 90, strength: 1 },
        { effect: SleepyCustomEffect, duration: 20, strength: 1 }
      ]
    },
    stuffed_stump: {
      effects: [
        { effect: SleepyCustomEffect, duration: 90, strength: 1 },
        { effect: BloomCustomEffect, duration: 480, strength: 1 }
      ]
    },
    swamp_latte: {
      effects: [
        { effect: HungryCustomEffect, duration: 60, strength: 1 },
        { effect: BloomCustomEffect, duration: 180, strength: 1 }
      ]
    },
    vexed_sandwich: {
      effects: [{ effect: BouncyCustomEffect, duration: 240, strength: 2 }]
    },
    warden_cake: {
      effects: [
        { effect: SleepyCustomEffect, duration: 20, strength: 1 },
        { effect: SturdyCustomEffect, duration: 480, strength: 2 },
        { effect: BuffCustomEffect, duration: 480, strength: 2 }
      ]
    },
    webbed_cream_cone: {
      effects: [
        { effect: StickyCustomEffect, duration: 90, strength: 1 },
        { effect: FrostyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    winter_wrap: {
      effects: [
        { effect: LazyCustomEffect, duration: 30, strength: 1 },
        { effect: FrostyCustomEffect, duration: 90, strength: 1 }
      ]
    },
    wither_skull_sub: {
      effects: [
        { effect: LoopyCustomEffect, duration: 15, strength: 1 },
        { effect: FastCustomEffect, duration: 480, strength: 2 }
      ]
    },
    withered_bonedog: {
      effects: [
        { effect: SunburnCustomEffect, duration: 90, strength: 1 },
        { effect: BuffCustomEffect, duration: 180, strength: 1 }
      ]
    }
  }, _a.EFFECTS_REGISTRY = (() => {
    const registry = Registry.create();
    for (const foodItem of Object.values(_a.FOOD_ITEMS)) {
      for (const { effect } of foodItem.effects) {
        registry.set(effect.name, effect);
      }
    }
    return registry.freeze();
  })(), _a.ACTIVE_EFFECTS_KEY = property("noxcrew_mf:active_effects"), _a;
})();

// mobs/behavior.js
import { EntityComponentTypes as EntityComponentTypes3, ItemStack as ItemStack3, system as system8, TicksPerSecond as TicksPerSecond6, world as world23 } from "@minecraft/server";

// config/mobDrops.js
var MOB_DROPS = {
  "minecraft:elder_guardian": [{ item: "noxcrew_mf:elder_guardian_eye", amount: 1, chance: 1 }],
  "minecraft:ender_dragon": [{ item: "noxcrew_mf:ender_dragon_haunch", amount: [2, 6], chance: 1 }],
  "minecraft:endermite": [
    { item: "noxcrew_mf:ender_shell", amount: [0, 1], chance: 1 },
    { item: "noxcrew_mf:spice_ender", amount: [0, 2], chance: 1 }
  ],
  "minecraft:wither_skeleton": [{ item: "noxcrew_mf:withered_bone", amount: [0, 2], chance: 1 }],
  "minecraft:warden": [{ item: "noxcrew_mf:warden_horn", amount: [1, 2], chance: 1 }],
  "minecraft:vex": [{ item: "noxcrew_mf:vex_wing", amount: [0, 2], chance: 1 }],
  "minecraft:silverfish": [{ item: "noxcrew_mf:silverfish_shell", amount: [0, 1], chance: 1 }],
  "minecraft:shulker": [
    { item: "noxcrew_mf:shulker_goo", amount: [0, 2], chance: 1 },
    { item: "noxcrew_mf:spice_ender", amount: [0, 3], chance: 1 }
  ],
  "minecraft:ravager": [
    { item: "noxcrew_mf:ravager_haunch", amount: [1, 4], chance: 1 },
    { item: "noxcrew_mf:spice_ominous", amount: [0, 2], chance: 0.8 }
  ],
  "minecraft:vindicator": [
    { item: "noxcrew_mf:illager_shank", amount: [0, 1], chance: 1 },
    { item: "noxcrew_mf:spice_ominous", amount: [0, 3], chance: 0.8 }
  ],
  "minecraft:pillager": [
    { item: "noxcrew_mf:illager_shank", amount: [0, 1], chance: 1 },
    { item: "noxcrew_mf:spice_ominous", amount: [0, 3], chance: 0.8 }
  ],
  "minecraft:piglin": [
    { item: "noxcrew_mf:piglin_nose", amount: [0, 1], chance: 1 },
    { item: "noxcrew_mf:spice_nether", amount: [0, 3], chance: 0.8 }
  ],
  "minecraft:piglin_brute": [
    { item: "noxcrew_mf:piglin_nose", amount: [0, 1], chance: 1 },
    { item: "noxcrew_mf:spice_nether", amount: [0, 3], chance: 0.8 }
  ],
  "minecraft:hoglin": [{ item: "noxcrew_mf:hog_meat", amount: [0, 2], chance: 1 }],
  "minecraft:guardian": [{ item: "noxcrew_mf:guardian_eye", amount: [0, 1], chance: 1 }],
  "minecraft:evocation_illager": [
    { item: "noxcrew_mf:evoker_fang", amount: [0, 2], chance: 1 },
    { item: "noxcrew_mf:spice_ominous", amount: [0, 3], chance: 0.8 },
    { item: "noxcrew_mf:spice_ender", amount: [0, 3], chance: 0.8 }
  ],
  "minecraft:bogged": [{ item: "noxcrew_mf:bogged_moss", amount: [0, 2], chance: 1 }],
  "minecraft:witch": [
    { item: "noxcrew_mf:spice_ominous", amount: [1, 3], chance: 1 },
    { item: "noxcrew_mf:spice_ender", amount: [1, 3], chance: 1 }
  ],
  "minecraft:enderman": [{ item: "noxcrew_mf:spice_ender", amount: [1, 3], chance: 1 }],
  "minecraft:stray": [{ item: "noxcrew_mf:spice_ender", amount: [0, 3], chance: 1 }],
  "minecraft:husk": [{ item: "noxcrew_mf:spice_ender", amount: [0, 3], chance: 1 }],
  "minecraft:phantom": [{ item: "noxcrew_mf:spice_ender", amount: [1, 3], chance: 1 }],
  "minecraft:blaze": [{ item: "noxcrew_mf:spice_nether", amount: [0, 3], chance: 1 }],
  "minecraft:ghast": [{ item: "noxcrew_mf:spice_nether", amount: [0, 3], chance: 1 }],
  "minecraft:zoglin": [{ item: "noxcrew_mf:spice_nether", amount: [0, 3], chance: 0.8 }],
  "minecraft:magma_cube": [{ item: "noxcrew_mf:spice_nether", amount: [0, 3], chance: 1 }],
  "minecraft:creeper": [{ item: "noxcrew_mf:spice_nether", amount: [0, 1], chance: 0.2 }],
  "minecraft:zombie": [{ item: "noxcrew_mf:spice_ominous", amount: [0, 1], chance: 0.8 }],
  "minecraft:zombie_villager": [{ item: "noxcrew_mf:spice_ominous", amount: [0, 1], chance: 0.8 }],
  "minecraft:zombie_villager_v2": [{ item: "noxcrew_mf:spice_ominous", amount: [0, 1], chance: 0.8 }],
  "minecraft:wither": [{ item: "noxcrew_mf:cracked_wither_skull", amount: 1, chance: 1 }],
  "minecraft:creaking": [{ item: "noxcrew_mf:creaking_bark", amount: [1, 3], chance: 1 }]
};

// config/crockpotRecipes.js
var MONSTER_FOOD_RECIPES = [
  {
    ingredients: ["minecraft:wind_charge", "minecraft:chicken", "minecraft:wheat", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:battered_breeze_balls"
  },
  {
    ingredients: ["minecraft:blaze_powder", "minecraft:cocoa_beans", "noxcrew_mf:spice_nether"],
    output: "noxcrew_mf:blaze_cocoa"
  },
  { ingredients: ["minecraft:red_mushroom", "noxcrew_mf:bogged_moss"], output: "noxcrew_mf:bogged_stew" },
  { ingredients: ["minecraft:bone_meal", "noxcrew_mf:spice_ender"], output: "noxcrew_mf:bone_shake" },
  { ingredients: ["minecraft:gunpowder", "noxcrew_mf:spice_ender"], output: "noxcrew_mf:boomstick_popsicle" },
  { ingredients: ["minecraft:rotten_flesh", "minecraft:slime_ball"], output: "noxcrew_mf:brain_juice" },
  { ingredients: ["minecraft:bone", "minecraft:rotten_flesh", "noxcrew_mf:spice_ominous"], output: "noxcrew_mf:crispy_horse_ribs" },
  {
    ingredients: [
      "minecraft:egg",
      "minecraft:sugar",
      "minecraft:wheat",
      "noxcrew_mf:evoker_fang",
      "noxcrew_mf:spice_ominous"
    ],
    output: "noxcrew_mf:crunchy_cupcake"
  },
  {
    ingredients: [
      "minecraft:bone",
      "minecraft:carrot",
      "minecraft:slime_ball",
      "noxcrew_mf:ender_dragon_haunch",
      "noxcrew_mf:spice_ender"
    ],
    output: "noxcrew_mf:dragon_hotpot"
  },
  { ingredients: ["minecraft:kelp", "minecraft:rotten_flesh"], output: "noxcrew_mf:drowned_stew" },
  {
    ingredients: ["minecraft:kelp", "noxcrew_mf:elder_guardian_eye", "noxcrew_mf:spice_nether"],
    output: "noxcrew_mf:elder_guardian_sushi"
  },
  {
    ingredients: ["minecraft:slime_ball", "noxcrew_mf:ender_shell", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:ender_emonade"
  },
  {
    ingredients: ["minecraft:ender_eye", "minecraft:slime_ball", "minecraft:sugar", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:ender_eye_skewer"
  },
  { ingredients: ["minecraft:bone", "noxcrew_mf:spice_ender"], output: "noxcrew_mf:fried_bone_chips" },
  { ingredients: ["minecraft:bone", "noxcrew_mf:spice_nether"], output: "noxcrew_mf:fried_bone_chips" },
  { ingredients: ["minecraft:bone", "noxcrew_mf:spice_ominous"], output: "noxcrew_mf:fried_bone_chips" },
  {
    ingredients: [
      "minecraft:ghast_tear",
      "minecraft:milk_bucket",
      "minecraft:sugar",
      "minecraft:wheat",
      "noxcrew_mf:spice_nether"
    ],
    output: "noxcrew_mf:ghast_cake"
  },
  { ingredients: ["minecraft:sugar", "noxcrew_mf:illager_shank"], output: "noxcrew_mf:glazed_illage_skewer" },
  {
    ingredients: ["minecraft:egg", "minecraft:rotten_flesh", "minecraft:slime_ball", "noxcrew_mf:spice_ominous"],
    output: "noxcrew_mf:green_ham_and_eggs"
  },
  { ingredients: ["minecraft:slime_ball", "noxcrew_mf:guardian_eye"], output: "noxcrew_mf:guardian_broth" },
  { ingredients: ["minecraft:kelp", "noxcrew_mf:guardian_eye"], output: "noxcrew_mf:guardian_sushi" },
  {
    ingredients: ["minecraft:slime_ball", "noxcrew_mf:hog_meat", "noxcrew_mf:spice_nether"],
    output: "noxcrew_mf:hoglin_broth"
  },
  {
    ingredients: ["minecraft:blaze_powder", "minecraft:cocoa_beans", "minecraft:wheat", "noxcrew_mf:spice_nether"],
    output: "noxcrew_mf:hot_chocolate_churro"
  },
  { ingredients: ["minecraft:bread", "noxcrew_mf:illager_shank"], output: "noxcrew_mf:illage_burger" },
  {
    ingredients: ["minecraft:blaze_powder", "minecraft:bread", "minecraft:milk_bucket", "noxcrew_mf:spice_nether"],
    output: "noxcrew_mf:magma_cream_cob"
  },
  {
    ingredients: ["minecraft:rotten_flesh", "minecraft:string", "noxcrew_mf:spice_ominous"],
    output: "noxcrew_mf:mummy_wrap"
  },
  {
    ingredients: ["minecraft:phantom_membrane", "minecraft:sugar", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:nightmare_boba_tea"
  },
  {
    ingredients: ["minecraft:bone_meal", "minecraft:sugar", "minecraft:sweet_berries", "noxcrew_mf:spice_ominous"],
    output: "noxcrew_mf:ominous_berry_pie"
  },
  { ingredients: ["minecraft:wheat", "noxcrew_mf:piglin_nose"], output: "noxcrew_mf:piglin_pizza" },
  { ingredients: ["minecraft:spider_eye", "noxcrew_mf:spice_ender"], output: "noxcrew_mf:poisoned_cream_cone" },
  { ingredients: ["noxcrew_mf:ravager_haunch", "noxcrew_mf:spice_ominous"], output: "noxcrew_mf:ravager_steak" },
  { ingredients: ["minecraft:rotten_flesh", "noxcrew_mf:spice_ender"], output: "noxcrew_mf:rotten_nosemallow" },
  { ingredients: ["minecraft:rotten_flesh", "noxcrew_mf:spice_ominous"], output: "noxcrew_mf:rotten_ribs" },
  {
    ingredients: ["minecraft:egg", "minecraft:wheat", "noxcrew_mf:shulker_goo", "noxcrew_mf:spice_ominous"],
    output: "noxcrew_mf:shulker_spaghetti"
  },
  {
    ingredients: ["minecraft:cod", "noxcrew_mf:silverfish_shell", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:silver_seafood"
  },
  {
    ingredients: ["minecraft:potato", "minecraft:slime_ball", "noxcrew_mf:spice_ominous"],
    output: "noxcrew_mf:slime_stew"
  },
  {
    ingredients: ["minecraft:sugar", "minecraft:wind_charge", "noxcrew_mf:spice_ominous"],
    output: "noxcrew_mf:soda_breeze"
  },
  {
    ingredients: [
      "minecraft:slime_ball",
      "noxcrew_mf:spice_ender",
      "noxcrew_mf:spice_nether",
      "noxcrew_mf:spice_ominous"
    ],
    output: "noxcrew_mf:soul_flask"
  },
  { ingredients: ["minecraft:slime_ball", "noxcrew_mf:spice_ominous"], output: "noxcrew_mf:soul_slorp" },
  {
    ingredients: ["minecraft:carrot", "minecraft:potato", "noxcrew_mf:ender_shell", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:stuffed_endermite"
  },
  {
    ingredients: [
      "minecraft:carrot",
      "minecraft:potato",
      "noxcrew_mf:creaking_bark",
      "noxcrew_mf:spice_ender"
    ],
    output: "noxcrew_mf:stuffed_stump"
  },
  { ingredients: ["minecraft:slime_ball", "noxcrew_mf:bogged_moss"], output: "noxcrew_mf:swamp_latte" },
  {
    ingredients: ["minecraft:bread", "minecraft:porkchop", "noxcrew_mf:spice_ender", "noxcrew_mf:vex_wing"],
    output: "noxcrew_mf:vexed_sandwich"
  },
  {
    ingredients: [
      "minecraft:egg",
      "minecraft:milk_bucket",
      "minecraft:wheat",
      "noxcrew_mf:spice_nether",
      "noxcrew_mf:warden_horn"
    ],
    output: "noxcrew_mf:warden_cake"
  },
  { ingredients: ["minecraft:string", "noxcrew_mf:spice_ender"], output: "noxcrew_mf:webbed_cream_cone" },
  {
    ingredients: ["minecraft:rotten_flesh", "minecraft:wheat", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:winter_wrap"
  },
  {
    ingredients: ["minecraft:bread", "minecraft:kelp", "noxcrew_mf:cracked_wither_skull", "noxcrew_mf:spice_ender"],
    output: "noxcrew_mf:wither_skull_sub"
  },
  {
    ingredients: ["minecraft:bread", "minecraft:porkchop", "noxcrew_mf:withered_bone", "noxcrew_mf:spice_nether"],
    output: "noxcrew_mf:withered_bonedog"
  }
];

// mobs/crockpotEvents.js
import { EntityComponentTypes as EntityComponentTypes2, ItemStack as ItemStack2, world as world22 } from "@minecraft/server";

// util/overworld.js
import { world as world21 } from "@minecraft/server";
var OVERWORLD = world21.getDimension("overworld");
var overworld_default = OVERWORLD;

// mobs/crockpotEvents.js
var __runInitializers12 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate12 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var CROCKPOT_EVENT_IDS = [
  "SlimeSpew",
  "SmokeAndBoom",
  "BurningEmber",
  "EnchantedGloop",
  "FireworkWhizzle",
  "RoaringFire",
  "BubbleTrouble",
  "FizzlingSmoke",
  "PoppingBlindness",
  "CrockpotPossessed",
  "CrockpotSpirit",
  "JumpSludge",
  "SoulFood",
  "SpiceAnt"
];
var CrockpotEvent = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupModule_decorators;
  let _activateModule_decorators;
  return _a = class CrockpotEvent extends _classSuper {
    constructor(container, parent, crockpot, eventId = CROCKPOT_EVENT_IDS[Math.floor(Math.random() * CROCKPOT_EVENT_IDS.length)]) {
      super(container);
      this.parent = (__runInitializers12(this, _instanceExtraInitializers), parent);
      this.crockpot = crockpot;
      this.eventId = eventId;
      this.dim = overworld_default;
      this.offsetLoc = { x: 0, y: 0, z: 0 };
      this.EVENT_FUNCTIONS = {
        SlimeSpew: () => this.slimeSpew(),
        SmokeAndBoom: () => this.smokeAndBoom(),
        BurningEmber: () => this.burningEmber(),
        EnchantedGloop: () => this.enchantedGloop(),
        FireworkWhizzle: () => this.genericEffect([], ["noxcrew_mf:firework_splash", "noxcrew_mf:firework_whizzle"]),
        RoaringFire: () => this.genericEffect([], ["noxcrew_mf:roar_fire", "noxcrew_mf:erupt_out"]),
        BubbleTrouble: () => this.genericEffect([], ["noxcrew_mf:bubble_trouble"]),
        FizzlingSmoke: () => this.genericEffect([], ["noxcrew_mf:fizzle_smoke"]),
        PoppingBlindness: () => this.poppingBlindness(),
        CrockpotPossessed: () => this.spawnMonster("noxcrew_mf:crockpot_possessed"),
        CrockpotSpirit: () => this.spawnMonster("noxcrew_mf:crockpot_spirit"),
        JumpSludge: () => this.spawnMonster("noxcrew_mf:jump_sludge"),
        SoulFood: () => this.spawnMonster("noxcrew_mf:soul_food"),
        SpiceAnt: () => this.spawnMonster("noxcrew_mf:spice_ant")
      };
    }
    setupModule() {
      this.listenFor(world22.afterEvents.entityDie, (e) => {
        if (e.deadEntity.id == this.crockpot.id) {
          this.parent.unregisterChild(this);
        }
      });
    }
    activateModule() {
      if (this.crockpot.isValid()) {
        this.offsetLoc = Vector3Utils.add(this.crockpot.location, VECTOR3_UP);
        this.dim = this.crockpot.dimension;
        ScopedTimer.schedule(this, 1, () => {
          this.EVENT_FUNCTIONS[this.eventId]();
        });
      } else {
        this.parent.unregisterChild(this);
      }
    }
    slimeSpew() {
      this.dim.playSound("placeholder", this.offsetLoc);
      this.dim.spawnParticle("noxcrew_mf:slime_spew", this.offsetLoc);
      for (let i = 0; i < Math.random() * 2 + 2; i++) {
        this.dim.spawnItem(new ItemStack2("minecraft:slime_ball"), this.offsetLoc);
      }
      this.parent.unregisterChild(this);
    }
    smokeAndBoom() {
      this.dim.spawnParticle("noxcrew_mf:smoke_boom", this.offsetLoc);
      ScopedTimer.schedule(this, 28, () => {
        this.dim.playSound("palceholder", this.offsetLoc);
        for (let i = 0; i < Math.random() * 2 + 2; i++) {
          this.dim.spawnItem(new ItemStack2("minecraft:coal"), this.offsetLoc);
        }
        this.parent.unregisterChild(this);
      });
    }
    burningEmber() {
      this.dim.playSound("placeholder", this.offsetLoc);
      ScopedTimer.schedule(this, 20, () => {
        this.dim.spawnParticle("noxcrew_mf:burning_ember", this.offsetLoc);
        this.dim.spawnParticle("noxcrew_mf:burning_splash", this.offsetLoc);
        for (let i = 0; i < Math.random() * 2 + 2; i++) {
          this.dim.spawnItem(new ItemStack2("minecraft:fire_charge"), this.offsetLoc);
        }
        this.parent.unregisterChild(this);
      });
    }
    enchantedGloop() {
      this.dim.playSound("placeholder", this.offsetLoc);
      ScopedTimer.schedule(this, 20, () => {
        this.dim.spawnParticle("noxcrew_mf:enchant_splash", this.offsetLoc);
        this.dim.spawnParticle("noxcrew_mf:enchanted_gloop", this.offsetLoc);
        for (let i = 0; i < Math.random() * 2 + 2; i++) {
          const entity = this.dim.spawnEntity("minecraft:xp_bottle", this.offsetLoc);
          const rot = Math.random() * 360;
          entity.applyImpulse({ x: Math.sin(rot), y: 1, z: Math.cos(rot) });
        }
        this.parent.unregisterChild(this);
      });
    }
    poppingBlindness() {
      this.dim.playSound("placeholder", this.offsetLoc);
      this.dim.spawnParticle("noxcrew_mf:pop_blind_smoke", this.offsetLoc);
      this.dim.spawnParticle("noxcrew_mf:pop_blind", this.offsetLoc);
      this.dim.getPlayers({ location: this.offsetLoc, maxDistance: 6 }).forEach((player) => {
        player.addEffect("minecraft:darkness", 5);
      });
      this.parent.unregisterChild(this);
    }
    genericEffect(sounds, particles) {
      for (const sound of sounds) {
        this.dim.playSound(sound, this.offsetLoc);
      }
      for (const particle of particles) {
        this.dim.spawnParticle(particle, this.offsetLoc);
      }
      this.parent.unregisterChild(this);
    }
    spawnMonster(monsterId) {
      const monster = this.dim.spawnEntity(monsterId, this.offsetLoc);
      if (monsterId == "noxcrew_mf:crockpot_possessed" && this.crockpot.isValid()) {
        const crockpotContainer = this.crockpot.getComponent(EntityComponentTypes2.Inventory).container;
        const monsterContainer = monster.getComponent(EntityComponentTypes2.Inventory).container;
        if (crockpotContainer != void 0 && monsterContainer != void 0) {
          for (let i = 0; i < monsterContainer.size; i++) {
            monsterContainer.setItem(i, crockpotContainer.getItem(i));
          }
          this.crockpot.remove();
        }
      }
      this.parent.unregisterChild(this);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupModule_decorators = [Hook("setup")];
    _activateModule_decorators = [Hook("activate")];
    __esDecorate12(_a, null, _setupModule_decorators, { kind: "method", name: "setupModule", static: false, private: false, access: { has: (obj) => "setupModule" in obj, get: (obj) => obj.setupModule }, metadata: _metadata }, null, _instanceExtraInitializers);
    __esDecorate12(_a, null, _activateModule_decorators, { kind: "method", name: "activateModule", static: false, private: false, access: { has: (obj) => "activateModule" in obj, get: (obj) => obj.activateModule }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a;
})();

// mobs/behavior.js
var __runInitializers13 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate13 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var MONSTER_FOOD = [
  "none",
  "noxcrew_mf:battered_breeze_balls",
  "noxcrew_mf:blaze_cocoa",
  "noxcrew_mf:bogged_stew",
  "noxcrew_mf:bone_shake",
  "noxcrew_mf:boomstick_popsicle",
  "noxcrew_mf:brain_juice",
  "noxcrew_mf:crispy_horse_ribs",
  "noxcrew_mf:crunchy_cupcake",
  "noxcrew_mf:dragon_hotpot",
  "noxcrew_mf:elder_guardian_sushi",
  "noxcrew_mf:ender_emonade",
  "noxcrew_mf:ender_eye_skewer",
  "noxcrew_mf:fried_bone_chips",
  "noxcrew_mf:ghast_cake",
  "noxcrew_mf:glazed_illage_skewer",
  "noxcrew_mf:green_ham_and_eggs",
  "noxcrew_mf:guardian_broth",
  "noxcrew_mf:guardian_sushi",
  "noxcrew_mf:hoglin_broth",
  "noxcrew_mf:hot_chocolate_churro",
  "noxcrew_mf:illage_burger",
  "noxcrew_mf:magma_cream_cob",
  "noxcrew_mf:mummy_wrap",
  "noxcrew_mf:nightmare_boba_tea",
  "noxcrew_mf:ominous_berry_pie",
  "noxcrew_mf:piglin_pizza",
  "noxcrew_mf:poisoned_cream_cone",
  "noxcrew_mf:ravager_steak",
  "noxcrew_mf:rotten_nosemallow",
  "noxcrew_mf:rotten_ribs",
  "noxcrew_mf:shulker_spaghetti",
  "noxcrew_mf:silver_seafood",
  "noxcrew_mf:slime_stew",
  "noxcrew_mf:soda_breeze",
  "noxcrew_mf:soul_flask",
  "noxcrew_mf:soul_slorp",
  "noxcrew_mf:stuffed_endermite",
  "noxcrew_mf:stuffed_stump",
  "noxcrew_mf:swamp_latte",
  "noxcrew_mf:vexed_sandwich",
  "noxcrew_mf:warden_cake",
  "noxcrew_mf:webbed_cream_cone",
  "noxcrew_mf:winter_wrap",
  "noxcrew_mf:wither_skull_sub",
  "noxcrew_mf:withered_bonedog",
  "noxcrew_mf:drowned_stew"
];
var MonsterFoodMobBehavior = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupModule_decorators;
  return _a = class MonsterFoodMobBehavior extends _classSuper {
    constructor() {
      super(...arguments);
      this.MONSTER_FOOD_RECIPES = (__runInitializers13(this, _instanceExtraInitializers), /* @__PURE__ */ new Map());
    }
    setupModule() {
      for (const recipe of MONSTER_FOOD_RECIPES) {
        this.MONSTER_FOOD_RECIPES.set(recipe.ingredients.sort((a, b) => a.localeCompare(b)).join(""), recipe.output);
      }
      this.listenFor(world23.beforeEvents.entityRemove, (e) => {
        const dimension = e.removedEntity.dimension;
        const location = e.removedEntity.location;
        if (e.removedEntity.typeId === "minecraft:item")
          return;
        ScopedTimer.schedule(this, 1, (cancel) => {
          if (dimension.getBlock(location) === void 0)
            return cancel();
          if (e.removedEntity.typeId in MOB_DROPS) {
            const drops = MOB_DROPS[e.removedEntity.typeId];
            for (const drop of drops) {
              if (drop.chance > Math.random()) {
                const [min, max] = Array.isArray(drop.amount) ? drop.amount : [drop.amount, drop.amount];
                const amount = Math.floor(Math.random() * (max - min + 1)) + min;
                for (let i = 0; i < amount; i++) {
                  dimension.spawnItem(new ItemStack3(drop.item, 1), location);
                }
              }
            }
          }
          cancel();
        }, true);
      });
      this.listenFor(world23.afterEvents.entityDie, (e) => {
        if (!e.deadEntity.isValid())
          return;
        const dimension = e.deadEntity.dimension;
        const location = e.deadEntity.location;
        if (dimension.getBlock(location) === void 0)
          return;
        if (e.deadEntity.typeId == "noxcrew_mf:crockpot_possessed") {
          _a.dropInventory(e.deadEntity);
          dimension.spawnItem(new ItemStack3("noxcrew_mf:crockpot_spawn_egg", 1), location);
        }
        if (e.deadEntity.typeId == "noxcrew_mf:crockpot") {
          dimension.spawnItem(new ItemStack3("noxcrew_mf:crockpot_spawn_egg", 1), location);
        }
      });
      this.listenFor(system8.afterEvents.scriptEventReceive, (e) => {
        if (!e.id.startsWith(prefix_default))
          return;
        switch (e.id) {
          case "noxcrew_mf:crockpot_spirit_explode":
            if (e.sourceEntity?.typeId != "noxcrew_mf:crockpot_spirit")
              return;
            _a.explodeSpirit(e.sourceEntity);
            break;
          case "noxcrew_mf:jump_sludge_knockback":
            if (e.sourceEntity?.typeId != "noxcrew_mf:jump_sludge")
              return;
            _a.explodeSludge(e.sourceEntity);
            break;
          case "noxcrew_mf:crockpot_cook":
            if (e.sourceEntity?.typeId != "noxcrew_mf:crockpot")
              return;
            this.cookFood(e.sourceEntity);
            const OFFSETS = stringToVector3(["0 0 0", "1 0 0", "-1 0 0", "0 0 1", "0 0 -1"]);
            for (const offset of OFFSETS) {
              const newCoord = Vector3Utils.add(e.sourceEntity.location, offset);
              const block = e.sourceEntity.dimension.getBlock(newCoord);
              if (block?.typeId !== "minecraft:snow_layer")
                continue;
              block.setType("minecraft:air");
            }
            break;
          case "noxcrew_mf:spawn_crockpot_event":
            if (e.sourceEntity?.typeId != "noxcrew_mf:crockpot")
              return;
            this.spawnCrockpotEvent(e.sourceEntity);
            break;
          case "noxcrew_mf:take_crockpot_food":
            if (e.sourceEntity?.typeId != "noxcrew_mf:crockpot")
              return;
            const players = e.sourceEntity.dimension.getPlayers({
              tags: [_a.CROCKPOT_TAKE_FOOD_TAG]
            });
            if (players.length <= 0)
              return;
            this.takeFood(players[0], e.sourceEntity);
            break;
        }
      });
    }
    static explodeSpirit(entity) {
      const rot = (entity.getRotation().y + 90) * (Math.PI / 180);
      entity.dimension.getPlayers({
        location: entity.location,
        maxDistance: 5
      }).forEach((player) => {
        player.applyKnockback(Math.cos(rot), Math.sin(rot), 5, 1);
        player.applyDamage(Math.floor(Math.random() * 5) + 2);
      });
      entity.dimension.spawnParticle("noxcrew_mf:crockpot_spirit_explode", entity.location);
      entity.dimension.playSound("random.explode", entity.location);
      if (entity.isValid()) {
        entity.remove();
      }
    }
    static explodeSludge(entity) {
      const rot = (entity.getRotation().y + 90) * (Math.PI / 180);
      entity.dimension.getPlayers({
        location: entity.location,
        maxDistance: 10
      }).forEach((player) => {
        player.applyKnockback(Math.cos(rot), Math.sin(rot), 5, 1);
        player.addEffect("minecraft:blindness", 5 * TicksPerSecond6);
      });
    }
    static dropInventory(entity) {
      const inv = entity.getComponent(EntityComponentTypes3.Inventory);
      if (inv == void 0)
        return;
      const container = inv.container;
      if (container == void 0)
        return;
      for (let i = 0; i < container.size; i++) {
        const item = container.getItem(i);
        if (item == void 0)
          continue;
        entity.dimension.spawnItem(item, entity.location);
      }
    }
    cookFood(crockpot) {
      const inv = crockpot.getComponent(EntityComponentTypes3.Inventory);
      if (inv == void 0)
        return;
      const container = inv.container;
      if (container == void 0)
        return;
      const items = [];
      for (let i = 0; i < container.size; i++) {
        const item = container.getItem(i)?.typeId;
        if (item == void 0 || items.includes(item))
          continue;
        items.push(item);
      }
      const output = this.MONSTER_FOOD_RECIPES.get(items.sort((a, b) => a.localeCompare(b)).join(""));
      if (output == void 0) {
        crockpot.setProperty("noxcrew_mf:has_event", "monsters");
        crockpot.setProperty("noxcrew_mf:food", MONSTER_FOOD.findIndex((food) => food == output));
        const filled_slots = [];
        let amount = 0;
        for (let i = 0; i < container.size; i++) {
          if (container.getItem(i) != void 0) {
            const slot = container.getSlot(i);
            filled_slots.push(slot);
            amount += slot.amount;
          }
        }
        amount = Math.floor(amount * 0.25);
        for (let i = 0; i < amount; i++) {
          const index = Math.floor(Math.random() * filled_slots.length);
          const slot = filled_slots[index];
          if (slot.amount <= 1) {
            slot.setItem();
            filled_slots.splice(index, 1);
          } else {
            slot.amount--;
          }
        }
      } else {
        if (Math.random() < 0.15) {
          crockpot.setProperty("noxcrew_mf:has_event", "effect");
        }
        crockpot.setProperty("noxcrew_mf:food", MONSTER_FOOD.findIndex((food) => food == output));
        for (let i = 0; i < container.size; i++) {
          const slot = container.getSlot(i);
          const item = slot.getItem();
          if (item != void 0 && items.includes(item.typeId)) {
            if (slot.amount <= 1) {
              slot.setItem(item.typeId == "minecraft:milk_bucket" ? new ItemStack3("minecraft:bucket") : void 0);
            } else {
              slot.amount--;
            }
            items.splice(items.indexOf(item.typeId), 1);
          }
        }
      }
    }
    spawnCrockpotEvent(crockpot) {
      const eventType = crockpot.getProperty("noxcrew_mf:has_event") ?? "none";
      if (eventType == "effect") {
        this.registerChild(new CrockpotEvent(this.container, this, crockpot, CROCKPOT_EVENT_IDS[Math.floor(Math.random() * 9)]));
      } else {
        this.registerChild(new CrockpotEvent(this.container, this, crockpot));
      }
    }
    takeFood(player, crockpot) {
      player.removeTag(_a.CROCKPOT_TAKE_FOOD_TAG);
      const foodIndex = crockpot.getProperty("noxcrew_mf:food") ?? 0;
      if (foodIndex <= 0)
        return;
      const inv = player.getComponent(EntityComponentTypes3.Inventory);
      if (inv == void 0)
        return;
      const container = inv.container;
      if (container == void 0)
        return;
      if (container.emptySlotsCount > 0) {
        container.addItem(new ItemStack3(MONSTER_FOOD[foodIndex], 1));
      } else {
        player.dimension.spawnItem(new ItemStack3(MONSTER_FOOD[foodIndex], 1), player.location);
      }
      crockpot.setProperty("noxcrew_mf:food", 0);
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupModule_decorators = [Hook("setup")];
    __esDecorate13(_a, null, _setupModule_decorators, { kind: "method", name: "setupModule", static: false, private: false, access: { has: (obj) => "setupModule" in obj, get: (obj) => obj.setupModule }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a.CROCKPOT_TAKE_FOOD_TAG = "taking_crockpot_food", _a;
})();

// tutorial.js
import { EntityComponentTypes as EntityComponentTypes4, Player as Player4, system as system9, world as world24 } from "@minecraft/server";
import { ActionFormData } from "@minecraft/server-ui";
var __runInitializers14 = function(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};
var __esDecorate14 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function(f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.unshift(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.unshift(_);
      else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};
var QUEST_STAGES = {
  0: { check: "item_check", args: ["noxcrew_mf:crafting_guide_1_spawn_egg"] },
  1: { check: "item_check", args: ["noxcrew_mf:crockpot_spawn_egg"] },
  2: { check: "item_check", args: ["noxcrew_mf:rotten_ribs", "noxcrew_mf:brain_juice"] },
  3: { check: "item_check", args: ["noxcrew_mf:crafting_guide_4_spawn_egg"] },
  4: { check: "item_check", args: ["noxcrew_mf:crafting_guide_2_spawn_egg"] },
  5: { check: "item_check", args: ["noxcrew_mf:crafting_guide_3_spawn_egg"] }
};
var MFQuestSystem = (() => {
  var _a;
  let _classSuper = Module;
  let _instanceExtraInitializers = [];
  let _setupModule_decorators;
  return _a = class MFQuestSystem extends _classSuper {
    constructor() {
      super(...arguments);
      this.QUEST_CHECK_ACTION = (__runInitializers14(this, _instanceExtraInitializers), {
        item_check: (player, args) => this.lookForItems(player, args)
      });
    }
    setupModule() {
      this.listenFor(system9.afterEvents.scriptEventReceive, (e) => {
        if (!e.id.startsWith(prefix_default))
          return;
        const playerStage = e.initiator?.getDynamicProperty(_a.QUEST_STAGE) ?? 0;
        if (e.initiator instanceof Player4) {
          switch (e.id) {
            case "noxcrew_mf:quest_guide":
              if (e.sourceEntity?.typeId != "noxcrew_mf:guide")
                return;
              e.sourceEntity.runCommandAsync(`dialogue open @s "${e.initiator?.name}" noxcrew_mf:guide_quest.6.${playerStage}`);
              break;
            case "noxcrew_mf:quest_progress":
              const questInfo = QUEST_STAGES[playerStage];
              if (this.QUEST_CHECK_ACTION[questInfo.check](e.initiator, questInfo.args)) {
                this.completeStage(e.initiator, playerStage);
              } else {
                this.failedStage(e.initiator);
              }
              break;
          }
        }
      });
    }
    failedStage(player) {
      player.sendMessage({ translate: "noxcrew_mf:txt.npc_guide.fail" });
    }
    completeStage(player, stage) {
      player.sendMessage({ translate: "noxcrew_mf:txt.npc_guide.complete" });
      player.setDynamicProperty(_a.QUEST_STAGE, stage + 1);
    }
    lookForItems(player, args) {
      const itemNames = args;
      const container = player.getComponent(EntityComponentTypes4.Inventory).container;
      if (!container || itemNames.length == 0) {
        return false;
      }
      for (const itemName of itemNames) {
        for (let i = 0; i < container.size; i++) {
          if (container.getItem(i)?.typeId !== itemName)
            continue;
          return true;
        }
      }
      return false;
    }
  }, (() => {
    const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
    _setupModule_decorators = [Hook("setup")];
    __esDecorate14(_a, null, _setupModule_decorators, { kind: "method", name: "setupModule", static: false, private: false, access: { has: (obj) => "setupModule" in obj, get: (obj) => obj.setupModule }, metadata: _metadata }, null, _instanceExtraInitializers);
    if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  })(), _a.QUEST_STAGE = property("noxcrew_mf:quest_stage"), _a;
})();
var GuideBook = class _GuideBook extends Module {
  setup() {
    this.listenFor(world24.afterEvents.itemUse, (e) => {
      if (e.itemStack.typeId != _GuideBook.BOOK_ITEM_ID)
        return;
      _GuideBook.openActionForm(e.source, _GuideBook.PAGES.LandingPage);
    });
  }
  static async openActionForm(player, form) {
    player.playSound(_GuideBook.UI_OPEN_SOUND);
    const page = new ActionFormData().title(form.title).body(form.body);
    for (const button of form.buttons) {
      page.button(button.text, button.icon);
    }
    const response = await page.show(player);
    if (response.canceled || response.selection == null) {
      player.playSound(_GuideBook.UI_CLOSE_SOUND);
      return;
    }
    form.buttons[response.selection].action(player);
  }
  static spawnGuide(player) {
    if (player.dimension.getBlock(player.location) === void 0)
      return;
    player.dimension.spawnEntity("noxcrew_mf:guide", player.location);
  }
};
GuideBook.BOOK_ITEM_ID = "noxcrew_mf:guide_addon";
GuideBook.UI_OPEN_SOUND = "noxcrew_mf:guide_open";
GuideBook.UI_CLOSE_SOUND = "noxcrew_mf:guide_close";
GuideBook.CROCKPOT_TEXT = {
  rawtext: [
    { translate: "noxcrew_mf:user_guide.page_1.001", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.002", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.003", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.004", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.005", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.006", with: ["\n"] },
    { text: "\xA7r\n\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.007", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.008", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.009", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.010", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.011", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.012", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.013", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.014", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_1.015", with: ["\n"] },
    { text: "\xA7r\n\n" }
  ]
};
GuideBook.MONSTERFOOD_TEXT = {
  rawtext: [
    { translate: "noxcrew_mf:user_guide.page_2.001", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.002", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.003", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.004", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.005", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.006", with: ["\n"] },
    { text: "\xA7r\n\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.007", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.008", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.009", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.010", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.011", with: ["\n"] },
    { text: "\xA7r\n\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.012", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.013", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.014", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.015", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.016", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.017", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.018", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.019", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.020", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.021", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.022", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.023", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.024", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.025", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.026", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.027", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.028", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.029", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.030", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.031", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.032", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.033", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.034", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.035", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.036", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.037", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.038", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.039", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.040", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_2.041", with: ["\n"] },
    { text: "\xA7r\n\n" }
  ]
};
GuideBook.POWERSCURSES_TEXT = {
  rawtext: [
    { translate: "noxcrew_mf:user_guide.page_3.001", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.002", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.003", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.004", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.005", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.006", with: ["\n"] },
    { text: "\xA7r\n\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.007", with: ["\n"] },
    { text: "\xA7r\n\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.008", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.009", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.010", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.011", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.012", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.013", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.014", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.015", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.016", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.017", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.018", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.019", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.020", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.021", with: ["\n"] },
    { text: "\xA7r\n\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.022", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.023", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.024", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.025", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.026", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.027", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.028", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.029", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.030", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.031", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.032", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.033", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.034", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.035", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_3.036", with: ["\n"] },
    { text: "\xA7r\n\n" }
  ]
};
GuideBook.PLATINGFOOD_TEXT = {
  rawtext: [
    { translate: "noxcrew_mf:user_guide.page_4.001", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_4.002", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_4.003", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.page_4.004", with: ["\n"] },
    { text: "\xA7r\n\n" }
  ]
};
GuideBook.CREDITS_TEXT = {
  rawtext: [
    { translate: "noxcrew_mf:user_guide.credits.001", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.002", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.003", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.004", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.005", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.006", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.007", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.008", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.009", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.010", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.011", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.012", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.013", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.014", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.015", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.016", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.017", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.018", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.019", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.020", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.021", with: ["\n"] },
    { text: "\xA7r\n\n" },
    { translate: "noxcrew_mf:user_guide.credits.022", with: ["\n"] },
    { text: "\xA7r\n\n" }
  ]
};
GuideBook.PAGES = {
  LandingPage: {
    title: { translate: "noxcrew_mf:txt.user_guide.title.monster_food" },
    body: { translate: "noxcrew_mf:user_guide.landing", with: ["\n"] },
    buttons: [
      {
        text: { translate: "noxcrew_mf:txt.user_guide.button.spawn_guide" },
        icon: "",
        action: (player) => GuideBook.spawnGuide(player)
      },
      {
        text: { translate: "noxcrew_mf:txt.user_guide.button.crockpot" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.Crockpot)
      },
      {
        text: { translate: "noxcrew_mf:txt.user_guide.button.monster_food" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.Monster_Food)
      },
      {
        text: { translate: "noxcrew_mf:txt.user_guide.button.power_curse" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.Power_Curse)
      },
      {
        text: { translate: "noxcrew_mf:txt.user_guide.button.plating_food" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.Plating_Food)
      },
      {
        text: { translate: "noxcrew_mf:txt.user_guide.button.credits" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.Credits)
      }
    ]
  },
  Crockpot: {
    title: { translate: "noxcrew_mf:txt.user_guide.title.crockpot" },
    body: GuideBook.CROCKPOT_TEXT,
    buttons: [
      {
        text: { translate: "noxcrew_mf:txt.button.back" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.LandingPage)
      }
    ]
  },
  Monster_Food: {
    title: { translate: "noxcrew_mf:txt.user_guide.title.monster_food" },
    body: GuideBook.MONSTERFOOD_TEXT,
    buttons: [
      {
        text: { translate: "noxcrew_mf:txt.button.back" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.LandingPage)
      }
    ]
  },
  Power_Curse: {
    title: { translate: "noxcrew_mf:txt.user_guide.title.power_curse" },
    body: GuideBook.POWERSCURSES_TEXT,
    buttons: [
      {
        text: { translate: "noxcrew_mf:txt.button.back" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.LandingPage)
      }
    ]
  },
  Plating_Food: {
    title: { translate: "noxcrew_mf:txt.user_guide.title.plating_food" },
    body: GuideBook.PLATINGFOOD_TEXT,
    buttons: [
      {
        text: { translate: "noxcrew_mf:txt.button.back" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.LandingPage)
      }
    ]
  },
  Credits: {
    title: { translate: "noxcrew_mf:txt.user_guide.title.credits" },
    body: GuideBook.CREDITS_TEXT,
    buttons: [
      {
        text: { translate: "noxcrew_mf:txt.button.back" },
        icon: "",
        action: (player) => GuideBook.openActionForm(player, GuideBook.PAGES.LandingPage)
      }
    ]
  }
};

// main.js
function main() {
  this.register(new InitializeAddon(this));
  this.register(new MFQuestSystem(this));
  this.register(new GuideBook(this));
  this.register(new EffectsManager(this));
  this.register(new MonsterFoodMobBehavior(this));
}
Entrypoint.launch(main);
//! STOLE FROM MOJANG REPLACE WHEN WE IMPLEMENT THIS OURSELVES
//! FIXME [Lyfeless]: Adjust this system to use world properties rather than scoreboard
