MiguelCrates
MiguelCrates 将简单的物品发放转变为一种活动体验。它为我的世界添加了完全动画化、令人兴奋的宝箱,并与你的经济系统挂钩,让玩家忍不住想要“再来一次”。
如何创建你自己的自定义宝箱
使用在线宝箱生成器:
或者
- 找到文件夹: 进入服务器的配置文件夹 (
config/migueleconomy/crates)。
- 复制并粘贴: 复制一个现有文件(例如
common.json),并将其重命名为类似 vip_crate.json 的名称。
- 编辑详细信息: 使用任何文本编辑器(如记事本)打开它。
- 将名称更改为 "VIP Crate"。
- 选择纹理(颜色)以决定其外观。
- 列出奖励: 只需输入你想要的物品(例如
"minecraft:diamond")、数量以及它们的稀有度。
- 提示:你甚至可以设置执行命令(带有自定义图标!)或给予金钱。
- 重启: 重启服务器,你的新宝箱就可以放置使用了!
完整宝箱指南
创建和编辑宝箱
MiguelCrates 使用 JSON 配置文件来定义宝箱。这允许你轻松地创建新宝箱或修改现有宝箱,而无需更改模组代码。
位置
宝箱配置文件位于你的 Minecraft 实例的 config/migueleconomy/crates/ 目录中。
- 服务器/客户端:
config/migueleconomy/crates/
每个宝箱都是一个独立的 .json 文件。文件名决定了宝箱的唯一 ID(例如 common.json -> common)。
宝箱结构
宝箱 JSON 文件的基本结构如下:
{
"display_name": "My Custom Crate",
"description": "A description of what's inside.",
"icon": "minecraft:chest",
"texture": "miguelcrates:block/common_crate",
"rewards": [
...
],
"obtain": {
"sources": [
...
]
}
}
字段
| 字段 |
类型 |
描述 |
display_name |
String |
在 GUI 和物品上显示的名称。 |
description |
String |
工具提示中显示的描述文本。 |
icon |
String |
用于代表宝箱的物品 ID(例如 minecraft:chest)。 |
texture |
String |
自定义渲染器的纹理路径(通常为 miguelcrates:block/<name>)。 |
rewards |
List |
可能的奖励列表(见下文)。 |
obtain |
Object |
(可选)定义玩家如何获得此宝箱(见下文)。 |
简化版附魔(推荐)
与其使用复杂的 NBT 字符串,不如使用 enchantments 块来为物品添加附魔。这适用于书和工具。
{
"item": "minecraft:enchanted_book",
"quantity": 1,
"enchantments": {
"minecraft:sharpness": 5,
"minecraft:unbreaking": 3
},
"weight": 10
}
高级 NBT
对于更复杂的数据(属性、名称等),你仍然可以使用 nbt 字段。
{
"item": "minecraft:diamond_sword",
"nbt": "{display:{Name:'{\"text\":\"Excalibur\"}'}}",
"weight": 5
}
奖励
rewards 列表包含定义玩家可能赢得内容的对象。
"rewards": [
{
"item": "minecraft:diamond",
"quantity": 2,
"weight": 10
},
{
"command": "give @p minecraft:stone 64",
"weight": 50
},
{
"item": "minecraft:experience_bottle",
"command": "xp add @p 5 levels",
"weight": 10
},
{
"item": "migueleconomy:money",
"nbt": "{MoneyValue:100L}",
"weight": 20
}
]
item: 物品的资源位置(例如 minecraft:iron_sword)。如果与 command 一起使用,则作为图标。
command: 要执行的命令。使用 @p 指代打开宝箱的玩家。
name: (可选)奖励的自定义显示名称(例如 "5 Levels of XP")。
quantity: (可选,默认值为 1)要给予的物品数量。
nbt: (可选)物品的 NBT 数据字符串。
weight: 概率权重。权重越高 = 几率越大。
- 概率 =
weight / total_weight_of_all_rewards
获取方法
obtain 部分定义了宝箱在世界中生成的方式。它包含一个 sources 列表。
1. 合成 (craft)
允许玩家在合成台中合成宝箱。
{
"type": "craft",
"recipe": {
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"AAA",
"ABA",
"AAA"
],
"key": {
"A": { "item": "minecraft:planks" },
"B": { "item": "minecraft:chest" }
},
"result": {
"id": "miguelcrates:crate",
"count": 1,
"components": {
"minecraft:custom_data": { "CrateId": "your_crate_id" }
}
}
}
}
2. 生物掉落 (kill)
当特定实体被击杀时掉落。
{
"type": "kill",
"entity": "minecraft:zombie",
"chance": 0.05
}
entity: 实体 ID(例如 minecraft:creeper, minecraft:ender_dragon)。
chance: 从 0.0 到 1.0 的概率(0.05 = 5%)。
3. 战利品表 (loot_table)
将宝箱注入原版战利品表(箱子)中。
{
"type": "loot_table",
"id": "minecraft:chests/simple_dungeon",
"chance": 0.1
}
id: 要注入的战利品表 ID。
chance: 宝箱出现在箱子中的概率。
示例文件 (example.json)
{
"display_name": "Example Crate",
"description": "An example configuration.",
"icon": "minecraft:barrel",
"texture": "miguelcrates:block/common_crate",
"rewards": [
{
"item": "minecraft:apple",
"quantity": 5,
"weight": 50
},
{
"item": "minecraft:golden_apple",
"weight": 10
}
],
"obtain": {
"sources": [
{
"type": "kill",
"entity": "minecraft:skeleton",
"chance": 0.02
}
]
}
}
游戏内命令 (管理员)
使用这些命令来管理宝箱。
给予宝箱
/miguelcrates give <player> <crate_id> [amount]
- 示例 1(给自己一个稀有箱子):
/miguelcrates give @p rare
- 示例 2(给某玩家 5 个普通箱子):
/miguelcrates give PlayerName common 5
恢复默认箱子
/miguelcrates default <name|all>
- 恢复缺失或被删除的默认箱子。
- 示例:
/miguelcrates default all(恢复所有 20 多个主题箱子)
- 示例:
/miguelcrates default miner(仅恢复矿工箱子)
重载配置
/miguelcrates reload
- 如果在服务器运行时编辑了 JSON 文件,此命令可刷新模组。
打开菜单(快捷键)
/crates, /crate 或 /box

