HMWBTE 的装饰品

此数据包允许你自定义生存体验,而无需作弊或命令。使用此数据包,你可以为物品设置自定义名称和描述、自定义模型,甚至创建文本的全息投影!
此数据包仍在开发中,因此请报告你发现的任何问题或不便之处!
致谢
部分思路和代码改编自 Vanilla Tweaks 的 Armor Statues 数据包,并遵守其条款与条件。
原始数据包可在 Vanilla Tweaks 网站 找到
安装方法
首先,在创建世界菜单中添加此数据包,或者将其放入现有世界的 datapacks 文件夹中。
如果你想使用自定义模型,则需要一个资源包。建议基于此处提供的模板构建该资源包,以确保模型能正确使用。
我稍后可能会制作一个用于生成资源包的工具,但不保证一定会有。
如果你将此数据包添加到服务器并希望禁用某些功能,可以使用以下任一命令:
data modify storage permissions:config hat set value false
data modify storage permissions:config sit set value false
data modify storage permissions:config custom_text set value false
data modify storage permissions:config custom_models set value false
data modify storage permissions:config holograms set value false
使用方法
全息投影
要创建全息投影,写一本书(无需签名),然后使用铁砧将其重命名为 HOLOGRAM。将这本书放在讲台上即可自动召唤全息投影。有关如何格式化全息投影的指南,请参阅下方。
要编辑全息投影的内容,只需从讲台上取下书本,进行所需的更改,然后重新放置即可。
要调整全息投影的位置、旋转、大小等,可以使用配置器书。这本书可以通过将书签名为 “Holograms”(区分大小写)获得,也可以通过运行以下命令获取:
function hologram:give_book
自定义名称 / 描述
要为物品设置自定义名称,写一本书并将其重命名为 NAME。接下来,在主手持有要修改的物品,副手持有该书。然后运行此命令:
trigger custom_name
自定义描述的过程几乎相同,但你需要将书重命名为 LORE 并运行以下命令:
trigger custom_lore
有关如何格式化名称/描述的指南,请参阅下方。
格式指南
几个实用工具使用已书写/可书写书籍来生成格式化文本。此类书籍的内容遵循简单的标记模式,包含以下命令:
| 命令 |
结果 |
%bold% |
开启或关闭粗体 |
%italic% |
开启或关闭斜体 |
%obfuscate% |
开启或关闭模糊效果(随机乱码文本) |
%underline% |
开启或关闭下划线 |
%strikethrough% |
开启或关闭删除线(贯穿文本的横线) |
还有用于颜色的命令,它们大致遵循游戏中颜色的命名约定(例如 concrete)。以下是所有颜色命令的列表,顺序无关:
%black% %blue% %cyan% %green% %lightblue% %orange% %pink% %brown% %red% %magenta% %purple% %lime% %yellow% %gray% %lightgray% %white% %aqua% %darkred% %gold%
格式示例
以下已书写书籍:
%bold%%yellow%标题
%bold%%white%Lorem ipsum dolor sit amet
将产生以下格式化输出(图片展示了格式化的全息投影):

动作
此数据包还提供了一些简单的动作,允许玩家坐在台阶/切半石砖上,或将物品装备为帽子。
两者的触发器分别为:
trigger hat
triggger sit
请注意,玩家必须站在他们想要坐下的方块上。
自定义模型
⚠ 此功能未来可能会被更改或替换! ⚠
要为物品设置自定义模型,你应首先确保它存在于资源包中。这意味着应在 shared:custom 资源位置指定所需的 物品模型。
例如,如果我想拥有一个名为 “witherbuster” 的自定义模型,我需要确保文件 ./assets/shared/items/custom.json 类似于以下内容:
{
"model": {
"type": "minecraft:select",
"property": "minecraft:custom_model_data",
"cases": [
{
// 如果存在 "witherbuster" 字符串,则赋予
// 物品 witherbuster 模型
"when": "witherbuster",
"model": {
"type": "minecraft:model",
// 示例位置
"model": "location:item/witherbuster"
}
}
]
}
}
此数据包始终假设 shared:custom 是 “select” 类型,因此仅为 minecraft:custom_model_data 属性提供字符串值。
要设置自定义模型数据,请在副手持有已命名的纸张,并运行以下命令:
trigger custom_model
这会将主手物品的模型字符串设置为纸张的名称,该名称应与资源包中的字符串匹配。
要移除自定义模型,请在主手持有该物品并运行
trigger remove_model
这应将物品的模型恢复为其 ID。目前,还需要进行额外的测试以确保可靠性。
HMWBTE's Cosmetics

