The armorstands in Hazelguard that display recent donators are a bit shite. They work with command blocks. The webstore actually spawns a redstone block to activate them lol
Whenever a player buys something in the webstore, a command is executed that destroys the oldest donator-armorstand (n.5 in picture below), moves the existing armorstands one spot (1->2, 2->3, 3->4, 4->5) and places a new one in the beginning (n.1) (kind of like a fixed size queue).
Problem: When a player buys multiple packages at once (e.g. x3 player heads), this process is executed 3 times at once. Meaning it spawns 3 armorstands and tries to move the existing ones 3 times. But since it happens all at once, it fails miserably; it places them all at spot 1 and fails to move the others.
Fix:
[x] Make 5 persistent armorstands with custom tags. Instead of moving the armorstands, it might be smarter to just change their name and helmet item slot. So they will remain in the same spot.
[x] Make a command that takes a playername and chat-color as input, something like /adddonatorstand Wout gold.
[x] When the command is executed, set the name and helmet of the last armorstand to the ones from the fourth armorstand. Then the name and helmet of the fourth armorstand to the ones of the third, and so on.
[x] Finally, update the first armorstand according to the given command params. The playername is used to name the armorstand and to get the player's head. The color is the color of the name of the armorstand.
[x] Set a cooldown per player for the command of 15 seconds or something. This means when the store executes the command 3 times at the same time, it only has effect once.
Can also use a script, whatever would be easier.
The command should ideally be able to handle two different players buying something at the same time, but the odds of this happening are so small that it's not a huge problem if this isn't considered.
The armorstands in Hazelguard that display recent donators are a bit shite. They work with command blocks. The webstore actually spawns a redstone block to activate them lol Whenever a player buys something in the webstore, a command is executed that destroys the oldest donator-armorstand (n.5 in picture below), moves the existing armorstands one spot (
1->2
,2->3
,3->4
,4->5
) and places a new one in the beginning (n.1) (kind of like a fixed size queue). Problem: When a player buys multiple packages at once (e.g. x3 player heads), this process is executed 3 times at once. Meaning it spawns 3 armorstands and tries to move the existing ones 3 times. But since it happens all at once, it fails miserably; it places them all at spot 1 and fails to move the others.Fix:
/adddonatorstand Wout gold
.Can also use a script, whatever would be easier. The command should ideally be able to handle two different players buying something at the same time, but the odds of this happening are so small that it's not a huge problem if this isn't considered.