MiguelCrates
MiguelCrates turns simple item giving into an event. It adds fully animated, exciting lootboxes to your world that hook into your economy and keep players coming back for "just one more spin."
How to Create Your Own Custom Crate
User the online Crate Builder :
OR
- Find the Folder: Go to your server’s config folder (
config/migueleconomy/crates).
- Copy & Paste: Take an existing file (like
common.json) and copy it. Rename it to something like vip_crate.json.
- Edit the Details: Open it with any text editor (like Notepad).
- Change the Name to "VIP Crate".
- Pick a Texture (color) for how it looks.
- List your Rewards: Simply type in the items you want (e.g.,
"minecraft:diamond"), how many to give, and how rare they should be.
- Tip: You can even make it run commands (with custom icons!) or give money.
- Restart: Restart your server, and your new crate is ready to be placed!
Comple Crate Guide
Creating and Editing Crates
MiguelCrates uses JSON configuration files to define crates. This allows you to easily create new crates or modify existing ones without changing the mod code.
Location
Crate configuration files are located in the config/migueleconomy/crates/ directory of your Minecraft instance.
- Server/Client:
config/migueleconomy/crates/
Each crate is a separate .json file. The file name determines the unique ID of the crate (e.g., common.json -> common).
Crate Structure
The basic structure of a crate JSON file is as follows:
{
"display_name": "My Custom Crate",
"description": "A description of what's inside.",
"icon": "minecraft:chest",
"texture": "miguelcrates:block/common_crate",
"rewards": [
...
],
"obtain": {
"sources": [
...
]
}
}
Fields
| Field |
Type |
Description |
display_name |
String |
The name shown in GUIs and items. |
description |
String |
Description text shown in tooltips. |
icon |
String |
The Item ID used to represent the crate (e.g., minecraft:chest). |
texture |
String |
Path to the texture for the custom renderer (usually miguelcrates:block/<name>). |
rewards |
List |
A list of possible rewards (see below). |
obtain |
Object |
(Optional) Defines how players can get this crate (see below). |
Simplified Enchantments (Recommended)
Instead of using complex NBT strings, you can use the enchantments block to add enchantments to an item. This works for both books and tools.
{
"item": "minecraft:enchanted_book",
"quantity": 1,
"enchantments": {
"minecraft:sharpness": 5,
"minecraft:unbreaking": 3
},
"weight": 10
}
Advanced NBT
For more complex data (attributes, names, etc.), you can still use the nbt field.
{
"item": "minecraft:diamond_sword",
"nbt": "{display:{Name:'{\"text\":\"Excalibur\"}'}}",
"weight": 5
}
Rewards
The rewards list contains objects defining what players can win.
"rewards": [
{
"item": "minecraft:diamond",
"quantity": 2,
"weight": 10
},
{
"command": "give @p minecraft:stone 64",
"weight": 50
},
{
"item": "minecraft:experience_bottle",
"command": "xp add @p 5 levels",
"weight": 10
},
{
"item": "migueleconomy:money",
"nbt": "{MoneyValue:100L}",
"weight": 20
}
]
item: Resource location of the item (e.g., minecraft:iron_sword). If used with command, it acts as the icon.
command: Command to execute. Use @p for the player opening the crate.
name: (Optional) Custom display name for the reward (e.g. "5 Levels of XP").
quantity: (Optional, default 1) Number of items to give.
nbt: (Optional) NBT data string for the item.
weight: The chance weight. Higher weight = higher chance.
- Probability =
weight / total_weight_of_all_rewards
Obtain Methods
The obtain section defines how crates are generated in the world. It contains a list of sources.
1. Crafting (craft)
Allows players to craft the crate in a crafting table.
{
"type": "craft",
"recipe": {
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"AAA",
"ABA",
"AAA"
],
"key": {
"A": { "item": "minecraft:planks" },
"B": { "item": "minecraft:chest" }
},
"result": {
"id": "miguelcrates:crate",
"count": 1,
"components": {
"minecraft:custom_data": { "CrateId": "your_crate_id" }
}
}
}
}
2. Mob Drops (kill)
Drops when a specific entity is killed.
{
"type": "kill",
"entity": "minecraft:zombie",
"chance": 0.05
}
entity: Entity ID (e.g., minecraft:creeper, minecraft:ender_dragon).
chance: Probability from 0.0 to 1.0 (0.05 = 5%).
3. Loot Tables (loot_table)
Injects the crate into vanilla loot tables (chests).
{
"type": "loot_table",
"id": "minecraft:chests/simple_dungeon",
"chance": 0.1
}
id: The Loot Table ID to inject into.
chance: Probability the crate will appear in the chest.
Example File (example.json)
{
"display_name": "Example Crate",
"description": "An example configuration.",
"icon": "minecraft:barrel",
"texture": "miguelcrates:block/common_crate",
"rewards": [
{
"item": "minecraft:apple",
"quantity": 5,
"weight": 50
},
{
"item": "minecraft:golden_apple",
"weight": 10
}
],
"obtain": {
"sources": [
{
"type": "kill",
"entity": "minecraft:skeleton",
"chance": 0.02
}
]
}
}
In-Game Commands (Admin)
Use these commands to manage crates.
Give a Crate
/miguelcrates give <player> <crate_id> [amount]
- Example 1 (Give yourself a Rare Crate):
/miguelcrates give @p rare
- Example 2 (Give a player 5 Common Crates):
/miguelcrates give PlayerName common 5
Restore Default Crates
/miguelcrates default <name|all>
- Restores missing or deleted default crates.
- Example:
/miguelcrates default all (Restores all 20+ themed crates)
- Example:
/miguelcrates default miner (Restores just the Miner crate)
Reload Config
/miguelcrates reload
- Refreshes the mod if you edited the JSON files while the server was running.
Open Menu (Shortcuts)
/crates, /crate, or /box

评论 0
登录后参与评分
还没有评论,来抢沙发吧