ShopChest 是一款简单易用的箱子商店插件。玩家通过点击箱子即可进行交易,而商店管理则通过命令完成。商店上方会显示一个全息投影,展示商店的各种信息,其显示格式可通过配置文件自定义。插件提供了大量可配置选项,并支持多种保护插件的高级集成。
- 右键点击箱子:从商店购买物品。- 左键点击箱子:向商店出售物品。- (此操作可在配置文件中反转)- 使用命令 `/shop info`。- 或用配置中设定的物品(默认为木棍)点击箱子。主命令名称可在配置中自定义,此处以 /shop 为例。
<buy-price>:玩家从商店购买物品的价格。<sell-price>:玩家向商店出售物品的价格。/shop create <amount> <buy-price> <sell-price> – 创建一个普通商店/shop create <amount> <buy-price> <sell-price> admin – 创建一个管理员商店/shop remove – 移除一个商店/shop info – 查看商店信息/shop open – 打开一个商店/shop removeall <player> – 移除某玩家的所有商店/shop reload – 重载商店与配置文件/shop config (set|add|remove) <property> <value> – 设置配置值/shop update – 检查插件更新shopchest.* – 所有权限shopchest.create – 创建商店(默认允许)shopchest.create.admin – 创建管理员商店shopchest.create.protected – 在被保护的箱子或区域内创建商店shopchest.extend.other – 扩展他人商店shopchest.extend.protected – 在被保护的箱子或区域内扩展商店shopchest.buy – 购买物品(默认允许)shopchest.sell – 出售物品(默认允许)shopchest.external.bypass – 在被禁止使用商店的区域内使用商店shopchest.openOther – 打开他人商店shopchest.remove.other – 移除他人商店shopchest.remove.admin – 移除管理员商店shopchest.reload – 重载插件shopchest.config – 修改配置shopchest.update – 检查更新shopchest.notification.update – 接收更新通知ShopChest 发布于 CodeMC 的 Maven 仓库。请将 {version} 替换为具体版本号。
<repositories>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.epiceric</groupId>
<artifactId>ShopChest</artifactId>
<version>{version}</version>
<scope>provided</scope>
</dependency>
</dependencies>repositories {
maven {
url = "https://repo.codemc.io/repository/maven-public/"
}
}
dependencies {
compileOnly 'de.epiceric:ShopChest:{version}'
}@EventHandler(ignoreCancelled = true)
public void onShopBuySell(ShopBuySellEvent event) {
Shop shop = event.getShop();
long worldTime = shop.getLocation().getWorld().getTime();
if (worldTime > 20000 || worldTime < 7000) {
event.setCancelled(true);
event.getPlayer().sendMessage("You can only use a shop between 7am and 8pm.");
}
}ShopProduct product = new ShopProduct(itemStack, amount);
Shop shop = new Shop(shopChest, vendor, product, location, buyPrice, sellPrice, shopType);
boolean success = shop.create(true); // 创建商店全息投影和悬浮物品,true 表示将错误日志输出到控制台
if (success) {
// 将商店添加到服务器商店列表,true 表示同时存入数据库
shopChest.getShopUtils().addShop(shop, true, new Callback<Void>(shopChest) {
@Override
public void onResult(Void result) {
// 可选:处理成功情况
}
@Override
public void onError(Throwable throwable) {
// 可选:处理错误情况
}
});
}Collection<Shop> shops = shopChest.getShopUtils().getShops();
Shop shop = shopChest.getShopUtils().getShop(location);int shopAmount = shopChest.getShopUtils().getShopAmount(player);
int shopLimit = shopChest.getShopUtils().getShopLimit(player);use-shop 和 use-admin-shop(默认均为拒绝或仅所有者可用)。shopchest.external.bypass,以允许他们在禁止使用商店的区域内使用商店。create-shop(默认拒绝)。create-shop 设置)的玩家才能创建。debug.txt 文件中查看具体原因。shopchest.create.protected 可允许玩家在任何受保护的箱子或区域内创建商店。- 备份已修改的条目,删除原文件,让插件生成新文件后再将条目粘贴回去。- 或按照正确格式将缺失的翻译值添加到现有语言文件中。---
友情链接: 网易我的世界 | 泰拉瑞亚 | ocent云计算 | 米饭Minecraft插件文档 | 友链合作
历史访问人次:3,030,426 | 今日访问人次:14,554 | 昨日访问人次:11,147
独立 IP:5,075 | 最近24小时独立访客:6,302
Copyright © 2019-2026 我的世界服务器列表站. All rights reserved.
❤ Powered by GermMC 京ICP备17023959号-6