xoxocraftNeoForge

XoxoCraft is a NeoForge Minecraft mod that integrates Twitch chat with interactive in-game commands and viewer-driven events

File Details

XoxoCraft 2.0.0

  • R
  • Jul 15, 2026
  • 1016.14 KB
  • 3
  • 1.21.1
  • NeoForge

File Name

xoxocraft-2.0.0.jar

Supported Versions

  • 1.21.1

Curse Maven Snippet

NeoForge

implementation "curse.maven:xoxocraftneoforge-1551925:8437089"

Learn more about Curse Maven

What's New

  • KubeJS integration — scriptable Twitch commands! KubeJS is now a required dependency (the CurseForge app installs it automatically, Rhino included): streamers can define brand-new !commands in JavaScript without touching the mod: drop a script in kubejs/server_scripts/ and call XoxoCraft.registerCommand('name', cooldownSec, ctx => { ... }). Scripted commands inherit the full command pipeline for free: per-command cooldown, ≥50-bits bypass, Chaos Mode halving, per-user cooldown and the !skip charge system. The ctx object ships ready-made helpers (players(), effectAll, giveAll, healAll, damageAll, broadcast, twitch, actionbar, log) plus raw server access, and supports player targeting (!cmd playername). /kubejs reload server_scripts hot-reloads command definitions. The mod keeps working exactly as before when KubeJS is not installed.

  • Lap-colored hearts — when max health exceeds 10 hearts, the stacked vanilla heart rows are replaced by a single color-coded row: hearts 1–10 vanilla red, 11–20 orange, 21–30 yellow, 31–40 purple (visual cap at 40 hearts / 80 HP). The current lap draws over the previous lap's color. The colored hearts are pixel-identical to vanilla — including the little white shine — thanks to a two-layer sprite technique (tintable body + untinted highlight). With max health at 10 hearts or below, vanilla rendering is untouched.

  • Scriptable XP bar color — scripts can recolor the player's XP bar: XoxoCraft.setXpBarColor(player, '#FFD800') / resetXpBarColor(player). The client redraws the filled portion of the bar in the given color (per-player, packet-synced, deduplicated). Used by the bundled daily-XP-limit example to turn the bar yellow when the daily cap is reached.

  • Bundled default scripts — when KubeJS is installed, the mod extracts its official scripts into kubejs/server_scripts/ on first launch: xoxocraft_esempi.js (sample commands !boost, !merenda, !brivido), limite_exp.js (daily XP cap with per-level progression and yellow bar at the cap) and no_spawn_vanilla.js (disables natural hostile mob spawning — mobs come only from chat commands and mod events; spawners, breeding and eggs keep working). Both gameplay scripts are enabled by default and can be toggled off in-game. Existing files are never overwritten, so your edits survive mod updates. No runtime downloads — everything ships inside the jar (CurseForge-policy friendly).

  • Balanced Diet script (dieta.js) — every food fills one or more of 5 diet stats (🍖 protein, 🌾 grains, 🍎 fruit, 🥕 vegetables, 🍬 sugars, 0–100%), which slowly decay over play time. On your very first join you start with a perfect 100% diet — keeping it up is on you. Keep ALL stats above 60% for Speed + Haste, above 85% for Regeneration + Resistance too (the latter unlock at XP level 2+). Let even a single stat drop below 40% and you get a malus: -2 max hearts and Slowness until you fix your diet (scripts can now apply max-health modifiers via XoxoCraft.setMaxHealthModifier — transient, self-cleaning on relog). Food tiers = XP level: 33 foods across 6 tiers (level 0–5) — foods above your XP level cannot be eaten at all (bite cancelled with an actionbar notice; raw basics at level 0, cooked food from level 1–2, golden apples at 4+). Food gating is suspended inside mod event dimensions so event kits keep working. Eating shows a color-coded summary in chat; Twitch chat can check the streamer's diet with !dieta. Food tooltips show each food's diet values and tier, with a live green check / red lock line based on your current XP level (scripts register tooltip info via XoxoCraft.registerFoodTooltip). A 🍽 button in the inventory screen opens a live diet panel: color-coded bars for the 5 stats with the bonus threshold marker, current bonus status and XP level (scripts publish data via XoxoCraft.setDietDisplay). Food table, tiers and thresholds are fully editable in the script.

  • Bitter Death script (morte_amara.js) — every death drains 5% from all diet stats: you respawn "weakened" and closer to the diet malus. Configurable percentage.

  • Daily Login script (login_giornaliero.js) — the first time you play each real day you get a base reward, and consecutive days build a streak with milestone rewards (3/7/14/30 days: iron → diamonds → netherite). Skipping a day resets the streak. Works retroactively if you're already in the world at midnight.

  • In-game script toggles — Options → XoxoCraft options → 📜 KubeJS Scripts: every bundled script declares an on/off switch (XoxoCraft.registerFlag(id, default, label) + XoxoCraft.isEnabled(id) — also available to your own scripts). Toggle, hit "Save and reload scripts" and the change applies instantly (values persisted in config/xoxocraft_script_flags.properties; saving also re-runs /kubejs reload server_scripts).

Changes

  • NeoForge minimum raised to 21.1.199 (project now builds against 21.1.235) — required by KubeJS 2101.7.2. Update your NeoForge if you're on an older 21.1.x.

Technical Changes

  • HUD recoloring recipe (hearts + XP bar): cancel/append on the specific RenderGuiLayerEvent layer (PLAYER_HEALTH Pre with leftHeight compensation, EXPERIENCE_BAR Post) — the generic RenderGuiEvent.Post cannot draw over the XP bar. Each vanilla sprite is split into *_white.png (dominant-channel grayscale, tinted via GuiGraphics.setColor — luminance-based grayscale turns saturated red into brown) and *_glare.png (only the truly whitish pixels, min(R,G,B) > 100, drawn untinted) so highlights stay white under any tint.
  • XpBarColorPacket (server→client, int ARGB, 0 = vanilla) with per-player dedupe (ScriptedCommands.xpBarLastSent, cleared on login) — scripts can call setXpBarColor every tick without network spam.
  • extractBundledKubeJSScripts() (same pattern as extractBundledImages): resources from assets/xoxocraft/kubejs_scripts/, guarded by ModList.isLoaded("kubejs"), copy-if-absent into FMLPaths.GAMEDIR/kubejs/server_scripts/.
  • New ScriptedCommands (KubeJS-free registry + IRC→tick queue + Context helpers + Api binding) and com.xoxocraft.kubejs.XoxoCraftKubeJSPlugin (the only class importing KubeJS, loaded via kubejs.plugins.txt only when KubeJS is present). Scripted cooldowns are injected into TwitchIRCClient.COOLDOWNS at registration and removed on script reload (beforeScriptsLoaded); native command names cannot be overridden.
  • Both dispatch switches (handleMessage, executeScheduledCommand) fall through to ScriptedCommands.tryQueue in their default branch; handlers run on the server thread via ScriptedCommands.tick (called from tickNewCommands2).
  • Build: compileOnly dev.latvian.mods:kubejs-neoforge:2101.7.2-build.368 (maven.latvian.dev); kubejs declared as optional dependency in neoforge.mods.toml.