Started by
MrCreeps
on
Topic category: Help with Minecraft modding (Java Edition)
I need help. For a mod I need to measure the amount of blocks walked and the amount of mobs the player killed. Is there a way to measure this or will I have to wait for 1.16 with the attribute command? Thanks
MCreator has procedure blocks that can track scoreboard objectives, if you're familiar with those. These are the two objectives you will need to track to achieve this:
minecraft.custom:minecraft.mob_kills, which increased by 1 whenever the player kills any mob.
minecraft.custom:minecraft.walk_one_cm, counts the number of pixels walked, to get blocks, simply divide this by 16. Note that this does not track distance sprinted.
To get distance sprinted, use minecraft.custom:minecraft.sprint_one_cm
Oh, my apologies. When I tested this I found that you will actually have to divide walk_one_cm and sprint_one_cm by 100, not 16.
Thanks
Where is the block ?
can you go more in depth ? Like, explain what to do for the speed one, I wanna add an effect when a player has walked/sprinted 3000 blocks in total.
Ok, so you just track for when the player has walked/sprinted 300,000 cm using the two objectives I described above.
If you want them to count towards the same thing, you can create a number NBT tag for the player using that procedure block, and use walk_one_cm and sprint_one_cm to tick that up instead.