This datapack lets you customize your survival experience without needing cheats / commands. With this datapack, you can give items custom names and lore, custom models, or even create a hologram of text!
This datapack is a work in progress, so please report any issues or inconveniences you find!
Credits
Some ideas and code were adapted from Vanilla Tweaks' Armor Statues Datapack, in compliance with their terms & conditions.
The original datapack can be found on the Vanilla Tweaks website
How to install
First, add the datapack in the create world menu, or by placing it in the datapacks folder of an existing world.
If you want to use custom models, you need a resource pack. It is recommended to base that resource pack off the template here, to ensure the models get used properly.
I might make a tool for generating a resource pack later, but no promises.
If you are adding the datapack to a server and want to disable features, then you can use any of the following commands:
data modify storage permissions:config hat set value false
data modify storage permissions:config sit set value false
data modify storage permissions:config custom_text set value false
data modify storage permissions:config custom_models set value false
data modify storage permissions:config holograms set value false
How to use
Holograms
To create a hologram, write a book (it does not have to be signed) then rename it HOLOGRAM using an anvil. Placing this book on a lectern will automatically summon the hologram. See below for a guide on how to format the hologram.
To edit the contents of the hologram, just remove the book from the lectern, make the changes you want, and replace it.
To adjust the position, rotation, size, etc. of the hologram you can use the Configurator book. This book can be obtained by signing a book "Holograms" (case sensitive), or by running the following command:
function hologram:give_book
Custom Names / Lore
To give an item a custom name, write a book and rename it NAME. Next, hold the book in your offhand and the item you want to modify in your mainhand. Then run this command:
trigger custom_name
The process is almost identical for custom lore, but instead you rename the book LORE and run this command:
trigger custom_lore
For a guide on how to format names / lore, see below.
Formatting Guide
Several utilities use a written / writable book to generate formatted text. The contents of such books follow a simple markup pattern, with the following commands:
| Command |
Result |
%bold% |
Turns bold on or off |
%italic% |
Turns italics on or off |
%obfuscate% |
Turns obfuscation (the glitchy random text) on or off |
%underline% |
Turns underlining on or off |
%strikethrough% |
Turns strikethrough (line through the text) on or off |
There are also commands for color, which more or less follow the naming convention of colors in game (e.g. concrete). Here a list of all of them in no particular order:
%black% %blue% %cyan% %green% %lightblue% %orange% %pink% %brown% %red% %magenta% %purple% %lime% %yellow% %gray% %lightgray% %white% %aqua% %darkred% %gold%
Formatting Example
The following written book:
%bold%%yellow%Title
%bold%%white%Lorem ipsum dolor sit amet
Will produce the following formatted output (image shows a formatted hologram):

Actions
This datapack also provides some simple actions to allow a player to sit on a stair/slab, or to equip an item as a hat.
The triggers for both are, respectively:
trigger hat
triggger sit
Please note that the player must be standing on the block they wish to sit on.
Custom Models
⚠ This feature may be changed or replaced in the future! ⚠
To give an item a custom model, you should first make sure it exists in a resource pack. This means that the desired item model should be specified in the shared:custom resource location.
For example, if I wanted to have a custom model named "witherbuster", I would need to make sure the file ./assets/shared/items/custom.json looked something like this:
{
"model": {
"type": "minecraft:select",
"property": "minecraft:custom_model_data",
"cases": [
{
// If the "witherbuster" string is present, give
// the item the witherbuster model
"when": "witherbuster",
"model": {
"type": "minecraft:model",
// Example location
"model": "location:item/witherbuster"
}
}
]
}
}
This datapack always assumes that shared:custom is a "select" type, and so only provides string values for the minecraft:custom_model_data property.
To set the custom model data, hold a named paper in your offhand and run the following command:
trigger custom_model
This will set model string of the mainhanded item to the name of the paper, which should match a string in the resource pack.
To remove a custom model, hold the item in your mainhand and run
trigger remove_model
This should revert the items model to its id. Currently, additional testing is needed for reliability.
评论 0
登录后参与评分
还没有评论,来抢沙发吧