Target in Minecraft problem

Target in Minecraft problem - Free stock photo of accuracy, aim, archery

what I'm asking here will be something that I didn't knew how to solve since I use commands blocks. When I target a player, there is @p, @a, @e, and @r. But what I wanted was that the command block target the player that was, like, the nearest, and then continue to target this one until we say to stop.

What I wrote above is my question; if it requires to use the /scoreboard command, please tell me how to use it.

Thank



Best Answer

You must label the closest player first and then perform actions upon the player with that label.

For example, the following labels the closest living player:

/scoreboard players tag @p add closest

Or if you want to include dead players in selection, you must use @a:

/scoreboard players tag @a[c=1] add closest

Then you can target players with that tag:

/say @a[tag=closest]

And you would remove the tag when finished:

/scoreboard players tag @a[tag=closest] remove closest



Pictures about "Target in Minecraft problem"

Target in Minecraft problem - Man Pulling Arrows from Archery Target Board
Target in Minecraft problem - Free stock photo of accuracy, adult, aim
Target in Minecraft problem - Free stock photo of accuracy, adult, aim



How do you activate a target in Minecraft?

A target is a block that provides a temporary redstone charge when hit by a projectile. It also has utility in redstone circuitry for redirecting redstone dust, making it a useful redstone component.

What do you do with targets in Minecraft?

Target selectors are used in commands to select players and entities arbitrarily, without needing to specify an exact player name or a UUID. One or more entities can be selected with a target selector variable, and targets can be filtered from the selection based on certain criteria using the target selector arguments.



No Target Matched §elector




More answers regarding target in Minecraft problem

Answer 2

I depends on what you are asking here. Are you wanting to tag the nearest player even when they are no longer the nearest player or just continue to tag the nearest player.

For the first one you would just need to run /scoreboard players tag @p add closest, just as Skylinerw suggested.

For the second option you would need to simply set up a clock system and run /say @a. That will continue to display the closest players name. You could also use /title @a title {text:"The nearest player is, ",color:white,extra:[{selector:"@p"}]}, which would display the nearest player's name as a title.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Kampus Production, Kampus Production, Kampus Production, Kampus Production