VirtualChest - Provide virtual chest GUIs for menus like ChestCommands (SpongeForge/SpongeVanilla 1.10.2, 1.11.2, and 1.12.2)

Yes. Checking the balance of the player does not work correctly. Even if the player has money, then with a probability of about 50%, he can not buy the item, because he failed to check the balance.

@Semenkovsky_Ivan Fixed in v1.0.0-beta-6 (maybe).

1 Like

Thank you. Everything works fine.

Yes I was just wondering if there was a way to have the requirements set up as an item

so it would look something like this

Slot11 {
Item {
Count = 1
ItemType = “modcurrency:banknote”
UnsafeDamage = 3
DisplayName = “&aDeposit”
ItemLore = [
“&eClick here to deposit $20 into your account”
]
Requirments: %item_type% = modcurrency:banknote:3
}
PrimaryAction {
Command = “”“console: clear %player_name% modcurrency:banknote 3 1; console: adminpay %player_name% 20 :”""
KeepInventoryOpen = true
}
SecondaryAction = ${?PrimaryAction}
IgnoredPermissions = [
“virtualchest.open.self.deposit”
]
}

1 Like

It would be nice to create a menu and place items in it in the game itself. It is possible without additional settings. It is not very convenient to manually place items in the menu using such a cumbersome config.

2 Likes

Hello, any possibility of creating a menu where I can sell items for other items? For example 1 diamond block per 1 gold, I tried with the format sent up but it did not work, any way to do this in the new version?

Read the wiki…

Can I view items through the database?

(口…口) 你们呐,不要总是想搞个大新闻!

Напишите как продавать вещи? И можно ли команду give заменить на что либо другое (чтобы в чате у игроков не было: “Console: Give [player] fo [item]”), и можно ли вообще подобные сообщения (или команды) как нибудь скрыть от игроков ?

Translate from Yandex.Translate:

Write how to sell things? And is it possible to replace the give command with something else (so that players do not have “Console: Give [player] fo [item]” in the chat), and is it possible to hide such messages (or commands) from the players somehow ?

Вот пример одной из кнопок продаж. Slot0 = [{ # Гранит Item { Count = 1 ItemType = "minecraft:ston - Pastebin.com
А что бы игроки не видели кто и что купил, не надо выдавать им OP.

Я тестировал на себе и я не получал op. Все игроки держутся на luckeperm.

Значит выдал какое-то право, которое позволяет видеть эти сообщения. Советую держать группы в YAML конфигах для удобства, ошибки быстрее замечать будешь.

1 Like

IIUC you need like an else branch, if the requirement isn’t met. CommandUtils allows you to do something like that.

If checks and has money condition.

cu execute if "*cu has money %player_name% 50000" "*say The player has enough money!"
cu execute if not "*cu has money %player_name% 50000" "*say The player doesn't have enough money!"

I don’t know if VirtualChest can execute multiple commands for the primary action. If not, use some kind of alias/command plugin, ofc CommandUtils can do that for you: Aliases.

The Requirements option should be the child of a Slot, so it should be:

Slot0 = [{
  Requirements = "%economy_balance% >= 50000"
  # blablabla
}, {
  # blablabla
}]

@zzzz
Is there a way to make an item cost multiple kinds of items?
Like 2 iron and 4 coal?

Okay, so using cmdbuilder i have a work around for item cost.

can i set an item as a requirement so they cannot click the GUI item without having both items of correct quantity in their inventory?

Would it be possible to add a requirements node to the actions sections in future versions as it is sort of convoluted to have 3 seperate items for each slot. Example shown below.

Slot0 = [
    ${aliases.gravel-item} {
      Requirements = "%economy_balance% >= 5"
      PrimaryShiftAction = {
        Command = "cost: 5; console: give %player_name% minecraft:gravel 64;"
        KeepInventoryOpen = true
      }
      PrimaryAction = {
        Command = "cost: .5; console: give %player_name% minecraft:gravel 1;"
        KeepInventoryOpen = true
      }
    }
    ${aliases.gravel-item} {
      Requirements = "%economy_balance% >= .5"
      PrimaryAction = {
        Command = "cost: .5; console: give %player_name% minecraft:gravel 1;"
        KeepInventoryOpen = true
      }
    }
    ${aliases.gravel-item}
  ]

In our continuing effort to phase out the Plugin Releases category, this thread is being locked because the plugin is already listed on Ore.

Check it out: zzzz / VirtualChest