Currently, the built-in command "dynamicregistrar datagen" can generate a resource bundle based on your data package, and you can replace it according to the structure inside A built-in page allows for quick generation of data packets, but its functionality is somewhat limited. I don't intend to develop this page for the time being ..
You can now register items through data packets, but please note that server restart is required for data packet reloading, and hot reloading may be upgraded in the future
You can register a very simple item
{
"identifier": "dynamicregistrar:example_custom_properties"
}
You can also register a complex item
{
"type": "FishingRodItem",
"curios_type": "head",
"attribute_modifiers": {
"modifiers": [
{
"type": "minecraft:generic.attack_damage",
"amount": 1.0,
"id": "minecraft:base_attack_damage",
"operation": "add_value",
"slot": "mainhand"
}
]
},
"can_repair": false,
"components": {
"minecraft:lore": [
"{\"translate\":\"item.dynamicregistrar.example_complex_custom_properties.lore\"}"
]
},
"fire_resistant": true,
"food": {
"eat_seconds": 1.0,
"effects": [
{
"effect": {
"duration": 100,
"id": "minecraft:health_boost",
"neoforge:cures": [
"protected_by_totem",
"milk"
],
"show_icon": true
}
}
],
"nutrition": 1,
"saturation": 1.0,
"using_converts_to": {
"id": "minecraft:bowl"
}
},
"identifier": "dynamicregistrar:example_complex_custom_properties",
"max_damage": 300,
"max_stack_size": 1,
"rarity": "rare"
}
You can register a set of tools
{
"custom_properties": {
"curios_type": "head",
"identifier": "dynamicregistrar:example_custom_properties"
},
"extend_damage": 0.5,
"extend_speed": 0.5,
"tier": {
"attackDamageBonus": 1.0,
"enchantmentValue": 1,
"incorrectBlocksForDrops": "dynamicregistrar:example_custom_properties",
"repairIngredient": ["tag": "minecraft:planks"],
"speed": 1.0,
"uses": 1
},
"types": [
"sword",
"axe",
"pickaxe",
"shovel",
"hoe"
]
}
You can register a set of equipment
{
"armor_material": {
"defense": {
"boots": 1,
"chestplate": 2,
"helmet": 1,
"leggings": 1
},
"enchantmentValue": 0,
"equipSound": "minecraft:item.armor.equip_generic",
"knockback_resistance": 0.0,
"layers": [
{
"asset_name": "dynamicregistrar:example_custom_properties"
}
],
"repairIngredient": [],
"toughness": 0.0
},
"custom_properties": {
"curios_type": "head",
"identifier": "dynamicregistrar:example_custom_properties"
},
"if_body": false
}
目前内置了命令 dynamicregistrar datagen 可以根据你的数据包生成一个资源包,可以根据里面的结构进行替换 内置一个页面可以快速生成数据包,但是功能有点少,暂时不想写这个页面...
你现在可以通过数据包注册物品,但需要注意,数据包重载需要重启服务器,未来可能会升级热重载
你可以注册一个非常简单的物品
{
"identifier": "dynamicregistrar:example_custom_properties"
}
你也可以注册一个复杂的物品
{
"type": "FishingRodItem",
"curios_type": "head",
"attribute_modifiers": {
"modifiers": [
{
"type": "minecraft:generic.attack_damage",
"amount": 1.0,
"id": "minecraft:base_attack_damage",
"operation": "add_value",
"slot": "mainhand"
}
]
},
"can_repair": false,
"components": {
"minecraft:lore": [
"{\"translate\":\"item.dynamicregistrar.example_complex_custom_properties.lore\"}"
]
},
"fire_resistant": true,
"food": {
"eat_seconds": 1.0,
"effects": [
{
"effect": {
"duration": 100,
"id": "minecraft:health_boost",
"neoforge:cures": [
"protected_by_totem",
"milk"
],
"show_icon": true
}
}
],
"nutrition": 1,
"saturation": 1.0,
"using_converts_to": {
"id": "minecraft:bowl"
}
},
"identifier": "dynamicregistrar:example_complex_custom_properties",
"max_damage": 300,
"max_stack_size": 1,
"rarity": "rare"
}
你可以注册一套工具
{
"custom_properties": {
"curios_type": "head",
"identifier": "dynamicregistrar:example_custom_properties"
},
"extend_damage": 0.5,
"extend_speed": 0.5,
"tier": {
"attackDamageBonus": 1.0,
"enchantmentValue": 1,
"incorrectBlocksForDrops": "dynamicregistrar:example_custom_properties",
"repairIngredient": ["tag": "minecraft:planks"],
"speed": 1.0,
"uses": 1
},
"types": [
"sword",
"axe",
"pickaxe",
"shovel",
"hoe"
]
}
你可以注册一套装备
{
"armor_material": {
"defense": {
"boots": 1,
"chestplate": 2,
"helmet": 1,
"leggings": 1
},
"enchantmentValue": 0,
"equipSound": "minecraft:item.armor.equip_generic",
"knockback_resistance": 0.0,
"layers": [
{
"asset_name": "dynamicregistrar:example_custom_properties"
}
],
"repairIngredient": [],
"toughness": 0.0
},
"custom_properties": {
"curios_type": "head",
"identifier": "dynamicregistrar:example_custom_properties"
},
"if_body": false
}