0

I know how to tp to the nearest fox regardless of what type it is. It would be performed via the following command:

/tp @s @e[type=fox,sort=nearest,limit=1]

However, I was wondering how would you specify that the mob you are typing to must be an arctic fox? I tried implementing what this post was talking about with adding nbt data to it. So I tried the following command:

/tp @s @e[type=fox,nbt={tag:{EntityTag:{Type:snow}}},sort=nearest,limit=1]

But it still didn't seem to work and error out. Could someone give me a correct command to do this?

1 Answer 1

2

Entity tags when referring to actual entities should just be in the root tag, not in any subtags.

Additionally, minecraft: is required when testing for NBT data that has it.

With those issues fixed, the fixed selector looks like this:

@e[type=minecraft:fox,nbt={Type:"minecraft:snow"}]
0

You must log in to answer this question.

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