Перейти к содержимому

Math Function

Позволяет построить график функции с помощью команды или зачарования

NeoForge
Загрузчики
NeoForge
Скачиваний на Modrinth
442
Подписчиков на Modrinth
4
версий
13
Обновлён
7 августа 20267 авг.
Опубликован
в 2026
2.10Релиз7 августа 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.10 版本更新 - 三维空间轨迹支持:

  • 新增三维函数轨迹支持!现在可以使用 y=表达式;z=表达式 格式为弹射物定义三维空间中的立体轨迹,让箭矢、TNT 和烟花火箭在飞行时同时沿 Y 轴(高度)和 Z 轴(水平偏移)变化,实现螺旋线、波浪线等炫酷的立体弹道!
  • 支持纯 Z 轴轨迹:使用 z=表达式 格式可以单独定义水平偏移,Y 轴保持为 0(即贴地飞行)。
  • 向后兼容:原有的 y=表达式 和 f(x)=表达式 格式继续有效,旧存档和命名不受影响。
  • 解析器新增对 y=...;z=... 双表达式格式的识别,自动检测并启用三维轨迹模式。
  • 三维轨迹的起始点会自动寻找有效的起始 x 值,避免因表达式在 x=0 处无效而无法发射的问题。
  • 所有弹射物类型(箭矢、TNT、烟花火箭)均支持三维轨迹,激发更多创意玩法!

【English Changelog】

Version 2.10 - 3D trajectory support:

  • Added 3D function trajectory support! Use the y=expression;z=expression format to define立体 trajectories for projectiles, allowing arrows, TNT, and fireworks to change in both Y-axis (height) and Z-axis (horizontal offset) simultaneously – create stunning spiral patterns, wave paths, and more!
  • Support for Z-axis only: use z=expression format to define horizontal offset independently, with Y fixed at 0 (ground-level flight).
  • Backward compatible: existing y=expression and f(x)=expression formats continue to work – old saves and renames are unaffected.
  • Parser now recognizes the y=...;z=... dual-expression format and automatically enables 3D trajectory mode.
  • 3D trajectories automatically find valid starting x values, preventing launch failures when expressions are invalid at x=0.
  • All projectile types (arrows, TNT, fireworks) support 3D trajectories – unlock even more creative possibilities!
2.9Релиз10 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.9 版本更新 - 递归调用安全防护:

  • 修复了自定义函数互相调用或自身调用自身时导致的栈溢出崩溃漏洞(StackOverflowError),该问题曾导致服务器崩溃甚至存档损坏。
  • 新增递归调用检测机制,当检测到函数存在直接或间接的循环调用时,会抛出友好的“循环调用”错误提示,而非崩溃。
  • 设定了最大递归深度限制(64 层),防止意外深度递归导致性能问题。
  • 现在你可以安全地定义和测试自定义函数,即使不小心写出了递归调用,游戏也会优雅地给出错误提示而不会崩溃。

【English Changelog】

Version 2.9 - Recursive call protection:

  • Fixed a critical crash vulnerability where custom functions calling themselves or mutually referencing each other would cause StackOverflowError, potentially crashing the server or corrupting saves.
  • Added recursive call detection mechanism that throws a friendly "circular call" error when direct or indirect recursion is detected, instead of crashing.
  • Implemented a maximum recursion depth limit (64 layers) to prevent performance issues from accidental deep recursion.
  • You can now safely define and test custom functions – even if you accidentally write recursive calls, the game will gracefully display an error message instead of crashing.
2.8.1Бета9 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.8.1 版本更新 - 本地化修复:

  • 修复了 2.8 版本中自定义函数命令缺少本地化翻译键的问题,现在所有命令反馈信息均正确支持中英文显示。

【English Changelog】

Version 2.8.1 - Localization fix:

  • Fixed missing localization keys for custom function commands introduced in 2.8; all command feedback messages now properly support both English and Chinese.
2.8Альфа9 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.8 版本更新 - 自定义函数系统:

  • 新增自定义函数功能!现在你可以使用 /customfunction 命令创建、存储和调用自己的数学函数,让复杂的表达式复用变得轻而易举。
  • 添加自定义函数:/customfunction add <函数名> <表达式> — 例如 /customfunction add square x^2,之后就可以直接使用 square(3) 来计算 9!
  • 查看已定义的函数:/customfunction list 列出所有已保存的自定义函数。
  • 获取函数表达式:/customfunction get <函数名> 查看某个函数的定义。
  • 计算函数值:/customfunction eval <函数名> <x值> 快速计算函数在指定 x 处的值。
  • 修改已有函数:/customfunction modify <函数名> <新表达式> 更新函数定义。
  • 删除函数:/customfunction remove <函数名> 移除不再需要的函数。
  • 一键清空所有自定义函数:/customfunction remove-all(需要管理员权限)。
  • 自定义函数支持相互引用和嵌套调用,例如可以定义 f1(x)=x^2 和 g(x)=sin(f1(x))。
  • 自定义函数会自动保存在 custom_functions.json 文件中,重启游戏后依然保留。
  • 自定义函数名称不能与内置函数(如 sin、sqrt、log 等)或数学常数(e、pi)冲突,确保安全。同时 f 作为保留名称也不可用,以避免与 f(x)= 前缀冲突。
  • 所有自定义函数均可在 /fx 命令和函数附魔轨迹命名中使用,极大简化复杂表达式的输入。

