Links
Tags
Creators
Details
Licensed GPL-3.0-only
Published 7 months ago
Updated 3 months ago
All versions
2.0
Beta
Math Function 2.06 months ago 43
Compatibility
Minecraft: Java Edition
1.21.1
Platform
NeoForge
Supported environments
Client and server
Changes
【中文更新日志】
- 新增“函数轨迹”附魔(弓、弩、打火石):
- 将物品重命名为
f(x)=表达式或y=表达式格式(例如f(x)=x^2),即可激活特殊弹道。 - 箭矢和 TNT 会沿数学函数
y = f(x)的轨迹飞行,其中x为沿玩家面向方向的水平距离,y为相对于发射点的高度。 - 支持基本运算符(+ - * / ^)、三角函数(sin/cos/tan)、对数(log/ln)、平方根(sqrt)等。
- 箭矢和 TNT 的起始高度自动设为
f(0),确保常函数或带常数项的函数正确上升。 - TNT 点燃后引信延长至 10 秒,并沿函数轨迹飞行,碰撞到方块或实体时立即爆炸。
- 兼容多重射击附魔(箭矢会略微分散)。
- 箭矢/TNT 飞行时生成烟花/火焰粒子尾迹。
- 超出距离(1000 格)或时间(600 tick)后自动恢复重力或爆炸。
- 将物品重命名为
- 技术细节:使用
ConcurrentHashMap避免多线程并发修改崩溃;采用数值微分计算切线速度,弹道平滑自然。
【English Changelog】
- Added "Math Function" enchantment (for bow, crossbow, flint-and-steel):
- Rename the item to
f(x)=expressionory=expression(e.g.f(x)=x^2) to activate custom trajectory. - Arrows and TNT will follow the curve
y = f(x), wherexis the horizontal distance along player's facing direction, andyis height relative to launch point. - Supports basic operators (+ - * / ^), trig functions (sin/cos/tan), logarithms (log/ln), square root (sqrt), etc.
- Initial height is set to
f(0), so constant functions or those with constant terms work correctly. - TNT fuse extended to 10 seconds; it flies along the function curve and explodes immediately upon hitting blocks or entities.
- Compatible with Multishot enchantment (arrows spread slightly).
- Firework/flame particle trails are generated during flight.
- Automatically reverts to gravity or explodes after exceeding max distance (1000 blocks) or ticks (600).
- Rename the item to
- Technical: Uses
ConcurrentHashMapto avoidConcurrentModificationException; numerical differentiation provides smooth tangent-based velocity.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:PCGFmGm4:gGFsCjj3"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:PCGFmGm4:gGFsCjj3"
}

