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

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