How do i check how many mob kills a player has?

Started by WatermelonFrogy on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i check how many mob kills a player has?

I'm making a mod that adds advancements.

I want to make an advancement that you get from killing the ender dradon without killing anything else.

How would i check if a player had killed any mobs so i can add this?

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Must be good at proceduring…
Tue, 10/26/2021 - 10:50

Must be good at proceduring but this can be done

Entity dies if is source entity player then  set NBT "name" to Get nbt "name" + 1

 

When kill ender dragon if NBT "name" = 0 then add advancements

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
while that would work, NBT…
Tue, 10/26/2021 - 15:23

while that would work, NBT can cause a lot of problems, you might want to make a global variable player_persistent

also nbts reset when you die, so use variables

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how would i use varibles? i…
Wed, 10/27/2021 - 07:05

how would i use varibles? i've never attempted because I've never needed to.
Also i want the mod to work in multiplayer if that changes anything.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you need to learn how to…
Wed, 10/27/2021 - 07:12

If you need to learn how to use Variables just check forum and tutorials.

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I made this but it only sets…
Wed, 10/27/2021 - 07:45

MobKillsProcedure
I made this but it only sets it to 1 and never goes higher.

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
after staring at it for a…
Wed, 10/27/2021 - 07:53

after staring at it for a couple minutes i can confirm i am retarded.

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you accidentally put event…
Wed, 10/27/2021 - 15:39

you accidentally put event target entity

everything should be source entity.