【English Changelog】

Version 2.8 - Custom function system:

  • Added custom function support! Now you can use the /customfunction command to create, store, and call your own math functions, making complex expression reuse effortless.
  • Add a custom function: `/customfunction add — e.g./customfunction add square x^2, then use square(3)` to compute 9!
  • List all defined functions: /customfunction list shows all saved custom functions.
  • Get a function expression: `/customfunction get ` displays the definition of a function.
  • Evaluate a function: `/customfunction eval <x_value>` quickly computes the function value at a given x.
  • Modify an existing function: `/customfunction modify <new_expression>` updates the function definition.
  • Remove a function: `/customfunction remove ` deletes an unwanted function.
  • Clear all custom functions at once: /customfunction remove-all (requires operator permissions).
  • Custom functions support mutual references and nested calls, e.g. define f1(x)=x^2 and g(x)=sin(f1(x)).
  • Custom functions are automatically saved to custom_functions.json and persist across game restarts.
  • Custom function names cannot conflict with built-in functions (such as sin, sqrt, log, etc.) or math constants (e, pi), ensuring safety. The name f is also reserved to avoid conflicts with the f(x)= prefix.
  • All custom functions can be used in /fx commands and function enchantment trajectory naming, greatly simplifying the input of complex expressions.
2.7Бета9 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.7 版本更新 - 表达式解析器大幅增强:

  • 新增数学常数支持:现在可以直接在表达式中使用 e(自然常数)和 pi(圆周率),例如 sin(pi/2) 或 e^x。
  • 新增一元负号支持:现在可以书写 -x^2、-sin(x) 等表达式,解析器会正确处理负号。
  • 新增实用数学函数:floor(向下取整)、ceil(向上取整)、round(四舍五入)、trunc(截断小数)、mod(取模,例如 mod(x, 3))、min(最小值,例如 min(x, 5))、max(最大值,例如 max(x, -1))。
  • 新增随机数函数:Ran# 生成 0~1 之间的随机小数,RanInt(min, max) 生成指定范围内的随机整数!
  • 重要修复:修复了使用含参函数(如 sin、sqrt、log 等)时,若参数数量填写不正确(例如未填写参数或填写了多余参数)会导致游戏崩溃并损坏存档的严重问题。现在解析器会正确校验参数数量,表达式不合规时会给出清晰提示而不会引发崩溃。
  • 表达式解析器更加强大且安全可靠,为函数图像和附魔轨迹带来更多的创作可能性。

【English Changelog】

