How can I test my command block contraptions for multiplayer compatibiltiy?
I like making command block contraptions. Occasionally, I make a contraption that I want to use on a multiplayer server (or offer to server operators), but I don't know of a way to test that it'll actually work.
I don't run a server that I can test on, nor do I want to have to get friends/family on this non-existent server in order to do tests and debugging. I also don't have op privileges on another server where I could do these tests (nor would I want to since it could disrupt the server). Finally, I only own one Minecraft account, and I'm not really interested in buying a second account just for the purposes of testing command blocks.
So given that, what's the best way for me to perform my testing and debugging? Is there a simple (and legitimate) way for me to add one or more players that I can control to my otherwise single player command block world?
Best Answer
What you could do to make your testing as real as possible is target entities with the @e
selector in replacement of real players, and try testing your command blocks with entities like villagers.
For an example if you were trying to tp
a player with /tp @p (Coordinates)
You could replace @p or @a
with @e
to teleport entities.
@e
should be effective for most contraptions involving players.
Note: This is how I test my contraptions unless I'm with a friend.
Pictures about "How can I test my command block contraptions for multiplayer compatibiltiy?"
How do you test players with command blocks?
Enable Command BlocksHow do you enable command blocks multiplayer?
To use a command in the game, type a \u201c/\u201d then the command and just hit enter. Otherwise you can just type the command into your server's console without the \u201c/\u201d to run it.How to detect a player using command blocks! | /execute command tutorial for 1.16 Minecraft Java
More answers regarding how can I test my command block contraptions for multiplayer compatibiltiy?
Answer 2
Way #1:
Open the Minecraft launcher 2x. Then log in on one of them into your account, in the other log into a 2nd account: Your friends, let's say. Just get the login info out of him somehow. Then launch bpoth Minecrafts
Way #2:
Try using for example a Pigman as a Player:
instead of @p will be @e[scoreboard-value, c=1]
Instead of scoreboard-value do:
First, create a dummy scoreboard objective:
/scoreboard objectives add selectMe dummy
Then, on a fast redstone clock, give all entities a selectMe score of 0:
/scoreboard players set @e selectMe 0
Give all players and items a selectMe score of 1 with these two command blocks:
/scoreboard players set @e[type=Player] selectMe 1
/scoreboard players set @e[type=Pigman] selectMe 1
Now, you can select them by targeting the closest entity that has a selectMe score of 1:
@e[score_selectMe_min=1,c=1]
scoreboard source here.
Answer 3
For the item aspect, maybe use an entity with accessible items, like a donkey or chest minecart. You will be able to apply inventory changes and see what they do to the inventory. For things like armor or shields being visible, use a zombie, skeleton, or villager, if you are not willing to test on yourself.
If you have an old computer and a second Minecraft account, then you could use that.
Answer 4
Use a demo account to open LAN world, and your account log in
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: RODNAE Productions, RODNAE Productions, RODNAE Productions, RODNAE Productions