Recent Discussions

Give money on completing an advancement

Unanswered
Cinnamon posted this in #questions
Messages16 messages
Views0 views
CinnamonOP
Hello, I'm using EssentialsX and Vault to manage an economy. I'm trying to give players money after they complete an advancement, but I can't seem to figure out how.
I can target individual players, but that doesn't work in the context of a function. * just gives money to everyone, and ** gives money to everyone including non-online players.
/sudo doesn't work because it also requires a player name field.
How do I insert the player name in a function file, or is this just impossible without another additional plugin? If it's the latter, what plugin should I use?
CinnamonOP
Ah, sorry! 1.21.10. I'm currently testing on paper version 105.
Philippine Crocodile
there are plugins that add @ selectors for essentials commands
if you get that to work, you can just use @s like normal
(or just make a simple plugin that adds command that takes player selector argument and amount of money and uses vault api to give the money)
CinnamonOP
Something like this work? I have no idea what's up to date
https://modrinth.com/plugin/essxselectors
Yakutian Laika
always check the version history, no activity after 1.21.5
CinnamonOP
Seems like no one else has any currently updated plugin then... What's the feasibility of doing the other method? Any other workarounds?
CinnamonOP
I'm making custom Advancements using the vanilla method of datapacks. Advancements via datapacks can specify a reward when completed by running a function file. For instance, that function file could specify a give command using the Minecraft selectors and execute (@a, @p, etc).
The problem is when I try to connect it to giving money using essentials/vault, the eco command specifically requires a player name. The other two things you can put in place of a player name give it to all players. I want specifically, the player running the function file through achieving the advancement to get the money and no one else, once.
If I set it to, say, run /eco give Pretender8, then even if a second player got the achievement it would give... Me money. Which is not what I wanted.
Original message was deleted
CinnamonOP
You can only give money to someone with a name in the field, it's the first required field, then amount
Original message was deleted
CinnamonOP
I've heard bad things about skript and server performance, are we sure there's no other way
North Pacific hake
If its between learning skript or learning basic plugin dev I'd definitely personally recommend going the plugin route
CinnamonOP
Any hints on where to go from there? I'm assuming it would have to hook on to vault, but other than that no idea
North Pacific hake
Loading...