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

Started by WatermelonFrogy on Tue, 10/26/2021 - 10:34

Topic category: Help with modding (Java Edition)

Last seen on 02:46, 5. Dec 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How do i check how many mob kills a player has?
Tue, 10/26/2021 - 10:34

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?

Last seen on 09:30, 5. Dec 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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

Last seen on 06:48, 4. Dec 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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

Last seen on 02:46, 5. Dec 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 09:30, 5. Dec 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 02:46, 5. Dec 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 02:46, 5. Dec 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 06:48, 4. Dec 2021
Joined Oct 2020
Points:

User statistics:

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

you accidentally put event target entity

everything should be source entity.