本模组受到 LuckyCases 的启发,但存在的安全问题较少*,且配置更加灵活。
配置
模组通用配置文件位于 /config/cases.cfg
自定义箱子配置文件位于 /config/cases/ 目录中。
自定义工具包配置文件位于 /config/kits/ 目录中。
示例箱子配置(将其放入 /config/cases/pickaxes.json):
{
"displayName": {"en_us": "Case with pickaxes and wool",
"ru_ru": "Кейс с кирками и шерстью"
},
"contents": [
{
"action": "collect",
"type": "pickaxe",
"filter": {
"mod": "minecraft"
}
},
{"action": "extended", "type": "minecraft:wool", "rarity": 1},
{"action": "exclude", "type": "wool", "meta": 0}
],
"color": "#555555"
}
注意:Json 文件名(your_case.json)是该箱子的内部名称,用于 ID 注册。它只能包含拉丁字母、数字、点和下划线。
对上述配置的详细解释:
- "displayName" 属性是你的箱子的显示名称(显而易见,队长)。
它可以是字符串或 json 对象:
"Pickaxe case" <-- 每种语言的默认值
或者
{
"en_us": "Pickaxe case", <-- 除以下列出的语言外,每种语言的默认值
"ru_ru": "Кейс с кирками"
}
- "color" 属性定义物品叠加层的颜色
- "contents" 属性是最难的部分。它由多个 json 对象组成,每个对象代表一种所谓的“操作”,可以在箱子中添加/删除单个/多个物品。有六种不同的操作:
- "single" - 添加单个物品。它具有几个额外属性,例如:
- "type" - 包含物品 ID(例如 minecraft:apple),
- "meta" - 物品的元数据(对于像彩色羊毛这样的物品,元数据定义羊毛颜色;对于木板,元数据定义树木类型。默认为 '0'),
- "amount"(可以是单个数字或范围 [用于随机物品数量。例如 '1-10' 将掉落一到十个物品。但对于受损物品:'0-1' 表示物品可以具有随机损坏值。其中 0 表示物品完全损坏,1 表示物品完好无损。] 默认为 '1'),
- "nbt" - 物品的额外数据(所谓的“命名二进制标签”,主要用于存储能量或法力等的物品)
- "enchant" - 工具拥有随机附魔的几率(最小值(和默认值):0,最大值:1)
- "rarity"- 一个从 0 到 4 的整数值,表示物品的稀有程度。
- "extended" - 工作方式与 "single" 相同,但没有 "meta" 属性,因为它会一次性将所有物品变体添加到箱子中。
- "oredict" - 这个类似于 "extended",但它通过 'oredict name' 而不是物品 ID 查找物品。它还有几个内置值,如 'ingots' 用于所有锭,'gems' 用于所有宝石,'ores' 用于所有矿石,以及 'ingotBlocks' 用于所有锭块。(例如 "type": "ingots")。可以使用 "filter" 属性过滤值。 例如 "mod" 过滤器。
它可以是 JsonArray 或单个字符串:
"filter": {
"mod": "minecraft" <-- 仅添加原版物品
}
或者
"filter": {
"mod": [ <-- 仅添加原版、IC2 和 Thaumcraft 物品
"minecraft",
"ic2",
"thaumcraft"
]
} - "collect" - 这个类似于 "extended" 和 "oredict",但只能添加装备、食物和附魔书。可能的值为:'hoe', 'pickaxe', 'sword', 'shovel', 'axe', 'boots' (靴子), 'leggings' (护腿), 'chestplate' (胸甲), 'helmet' (头盔), 'food', 'enchantBooks'. 物品可以像前一个操作一样进行过滤,并且默认情况下它们没有附魔且未受损,但你可以添加这些属性来更改此设置:"condition" (类似于 "amount",其值在 0 到 1 的范围内) 和 "enchant" (与 "single" 的 "enchant" 属性不同,这个只是一个预计算值的乘数。例如,设置为 1 并不意味着所有物品都会附魔,而是允许它们以预计算的附魔几率进行附魔。例如,木镐的附魔几率为 0.5,铁镐为 0.5 * 0.4 = 0.2 的附魔几率。这里的默认值是 0,表示附魔已禁用).
- "extract" - 从另一个箱子中提取内容。("case": "your_case_name_here")。当你想要创建一个包含所有工具和盔甲等的箱子时,这很有用。
- "exclude" - 这与 "single" 相反,因为它从列表中移除指定的物品。
- "single" - 添加单个物品。它具有几个额外属性,例如:
预计算的附魔概率:
普通物品:0.5 (50%)
稀有物品:0.4 (40%)
罕见物品:0.3 (30%)
非常罕见物品:0.2 (20%)
超罕见物品:0.1 (10%)
注意:你的箱子配置将在网络中同步,因此你只需在服务器上放置它们,玩家连接时就会自动获取这些配置。
命令
该模组提供了一系列实用的命令,可帮助你创建箱子。
- /cases reload - 即时重载箱子配置(无需重启)
- /cases nbt - 打印手持物品的 JSON 化 NBT 数据(数据可能非常大 [你好,Forestry!],因此你需要查看 latest.log)
- /cases new kit|case <name> - 创建新的箱子/工具包,并将你当前查看的容器中的所有物品添加到配置中。
移植与其他内容
不要要求我将此模组更新到 X.Y.Z 版本。当我有足够多的空闲时间时,我会自行进行更新!
This mod is inspired by LuckyCases but it has less security problems* and it's much more configurable.
Configuration
General mod configuration is located at /config/cases.cfg
Custom case configs are in the /config/cases/ directory.
Custom kit configs are in /config/kits/
Example case config (put it in /config/cases/pickaxes.json):
{
"displayName": {"en_us": "Case with pickaxes and wool",
"ru_ru": "Кейс с кирками и шерстью"
},
"contents": [
{
"action": "collect",
"type": "pickaxe",
"filter": {
"mod": "minecraft"
}
},
{"action": "extended", "type": "minecraft:wool", "rarity": 1},
{"action": "exclude", "type": "wool", "meta": 0}
],
"color": "#555555"
}
Note: Json file name (your_case.json) is an internal name of your case that's being used for id registration. It should only contain latin letters, numbers, dots and underscores.
Detailed explanation of the config above:
- The "displayName" property is the display name of your case (OMG CAPTAIN OBVIOUS).
It coud be either a string or a json object:
"Pickaxe case" <-- default value for every language
OR
{
"en_us": "Pickaxe case", <-- default value for every language except those listed below
"ru_ru": "Кейс с кирками"
}
- The "color" property defines item overlay color
- The "contents" property is the most hardest part here. It consists of a multiple json objects where each one represents a so-called 'action' that can add/remove single/multiple items within a case. There are six different actions:
- "single" - adds a single item. It has several extra properties such as:
- "type" - contains item id (e.g. minecraft:apple),
- "meta" - an item's metadata (for items like colored wool where meta defines wool color or planks where meta defines tree type. Defaults to '0'),
- "amount" (Could be either a single number or a range [for random item amount. e.g. '1-10' will drop from one to ten items. But for damaged items: '0-1' indicates that item can have a random damage value. Where 0 means that item is completely broken and 1 means that item is untouched. ] Defaults to '1'),
- "nbt" - an item's extra data (so-called 'Named Binary Tag' which is moustly used for items that store energy or mana, etc.)
- "enchant" - a chance for a tool to have a random enchantment (minimal (and default) value: 0, maximal: 1)
- "rarity"- an integer value from 0 to 4 that says how rare the item is.
- "extended" - works the same way as "single" but has no "meta" property because it adds all the item's variants to the case at once.
- "oredict" - this one is similar to "extended" but it finds item by their 'oredict name' instead of item id. It also has several builtin values such as 'ingots' for every ingot, 'gems' for every gem, 'ores' for every ore and 'ingotBlocks' for every ingot block. (e.g. "type": "ingots"). Values can be filtered using "filter" property. E.g. "mod" filter.
It could be either a JsonArray or a single string:
"filter": {
"mod": "minecraft" <-- Only vanilla items will be added
}
OR
"filter": {
"mod": [ <-- Only vanilla, IC2 and Thaumcraft items will be added
"minecraft",
"ic2",
"thaumcraft"
]
} - "collect" - this one is similar to "extended" and "oredict" but can only add equipment, foodstuffs and enchantment books. Possible values are: 'hoe', 'pickaxe', 'sword', 'shovel', 'axe', 'boots' (boot), 'leggings' (legs), 'chestplate' (chest), 'helmet' (helm), 'food', 'enchantBooks'. Items can be filtered like in the previous action and they are unenchanted and undamaged by default, but you can add theese properties to change that: "condition" (similar to "amount" which's value is in range from 0 to 1) and the "enchant" (unlike the "single"'s "enchant" property this one is jus a multiplier for a pre-calculated values. E.g. when set to 1 it doesn't mean that all the items will be enchanted but instead they will be allowed to be enchanted with ther pre-calculated enchantment chances. E.g. for wooden pick enchantment chance is 0.5 and for the iron pick is 0.4 and so on. And if you set the value to 0.5 the iron pickaxe will have 0.5 * 0.4 = 0.2 enchantment chance . The default value here is 0 which means that enchantments are disabled).
- "extract" - extract contents from another case. ("case": "your_case_name_here"). This one is useful when you want to create a case that contains all the tools and armors, etc.
- "exclude" - this one is opposite to "single" because it removes specified item from the list.
- "single" - adds a single item. It has several extra properties such as:
Pre-calculated enchantment chances:
Common items: 0.5 (50%)
Uncommon items: 0.4 (40%)
Rare items: 0.3 (30%)
Very rare items: 0.2 (20%)
Ultra rare items: 0.1 (10%)
Note: Your case configurations will be synchronized among the network so you only need to put them on your server and your players will automatically get'em during connection.
Commands
The mod has a set of a useful commands that will help you with case creation.
- /cases reload - reload case configuration on the fly (no restart needed)
- /cases nbt - print JSON'ifyed NBT of the held item (It can be really large [hi, Forestry!] so you will need to look into your latest.log)
- /cases new kit|case <name> - creates new case/kit and adds all the items to the config from an inventory you're looking at.
Porting 'n' stuff
Don't ask me to update this mod to version X.Y.Z. I'll do it myself when I have enough free time!
下载 Cases
下载 Cases
下载 Cases
下载 Cases
下载 Cases
下载 Cases
下载 Cases
下载 Cases
下载 Cases
下载 Cases
- 修复了小型纹理覆盖问题
- 添加了新的奖励物品类型:kit(补给包)。其配置方式与 cases 类似,但所有已配置的物品会一次性发放给玩家。
- 为 kit 创建添加了新子命令 (/cases new kit <name>)
- 添加了奖励音效
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
可定制的鞘翅模组,支持装饰纹饰、旗帜图案等更多功能!
模组
让你能够在世界中的任何位置定位结构。
模组
? 使用命令保存和加载玩家或他人的背包/套装。
模组
一个基于构建器的 Minecraft 配置库!
模组
所有本应存在的事物
模组
为 Cobblemon 添加 Mega 进化、Z 招式、太晶化、超极巨化/超巨大化、究极爆击与融合!
评论 0
登录后参与评分
还没有评论,来抢沙发吧