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?

  • Try them on yourself and use specific commands with coords and radius so you would not target unwanted players far away
    – BRHSM
    Apr 3 '16 at 7:55
  • It really isn't that hard to run a localhost server - just need java and the server jar. It would require owning multiple accounts though (for multiple clients) unless you're willing to use a cracked client on your own local server (which is a valid option).
    – daboross
    Apr 3 '16 at 9:40
  • @BRHSM: "I also don't have op privileges on another server where I could do these tests". Also, enforcing a radius on every command is at the very least impractical, and sometimes impossible.
    – MBraedley
    Apr 3 '16 at 13:28
  • 1
    @DaboRoss: The issue isn't running the server, the issue is that there's only one player (me) on that server.
    – MBraedley
    Apr 3 '16 at 13:29
  • 1
    Use two computers? Apr 3 '16 at 15:09

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.

  • This is a good idea, but sometimes I need two or more players that are under direct control. For instance, clearing items from an inventory. Two actual players need to be present for testing, and I don't want to have to bug a friend to do debugging.
    – MBraedley
    Apr 3 '16 at 13:31
  • For replacing @p, don't use @e without extras. Use @e[c=1], because that targets only the nearest entity, like @p targets only the nearest player. For simulating @a, which targets all players, @e without a c condition, which targets all entities, works fine though.
    – Egor Hans
    Aug 17 '17 at 15:40
  • As of the issue, you can always use entities with inventory. Say, a chest minecart. Or do you want to test commands that are actually unusable on entities other than players, like playing sounds?
    – Egor Hans
    Aug 17 '17 at 15:50

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:


scoreboard source here.

  • See my comment on @Jason_'s answer.
    – MBraedley
    Apr 3 '16 at 13:32

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.

  • For the second point, he explicitly said the latter is not the case. And the first point on its own could right as well be a comment on the topmost answer. Like the one I added before I saw your answer.
    – Egor Hans
    Aug 17 '17 at 15:52

Use a demo account to open LAN world, and your account log in

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.