VirtualChest - A sponge plugin providing virtual chest GUIs for menus like ChestCommands


#82

I will get back to you after work with the stack trace.
Going to try on vanilla server first.


#83

@zzzz
Here is my log; https://drive.google.com/file/d/1dHXrFWGYR56w8CaIb9h4QRwQWT3YUgew/view?usp=sharing
the only plugins installed are Placeholderapi v4.5.1 and virtualchest v1.0.0-rc1


#84

[21:55:55] [Server thread/ERROR] [Sponge]: Could not pass GamePreInitializationEvent$Impl to Plugin{id=placeholderapi, name=PlaceholderAPI, version=4.5.1, description=An API for all of your placeholders., authors=[rojo8399, Wundero], source=C:\Users\Mimir\Desktop\Test\mods\plugins\PlaceholderAPI-4.5.1.jar} ninja.leaping.configurate.objectmapping.ObjectMappingException: No zero-arg constructor is available for class class me.rojo8399.placeholderapi.impl.configs.Messages$Message but is required to construct new instances!

@hellbringer616 The exception is caused by PlaceholderAPI first and then VirtualChest could not acquire the PlaceholderService instance, so the problem seems to be caused by PlaceholderAPI.


#85

Downgraded to PlaceholderAPI v4.4 and it appears to no longer throw errors!
Thanks!


#86

Try this build instead: https://github.com/randombyte-developer/PlaceholderAPI/releases/tag/v4.5.1

I discovered that the official build is somehow faulty, I just compiled the official source myself and it works for me.


#87

Sweet, i’ll try giving it an update!

@zzzz
is there a way to make commands cost multiple items? I am trying to build a crafting menu however this code is invalid:

Slot1 {
Item {
Count = 1
ItemType = “conquest:steel_ingot”
UnsafeDamage = 0
DisplayName = “Smelt &e&lSteel”
ItemLore = [
“Cost 2 &e&lIron Ore”
“Cost 4 &e&lCoal”
]
}
PrimaryAction [{
Command = “cost-item: 2; console: give %player_name% conquest:steel_ingot 1”
HandheldItem {
SearchInventory = true
ItemType = “minecraft:iron_ore”
UnsafeDamage = 0
Count = 2
}
KeepInventoryOpen = true
}, {
Command = “cost-item: 4”
HandheldItem {
SearchInventory = true
ItemType = “minecraft:coal”
UnsafeDamage = 0
Count = 4
}
KeepInventoryOpen = true
}]
}

even if i remove the [ ] i still get an error


#88

I found that using

PrimaryAction = [{
Command = “cost-item: 2; console: give %player_name% conquest:steel_ingot 1”
HandheldItem {
SearchInventory = true
ItemType = “minecraft:iron_ore”
UnsafeDamage = 0
Count = 2
}, {
Command = “cost-item: 4”
HandheldItem {
SearchInventory = true
ItemType = “minecraft:coal”
UnsafeDamage = 0
Count = 4
}]

stopped the error and allowed the code to process. but it only took the first item…
Is there any plan to add multiple item costs?


#89

How do you get multiple currencies? It says on may 17 update you got rid of currency_name and replaced with requirements. But it doesnt tell how to do it now with requirements.

Figured out how to use multiple currencies.

Use
cost: totaleconomy:CURRENCYNAME:10; &
Requirements = “%economy_balance_CURRENCYNAME% >= XX”


#91

@Turner

The Requirements is based on replacing placeholder to its values:
https://github.com/ustc-zzzz/VirtualChest/wiki/3-Slots-And-Requirements#requirements

Just use /papi parse to check if a placeholder is available and retrieve its value:
https://github.com/rojo8399/PlaceholderAPI/wiki/Commands-and-Permissions


#92

how do i set more than one requirement because im trying to have the money requirement and the permission requirement when i have it set like this https://gyazo.com/b9476e7d96c44e3434bf9c42f7fcd747 it will put the permission requirement but not the money requirement so players could get it for free


#93

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?
This would be in addition to item cost; so it would cost 4 coal to use, but you have to have 2 iron otherwise it won’t run as well.


#94

@MobKiller The Requirements is based on JavaScript. So just use && for concatenating requirements:

Requirements = "%economy_balance% >= 1700000 && player.hasPermission('commonplusplus.use')"

#95

Thanks :smiley:


#96

Any conversion tool? Doing this by hand with many menus is tedious enough. I dont understand the switch in formats and not a way to convert the conf files?


#97

Is there a support discord for quick support?


#98

Hello,
How do i define the nbt if an item for item cost? I would like to make this command cost a custom item i have made with itemizer.

I am using the item Coal as the base, but i want it to be called “Copper Ore” and only accept it if it is called “Copper Ore”


#99

So digging deeper into the Wiki there is an option for “UnsafeData”
Which appears to be for the NBT information right?
using

UnsafeData {
     Name = "Copper Ore"
}

I am not getting any functionality from it :frowning:


#100

Would it be possible to add a requirements check to the actions sections in future versions as it is sort of convoluted to have 3 seperate items for each item slot just to have a buy/sell.

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}
  ]

#101

ByteItem support is added in this PR: https://github.com/ustc-zzzz/VirtualChest/pull/82

Let’s hope it’ll be accepted.


#102

Sorry, there isn’t. Discord is blocked in my network environment so I hardly open Discord and read messages from it. The place I mostly concern is GitHub issues and almost all issues will attract my attention in time, although I may not be able to respond in time because of some other things.

However…if you really need it, I do have a public discord account: Yanbing Zhao#5112. But as what I just said, a message from Discord may not be seen by me until a few days later.