Version 2.7 - Expression parser major enhancement:

  • Added mathematical constants: now you can use e (Euler's number) and pi directly in expressions, e.g. sin(pi/2) or e^x.
  • Added unary minus support: now you can write expressions like -x^2 or -sin(x) – the parser handles negative signs correctly.
  • Added practical math functions: floor (round down), ceil (round up), round (round to nearest), trunc (truncate decimals), mod (modulo, e.g. mod(x, 3)), min (minimum, e.g. min(x, 5)), max (maximum, e.g. max(x, -1)).
  • Added random number functions: Ran# generates a random decimal between 0 and 1, RanInt(min, max) generates a random integer within the specified range!
  • Critical fix: Fixed a severe bug where using parameterized functions (such as sin, sqrt, log, etc.) with incorrect argument counts (e.g., missing parameters or extra parameters) would crash the game and corrupt the save. The parser now properly validates argument counts and provides clear feedback for malformed expressions instead of crashing.
  • The expression parser is now more powerful, robust, and safer, unlocking even more creative possibilities for function graphs and enchantment trajectories.
2.6Бета8 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.6 版本更新 - 表达式解析器升级:

  • 重写了数学表达式解析器,现在支持更丰富的函数和更灵活的语法。
  • 新增函数支持:abs(绝对值)、exp(自然指数,#1)、带任意底数的 log(base, value)(例如 log(2, 8) 计算以 2 为底 8 的对数)、以及 sqrt(root, value)(求任意次方根,如 sqrt(3, 64) 计算 64 的 3 次方根)。
  • 支持 logN 简写形式,例如 log2 表示以 2 为底的对数,log10 表示常用对数。
  • 解析器更加健壮,能够正确处理函数嵌套和复杂表达式。
  • 所有函数附魔和命令功能均使用新解析器,计算更准确,支持更广泛的数学表达式。

【English Changelog】

Version 2.6 - Expression parser upgrade:

  • Rewrote the mathematical expression parser with support for more functions and flexible syntax.
  • New functions added: abs (absolute value), exp (natural exponential, #1), log(base, value) for arbitrary base logarithms (e.g. log(2, 8) computes log base 2 of 8), and sqrt(root, value) for arbitrary roots (e.g. sqrt(3, 64) computes the cube root of 64).
  • Supports shorthand logN notation, e.g. log2 for base-2 logarithm, log10 for common logarithm.
  • Parser is now more robust, correctly handling nested functions and complex expressions.
  • All function enchantments and command features utilize the new parser for more accurate calculations and broader mathematical expression support.
2.5Бета7 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.5 版本更新 - 铁砧改名零经验消耗:

  • 现在在铁砧中为物品重命名为 f(x)=表达式 或 y=表达式 格式时,经验消耗将直接归零!你可以免费为任意兼容物品赋予函数轨迹,无需消耗等级经验。
  • 将附有“数学函数”附魔的附魔书放入铁砧的附加槽中,经验消耗同样归零,方便你自由转移附魔。
  • 重命名时,只要名称中包含有效的数学表达式(以 y= 或 f(x)= 开头),系统便会自动识别并免除经验费用。

【English Changelog】

Version 2.5 - Zero anvil cost for function naming:

  • Renaming an item to f(x)=expression or y=expression format in an anvil now costs zero experience levels! You can freely give any compatible item function trajectory capabilities without spending any XP.
  • Placing a "Math Function" enchanted book in the anvil's secondary slot also reduces the cost to zero, making it easy to transfer the enchantment.
  • The system automatically recognizes valid math expressions (starting with y= or f(x)=) and waives the experience cost.
2.4Бета7 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.4 版本更新 - 新增三叉戟激流函数轨迹支持:

  • 现在将三叉戟重命名为 f(x)=表达式 或 y=表达式 格式后,使用激流(Riptide)附魔在水中或雨中冲刺时,玩家会沿着数学函数曲线飞行!体验如同乘坐过山车一般的函数飞行。
  • 飞行途中按下跳跃键(空格键)可随时停止函数轨迹飞行,立即结束激流状态并恢复下落。
  • 三叉戟激流飞行时伴有炫酷的粒子尾迹(烟花、暴击、附魔粒子),视觉效果更加华丽。
  • 飞行路径上撞到方块或实体时会自动终止飞行,避免卡入方块内部。

【English Changelog】

Version 2.4 - Added Trident Riptide function trajectory support:

  • Rename a trident to f(x)=expression or y=expression, then use the Riptide enchantment to dash through water or rain — you will fly along the mathematical function curve! Experience function-powered flight like a roller coaster.
  • Press the jump key (Space) anytime during flight to stop the function trajectory immediately and end the Riptide state.
  • Trident Riptide flight features cool particle trails (firework, crit, and enchanted hit particles) for a more spectacular visual effect.
  • Automatically terminates flight upon hitting blocks or entities to prevent getting stuck inside.
2.3Бета6 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.3 版本更新 - 弹射物轨迹稳定性优化:

  • 修复了所有受函数轨迹影响的弹射物(箭矢、烟花火箭等)在飞行过程中偶尔会受重力影响而偏离函数轨迹的问题,现在所有弹射物都会始终严格贴合设定的数学曲线飞行。
  • 确保任何发射角度下,各类弹射物都能准确沿函数路径移动,不再出现下落或上扬的偏差(我们仅修改了不到10行代码就修复了一个bug QAQ)。

【English Changelog】

Version 2.3 - Projectile trajectory stability improvement:

  • Fixed an issue where all projectile types affected by the function trajectory (arrows, fireworks, etc.) would occasionally be affected by gravity during flight, causing deviation from the function curve. All projectiles now strictly follow the mathematical path at all times.
  • Ensured accurate trajectory alignment for all projectile types regardless of firing angle, with no unexpected drops or rises.
2.2Бета6 июля 2026 · для 1.21.1 · NeoForgeСкачать

【中文更新日志】

2.2 版本更新 - 烟花火箭全面完善:

  • 烟花火箭现在可以完美地沿着数学函数轨迹飞行,不会再出现抖动或偏离的问题。
  • 当烟花火箭在飞行途中碰到任何方块或生物时,会立刻在碰撞点爆炸,产生绚丽的烟花效果,并对周围生物造成范围伤害。
  • 烟花火箭的爆炸效果与原版完全一致,包括粒子特效、音效。
  • 整体控制逻辑更稳健,无论发射角度如何,轨迹都能精准贴合函数图像。

【English Changelog】

Version 2.2 - Firework rockets fully polished:

  • Firework rockets now fly smoothly along mathematical function trajectories with no jitter or deviation.
  • When a firework hits any block or entity during flight, it instantly explodes at the impact point, producing a spectacular firework burst and dealing area damage to nearby creatures.
  • The explosion effect is identical to vanilla fireworks, including particles and sound.
  • Overall control logic is more robust, ensuring precise trajectory alignment regardless of firing angle.

Сайт использует cookie: необходимые — для входа и темы, а также счётчики посещений Яндекс Метрика и LiveInternet — по ним мы видим, как пользуются сайтом. Рекламных cookie у нас нет. Подробнее