Saturn 的组件
为物品组件添加了一些额外功能,使用户在自定义物品时拥有更大的灵活性。
该模组最终目标是允许仅通过物品组件,在原版游戏中的任意其他物品内重新创建任何物品。
23w12a
目前该模组变得有些多余,因为 Mojang 已经添加了此模组实现的功能。也许我很快会添加更多组件。
最大数量
minecraft:max_count
设置物品可拥有的最大堆叠数量,接受一个非负整数值。
最大耐久
minecraft:max_damage
设置物品的总耐久度,这也会影响非工具类物品!接受一个非负整数值。
稀有度
minecraft:rarity
设置物品的稀有度,决定其显示名称的基础颜色。接受以下列表中的有效字符串条目:["common", "uncommon", "rare", "epic"]
防火
minecraft:fireproof
设置物品在与火源接触时是否会被销毁。接受一个布尔值。
食物属性
minecraft:food_properties
此组件完全移除了关于食物物品引入方式的硬编码,意味着现在任何物品都可以通过一条快速命令变成可食用物品!此组件较大,至少需要指定一个饥饿值。示例组件如下所示:
{
"food_properties": {
// 一个非负整数。决定消耗时恢复多少饥饿值。
"hunger": 0,
// 一个正浮点数。决定消耗时恢复多少饱和度。
"saturation_modifier": 1.0,
// 一个正整数。决定消耗该物品所需的时间。
"time_to_eat": 32,
// 决定食物的行为。
"food_behavior": {
// 狼是否会与该物品互动。
"is_meat": false,
// 无论玩家饥饿值如何,该物品是否都可食用。
"always_edible": false,
// 该物品是否在半倍时间内被食用。
"is_snack": false,
// 该物品在被食用时是否显示粒子效果。
"is_drink": false,
// 该物品在被食用后是否清除玩家的所有状态效果。
"clear_effects": false
},
// 食物对象在被食用后应给予玩家的成品物品。
"result_item": {
"id": "minecraft:air",
"count": 1
},
// 一组状态效果对象,玩家在食用该物品后将获得这些效果。
"status_effects": [
{
"id": "minecraft:swiftness",
"duration": 160,
"amplifier": 0,
"ambient": false,
"show_particles": true,
"chance": 1.0
}
]
}
}
Saturn's Components
Adds some extra functionality to item components to allow for users to have more flexibility with their custom items.
The end goal for the mod is to allow for any item within the vanilla game to be recreated within any other item using only item components.
23w12a
Mod became kinda redundant ATM because Mojang already added what this does. Maybe I'll add more componentns soon
Max Count
minecraft:max_count
Sets the maximum stack size an item can have, accepting a non-negative integer value.
Max Damage
minecraft:max_damage
Sets the total durability of an item, which affects non-tool items too! Accepts a non-negative integer value.
Rarity
minecraft:rarity
Sets the rarity of an item, determining the base color of it's display name. Accepts a valid string entry from the following list: ["common", "uncommon", "rare", "epic"]
Fireproof
minecraft:fireproof
Sets whether the item will be destroyed when coming into contact with a fire source. Accepts a boolean value.
Food Properties
minecraft:food_properties
This component completely removes any hard coding to how food items are introduced, meaning any item can now be edible with a quick command! This component is a large one and requires at minimum a hunger value to be specified. An example component can be seen as followed:
{
"food_properties": {
// A non-negative integer. Decides how much hunger to restore when consumed.
"hunger": 0,
// A positive float. Decides how much saturation to restore when consumed.
"saturation_modifier": 1.0,
// A positive integer. Decides how long it takes to consume the item.
"time_to_eat": 32,
// Decides the behavior of the food.
"food_behavior": {
// Whether wolves interact with the item.
"is_meat": false,
// Whether the item can be eaten regardless of a player's hunger value.
"always_edible": false,
// Whether the item is eaten in half the time.
"is_snack": false,
// Whether the item shows particles while being consumed.
"is_drink": false,
// Whether the item clears all the player's status effects after being consumed.
"clear_effects": false
},
// The resulting item a food object should give the player after being consumed.
"result_item": {
"id": "minecraft:air",
"count": 1
},
// A list of status effect objects that are applied to the player once they have consumed the item.
"status_effects": [
{
"id": "minecraft:swiftness",
"duration": 160,
"amplifier": 0,
"ambient": false,
"show_particles": true,
"chance": 1.0
}
]
}
}
评论 0
登录后参与评分
还没有评论,来抢沙发吧