This commit is contained in:
小白
2022-09-11 19:14:27 +08:00
parent 9002093db4
commit 4832b4b18d
2 changed files with 3 additions and 4 deletions
@@ -29,8 +29,8 @@ interface Item {
fun update(player: Player): ItemStack
fun exeCommands(player: Player, amount: Int) {
for (a in 1..amount){
commands.map { it.replace("%player%", player.name) }.forEach { command ->
commands.map { it.replace("%player%", player.name).replace("\${amount}", amount.toString()) }
.forEach { command ->
if (command.startsWith("[tell] ")) {
player.sendMessage(command.substring(7).colored())
} else if (command.startsWith("[console] ")) {
@@ -50,7 +50,6 @@ interface Item {
player.closeInventory()
}
}
}
}
}
+1 -1
View File
@@ -67,4 +67,4 @@ items:
# 关闭此选项 可只执行命令 不给原版物品
vanilla: false
commands:
- '[console] ia give %player% 物品'
- '[console] ia give %player% 物品 ${amount}'