I want to create a protection system for a Bedrock Realm with Armor Stands, the armor stand will teleport the players without the tag outside the area (the tag it's like and ID), but here is the problem, with a Book or Another Item I will summon an invisible armor stand and add a tag with the nearest player name.
For example, if the player is named Deku, how can I add the tag "Deku" to him and the armor stand?
/tag @p add @p gives me an error
Also, this is possible on Java? Or, can I use another system on bedrock to allow only the owner to get in?
That's because @p is a selector and it doesn't consider it a string.
For the PvE world I'm in they personally tag each of the players that own a property. Then they just change the property commands to not tp people with the players named tag. Unfortunately through this method you will have to manually add players.
You could do it with scoreboard and assign a unique score for each player. In a separate room you would have a bunch of these preset with an armor stand that tps each time someone has an area in front of the next set of commands. (I know this is hard to picture)
So when the first person gets their area. It would increment scoreboard. TP an armorstand at base to the next set of commands. And clone those commands to where you need them. This is how I would do protections automatically. Before I go into too much more detail I would want to know more.
Is this like a dungeon map and you are trying to prevent players from going into certain parts or is it structured like a property?
Well, Today I make a system to assign a unique ID to players with an armor stand, every time a new player enters the realm, the armor stand increases the score IDcounter by one and this is copied to the player ID score.
Well, now I can summon an armor stand with books and copy the player's ID score to the armor stand and match them.
And, I have another problem, I don't know how to execute a command as the player's armor stand if the ID score isn't the same.
Sorry, I'm not good at English, I don't know if I wrote this comment correctly :'(
I have the unique ID for the player and the armor stand, Now the problem is to compare if the players that are in the area have the same ID, if they ID score don't match, kick them out the zone with /tp command
I don't know if this is possible on Bedrock Edition
Yes, but it's possible to do this automatically comparing the player uniqueID with the armor stand uniqueID and leaving the players who doesn't have the same uniqueID?
For execute the commands I will use the /execute command and I will add a tag for the armor stands with uniqueID, the problem is to check if the player have the same uniqueID of the armor stand(the owner of the area) or if he doesn't have the same uniqueID(a thief) teleport outside the area
It shouldn't tbh. It generates very little unless you're doing a lot of fill and clone commands but the method that you are planning to do I imagine would generate very little and have a very low quantity of use as well.
I'm trying to figure out how to test between 2 entity scores. That way you can increment the scoreboard and assign it to the player and the armor stand and as long as entity1 == entity 2 leave it alone. Else tp them away. It seems like it should be feasible but I'm not 100% sure if it's doable in Bedrock
If you want to do a function with all the ID's presetup and then just assign each player that claims a new house a new ID that will work great too. That's pretty much the way I did it but I was assuming you weren't planning to do functions.
Just make sure you have a radius selector around your target
The ID assing system will give every player a uniqueID, and when a player try to protect his house with the book, the book will summon an invisible armor stand and copy the player's ID to the armor stand and, it's ready
One more question... Just in case... Do you know if it's posible to use selectors for names (in the text, not in the syntax) in Bedrock Tellraw?
I know this is resolved but as a side note, you might want to add some failsafes whenever you are using commands that tp players.
I would suggest adding a line to all your command blocks so that they don't affect you as the host, or alternatively any player that is in creative. That way you are freely able to move into any player's property if you need to for whatever reason.