
Advanced Datapack Mod
此mod旨在扩展数据包功能,目前处于早期开发阶段。 不要在正常游戏期间使用此模组。它可能会导致崩溃甚至坏档! This mod is designed to extend datapack functionality and is currently in early development. Do not use this mod during regular gameplay. It may cause crashes or even corrupt your world!
Links
Tags
Creators
Details
1.0.1
Compatibility
Changes
Advanced Datapack Mod
此mod旨在扩展数据包功能,目前处于早期开发阶段。 不要在正常游戏期间使用此模组。它可能会导致崩溃甚至坏档!
This mod is designed to extend datapack functionality and is currently in early development. Do not use this mod during regular gameplay. It may cause crashes or even corrupt your world!
Datapack功能介绍
1. 物品扩展
- 相比于原版数据包,增加了更多的物品扩展功能,能够使Minecraft通过数据包动态注册物品。
- 支持物品的自定义属性、耐久度等。
- 支持物品的自定义模型和纹理。(在资源包中定义)
2. 方块扩展(正在开发)
- 增加了更多的方块扩展功能。
3. 命令
adm命令 [返回]mod 信息item子命令get <namespace>[返回]注册的物品列表<namespace>非必选参数
Datapack格式
在数据包的 data/<namespace>/item目录下新建<item_name>.json文件以定义物品。
这是一个示例
{
"food": {
"canAlwaysEat": true,
"nutrition": 80,
"saturation": 3.0,
"effects":[
["minecraft:effect.night_vision",10,1]
]
},
"tool": {
"type": "axe",
"level": "stone",
"attackDamage": 999,
"attackSpeed": 0.1,
"durability": 1
},
"replace": "barrier"
}
其中food、tool和replace是可选的。
food定义了物品的食物属性。canAlwaysEat:是否总是可以食用。nutrition:食物的饱食度。saturation:食物的饱和度。effects:食用后给予的效果,格式为[效果ID,持续时间(秒),效果等级]。
tool定义了物品的工具属性。type:工具类型,如axe、pickaxe、shovel、hoe等。level:工具等级,如wood、stone、iron、diamond、netherite。attackDamage:工具的攻击伤害。attackSpeed:工具的攻击速度。durability:工具的耐久度。
replace定义了物品在客户端的展示物品,必须是一个(客户端)存在的物品ID,如minecraft:stone、minecraft:iron_ingot等(developing)。
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:8f8EzyGI:5jgsuXy9"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:8f8EzyGI:5jgsuXy9"
}
