1

Basically what I want is a scoreboard above players heads that counts how many passive mobs they have killed.

I can make an objective that measures this for each individual mob using the following command:

/scoreboard objectives add <mobname>kills minecraft.killed:minecraft.<mobname> "Animal Kills"

But I can't find a command that lets me add all those scores together, so each player has their own individual animal kills score.

Closest I got was adding two of those objectives into a dummy but that doesn't update with each new kill, and also only works for two, and it seems stupid that I would have to stagger dummy variables like that to get a total for all of them.

Is there some way to add more minecraft.killed:minecraft.(mobname) to the initial objective, or is it simply that limited?

Maybe something similar to this:

/scoreboard objectives add <mobname>kills minecraft.killed:minecraft.(mobname1),minecraft.(mobname2),minecraft.(mobname3) "Animal Kills"

2
  • Hey can you try this command, I've not tested this command so I'm posting this in comment, I'm hopeful this will work but just give it a try. "/scoreboard objectives add MobKills minecraft.killed:passive;scoreboard triggers add KilledPassiveMob minecraft.killed:passive 1;scoreboard displays add MobKillsSidebar sidebar;scoreboard objectives setTrigger MobKills KilledPassiveMob" simply copy and paste it into the chat window and press enter. You will then need to restart the game for the changes to take effect.
    – user307163
    Commented Oct 14, 2023 at 6:25
  • unfortunately doesnt work on java :(, thankyou though
    – Jphw
    Commented Oct 14, 2023 at 9:48

1 Answer 1

1

Unfortunately, this is going to be pretty tedious.

Like you mentioned, there is no scoreboard to track passive mobs. This is what I would do

###################
# load.mcfunction #
###################

# passive mob kill counter
scoreboard objectives add mobtrack.killed_passive_animal dummy

# Arithmatic
scoreboard objectives add mobtrack.inc dummy
scoreboard players set .mobtrack mobtrack.inc 1

scoreboard objectives add mobtrack.killed_cow minecraft.killed:minecraft_cow
# Repeat for every passive mob

###################
# tick.mcfunction #
###################

# Increment passive mob counter for player
execute as @a[scores={mobtrack.killed_cow=1..}] run scoreboard players add 1

# Decrement cow killed counter for player
execute as @a[scores={mobtrack.killed_cow=1..}] run scoreboard players operation @s mobtrack.killed_cow -= .mobtrack mobtrack.inc

# repeat both commands for every mob

Like I said: tedious. But with a good text editor and a whole lot of patience, this is definitely possible.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .