mojira.dev
MCPE-182124

@n entity selector, selecting the nearest entity, is not available in Bedrock Edition

Summary:
@n entity selector, selecting the nearest entity, is not available in Bedrock Edition. In Java Edition 24w21a it has been introduced, but didn't make its way to Bedrock.
https://www.minecraft.net/article/minecraft-snapshot-24w21a

Added @n entity selector, selecting the nearest entity

  • This functions as @e[sort=nearest,limit=1]

  • Additional requirements may still be provided; for example: @n[type=pig] will select the closest Pig

Steps to reproduce:

  1. Enter a world with cheats on.

  2. Go to chat.

  3. Type:

    /kill @n

Observed results:
There is no @n entity selector in Bedrock.

Expected results:
It should be there in Bedrock as Java Edition has it in Java Edition 24w21a.

Linked issues

Comments 7

Alternatively, you can do /kill @e{type=(name)]

Alternatively, you can do /kill @e{type=(name)]

Confirmed in Android 

As an alternative method you can just use /kill @e [r="radius block you wanted" Ex :5]

As an alternative method you can just use /kill @e [r="radius block you wanted" Ex :5]

Doesn’t @e[c = 1] select the nearest entity?

Nearest entity now have added in 1.21.100.21 Preview, Last week was mentioned in Changelog

Commands

  • Added @n target selector which returns the single closest entity

[Mod] EVGENSYPERPRO

(Unassigned)

1273238

Confirmed

Multiple

vanilla-parity

1.21.10.21 Preview, 1.21.10.20 Preview, 1.20.81 Hotfix, 1.21.30.22 Preview, 1.21.30.21 Preview, 1.21.2 Hotfix

Retrieved