#Advancement Leaderboard

1 messages · Page 1 of 1 (latest)

tawdry leaf
#

This is for a minigame leaderboard the hiders get points by surviving and get a point after set intervals whereas the seekers get points for kills I've made it using advancements so when I player dies the points update they also update when I run the function to go back to the lobby but they're not updating both the seekers and hiders aren't getting points which is suprising as the points system for the seekers is incredibly simple...

What I need help with:

  • Fixing the leaderboard so it updates when it should
  • Adding a feature (not attempted yet) so when hiders are dead they can't recieve the points for survival

I will paste all necessary code in order of activation

mild hullBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

                        🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you


                        
                        ✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
tawdry leaf
#
{
    "criteria": {
      "requirement": {
        "trigger": "minecraft:entity_killed_player"
      }
    },
    "rewards": {
      "function": "event:allocatepoints"
    }
  }
#
#allocate_points
scoreboard players operation @a[team=Seeker] Leaderboard += @a[team=Seeker] Seeker
scoreboard players operation @a[team=Hider] Leaderboard += @a[team=Hider] Hider
scoreboard players reset @a Hider
scoreboard players reset @a Seeker
#
#seeker_timeout
teleport @a[team=Seeker] 202 56 -332
scoreboard objectives add GamePlay dummy
scoreboard players set $dummy GamePlay 1
scoreboard players reset $time GameTime
playsound entity.ender_dragon.growl master @a 98 80 -331 99999 1 1
title @a times 20 0 20
title @a subtitle ["",{"text":"The ","color":"dark_red"},{"text":"Seeker","bold":true,"color":"dark_red"},{"text":" Has Been Released!","color":"dark_red"}]
title @a title ["",{"text":"Prepare ","bold":true,"color":"dark_red"},{"text":" Yourself!","color":"dark_red"}]
#
#hider_timer
scoreboard objectives add GameTime dummy
scoreboard objectives add Hider dummy
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 60 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 120 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 180 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 240 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 300 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 300 run function event:lobby
scoreboard players add $time GameTime 1
schedule function event:hidertimer 1s
#
#seeker_chosen
team add Seeker
team join Seeker @s
give @s minecraft:stick{display:{Name:'{"text":"Tag-A-Tron 6000"}'},AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:2048,Operation:0,UUID:[I;144121,147834,159638,178100],Slot:"mainhand"}]} 1
schedule function event:seeker_title 10
scoreboard objectives add Seeker playerKillCount
team modify Hider color aqua
team modify Seeker color dark_red
schedule function event:seeker_timeout 1200
#

Seeker points are given in seeker_chosen and are allocated in allocate_points
Hider points are given in hider_timer and are allocated in allocate_points

#

I forgot to mention that the advancement is revoked in death_randomiser which is triggered by another advancement and is used for custom death messages (irrelevant but yeah)

