Simple JSON Villager Trades
正如字面意思一样,这是一个小巧的、可嵌入(jij)/独立的库,用于通过数据包修改或添加商人交易。
面向数据包开发者
你可以通过 data/<namespace>/trade_offers/ 目录下的 JSON 文件来修改商人交易。
例如:
{
"__COMMENT": "This adds a ruined portal map to the Cartographer's trades.",
"profession": "minecraft:cartographer",
"replace": false,
"offers": {
"apprentice": [
{
"type": "minecraft:sell_map",
"price": 5,
"name_key": "filled_map.ruined_portal",
"feature_tag": "minecraft:ruined_portal",
"icon": "target_x",
"max_uses": 10,
"experience": 2
}
]
}
}
有关更多教程和修改商人交易的详细信息,请参阅 wiki。
兼容性
SJVT 使用 Minecraft 硬编码的交易映射表作为基础,供数据包在其之上构建,因此它应该能与大多数模组兼容,即使那些添加了新村民职业的模组也不例外。
你还可以通过运行 sjvt:build 命令将硬编码的映射表(包括非原生支持的模组)导出为数据包。
面向模组开发者
你可以使用以下仓库和依赖项在 build.gradle 中包含该模组(其中 [TAG] 为最新版本):
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
modImplementation include("maven.modrinth:sjvt:[TAG]") // To include (jij) in your mod
modImplementation "maven.modrinth:sjvt:[TAG]" // To require the mod to be installed seperatly
}
自定义交易提供工厂
要创建交易提供工厂,请实现 SerializableTradeOfferFactory 接口。
然后将编解码器注册到 TradeOfferFactories.TRADE_OFFER_FACTORY_REGISTRY 注册表中。
你还可以使用 CodecHelper 类中的方法和字段来辅助创建编解码器。
然后参见“面向数据包开发者”部分
Simple JSON Villager Trades
As simple as it sounds, a small jij-able/standalone library to modify/add merchant trades via datapacks.
For Datapackers
You are able to modify merchant trades through JSON files the data/<namespace>/trade_offers/ directory.
For example:
{
"__COMMENT": "This adds a ruined portal map to the Cartographer's trades.",
"profession": "minecraft:cartographer",
"replace": false,
"offers": {
"apprentice": [
{
"type": "minecraft:sell_map",
"price": 5,
"name_key": "filled_map.ruined_portal",
"feature_tag": "minecraft:ruined_portal",
"icon": "target_x",
"max_uses": 10,
"experience": 2
}
]
}
}
For more tutorials and more information on modifying merchant trades, see the wiki.
Compatibility
SJVT uses Minecraft's hardcoded trade map as a base for the datapacks to build on top of, so it should work with most mods, even those who add new villager professions.
You can also export the hardcoded map (including non-native support mods) as a datapack by running the sjvt:build command.
For Mod Developers
You can include the mod using the following repository and dependency in your build.gradle (where [TAG] is the latest version):
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
modImplementation include("maven.modrinth:sjvt:[TAG]") //To include (jij) in your mod
modImplementation "maven.modrinth:sjvt:[TAG]" // To require the mod to be installed seperatly
}
Custom Trade Offer Factories
To create a trade offer factory, implement the SerializableTradeOfferFactory interface.
Then register the codec to the TradeOfferFactories.TRADE_OFFER_FACTORY_REGISTRY registry.
You can also use methods and fields in the CodecHelper class to assist in the creation of codecs.
Then see 'For Datapackers'
下载 SimpleJsonVillagerTrades
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 SimpleJsonVillagerTrades
下载 SimpleJsonVillagerTrades
下载 SimpleJsonVillagerTrades
下载 SimpleJsonVillagerTrades
下载 SimpleJsonVillagerTrades
下载 SimpleJsonVillagerTrades
下载 SimpleJsonVillagerTrades
下载 SimpleJsonVillagerTrades
更新至 1.20-pre1
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