2

I'll be straight here. I have tried various stupid things, but none seem to be working. What I have for now with a Mob-Spawning kit:

  • Set a command block that tests for any zombie with the name ZombieMaker.

  • Set up command block that kills named zombie.

  • Set it up so that ZombieMinion spawns when ZombieMaker spawns, just before it dies.

    That was background info, because then people start complaining that I haven't tried it out myself. And yes, I have searched for help. The question is:

How do I spawn that Zombie (ZombieMinion) a few blocks away to the direction I, or any player with that kit, is looking at (if possible, where the player was pointing at can also help)?

2 Answers 2

2

First, set a row of Command blocks plugged into a clock, testing for the Player approximate roation:

rotation can be tested for using the target selector arguments ry, rym, rx, and rxm, denoting the maximum and minimum view angle in the horizontal (east, south, etc.) and vertical (up, down) direction, respectively.

For example, to test for someone looking South (=0±22), use

testfor @a[ry=22,rym=-22]

(source here)

Then, for each command block set a command to be triggered if the output is true:

/execute @a[SomeSelector] ~ ~ ~ summon Zombie x y z {YourNBTTag}

Instead of x y z put the relative coordinates you want (for each CMD block pair a different set).
That would be, 4 * 2 or 8 * 2 CMD blocks altogether, depending on the accuracy you want.

0

The generic command summon an entity is:

/summon <EntityName> [x] [y] [z] [dataTag]

So in order to summon a zombie in your current location you should type:

/summon Zombie ~ ~ ~

You could also try adding to the current location /summon Zombie ~1 ~ ~

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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