sonic wingBOT
# tawdry leaf ``` #allocate_points scoreboard players operation @a[team=Seeker] Leaderboard +=...
#allocate_points
scoreboard players operation @a[team=Seeker] Leaderboard += @a[team=Seeker] Seeker
scoreboard players operation @a[team=Hider] Leaderboard += @a[team=Hider] Hider
scoreboard players reset @a Hider
scoreboard players reset @a Seeker
sonic wingBOT
# tawdry leaf ``` #seeker_timeout teleport @a[team=Seeker] 202 56 -332 scoreboard objectives a...
#seeker_timeout
teleport @a[team=Seeker] 202 56 -332
scoreboard objectives add GamePlay dummy
scoreboard players set $dummy GamePlay 1
scoreboard players reset $time GameTime
playsound entity.ender_dragon.growl master @a 98 80 -331 99999 1 1
title @a times 20 0 20
title @a subtitle ["",{"text":"The ","color":"dark_red"},{"text": "Seeker", "bold": true, "color": "dark_red"},{"text": " Has Been Released!", "color": "dark_red"}]
title @a title ["",{"text":"Prepare ","bold":true,"color":"dark_red"},{"text": " Yourself!", "color": "dark_red"}]
sonic wingBOT
# tawdry leaf ``` #hider_timer scoreboard objectives add GameTime dummy scoreboard objectives ...
#hider_timer
scoreboard objectives add GameTime dummy
scoreboard objectives add Hider dummy
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 60 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 120 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 180 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 240 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 300 run scoreboard players add @a[team=Hider] Hider 1
execute if score $dummy GamePlay matches 1 run execute if score $time GameTime matches 300 run function event:lobby
scoreboard players add $time GameTime 1
schedule function event:hidertimer 1s
sonic wingBOT
# tawdry leaf ``` #seeker_timeout teleport @a[team=Seeker] 202 56 -332 scoreboard objectives a...
#seeker_timeout
teleport @a[team=Seeker] 202 56 -332
scoreboard objectives add GamePlay dummy
scoreboard players set $dummy GamePlay 1
scoreboard players reset $time GameTime
playsound entity.ender_dragon.growl master @a 98 80 -331 99999 1 1
title @a times 20 0 20
title @a subtitle ["",{"text":"The ","color":"dark_red"},{"text": "Seeker", "bold": true, "color": "dark_red"},{"text": " Has Been Released!", "color": "dark_red"}]
title @a title ["",{"text":"Prepare ","bold":true,"color":"dark_red"},{"text": " Yourself!", "color": "dark_red"}]
sonic wingBOT
# tawdry leaf ``` #seeker_chosen team add Seeker team join Seeker @s give @s minecraft:stick{d...
#seeker_chosen
team add Seeker
team join Seeker @s
give @s minecraft:stick{display: {Name: '{"text":"Tag-A-Tron 6000"}'}, AttributeModifiers: [{AttributeName: "generic.attack_damage", Name: "generic.attack_damage", Amount: 2048,Operation: 0,UUID: [I; 144121,147834, 159638,178100], Slot: "mainhand"}]} 1
schedule function event:seeker_title 10
scoreboard objectives add Seeker playerKillCount
team modify Hider color aqua
team modify Seeker color dark_red
schedule function event:seeker_timeout 1200
mild hullBOT
# mild hull <@&1201956957406109788>

<@&935561184806060073> <@&1202694677766348840>

**🙇 Helpers Arise!**

Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)

rare bison
#

which function is does what

#

like there names

tawdry leaf
#

I put that in the comment at the top of each script

#

But the scripts should be in order of activation so you should be able to follow it down

rare bison
#

hmmm I'm not seeing any code to update the scores

tawdry leaf
tawdry leaf
tawdry leaf
rare bison
#

why don't just send the datapack then we can help pretend to want to fix your bug better

tawdry leaf
#

Sounds about right

#

jks

mild hullBOT
#
Result of analysis

I found 1 issues with the structure of your datapack.

  • I couldn't find the namespace minecraft. It isn't required, but 90% of datpacks do need to have it. If you don't use tick/load functions or you don't need to change vanilla data, then disregard this.
tawdry leaf
#

hushhhhhhh

#

lmao

little plaza
#

that was me

tawdry leaf
#

oh hi

#

we meet yet again lmao

#

it's me the most frequent visitor to #1051225367807000706

little plaza
#

it’s fineeeee

#

anyway I can’t help rn bcuz I have yet another appointment and I gotta leave

tawdry leaf
#

ah well enjoy

little plaza
#

would you mind explaining your problem rq tho

tawdry leaf
#

in short the leaderboards don't update

#

when they're supposed to

little plaza
#

when are they supposed to?

tawdry leaf
#

and there's nothing in the log

tawdry leaf
little plaza
#

I suggest you try and debug with say commands in the meantime

tawdry leaf
#

i will, thanks

little plaza
#

if you still need help when I’m back I can give you time then

rare bison
#

since this is obviously a bug:

  1. write tests
  2. run tests
  3. know where bug occurred
  4. fix bug
dusty pebble
#

what is that role you have

rare bison
tawdry leaf
tawdry leaf
#

@little plaza if you have time could you look through it I tried for an hour or two it doesn’t work and I actually think it made it worse bc more things broke so I reverted it to those backup shown above

#

Sorry for the ping also btw

little plaza
#

<@&935561184806060073> ^^^^

spice moon
#

I'm not in a position to right now unfortunately

little plaza
#

ok so lemme get this straight - you need to add points to the seeker when they kill any player?

#

or at least when any player dies

little plaza
#

That being said, why are there multiple scoreboards? surely you just need one to keep track of the score?

#

Or am I mistaken? I don’t really understand what you’re tryna do

tawdry leaf
tawdry leaf
tawdry leaf
#

Acc tbf I don’t need the seperate hider scoreboard but I do need seeker because it’s not dummy it’s playerkills

tawdry leaf
#

FIXED IT

little plaza
#

omg nice