0

So I am trying to make a dropper pointing upwards with a specific pattern of blocks inside turn into a building. I have made something that kind of works, but it doesn't completely work. Right now I have a repeating command block, always active pointing into a conditional chain command block, always active. The repeating command block has /execute @a ~ ~-1 ~ testforblock ~ ~ ~ dropper 1 {data tag} and the chain command block has /execute @a ~ ~-1 ~ clone x1 y1 z1 x2 y2 z2 ~ ~ ~ Now the issue I am having is when I go over the dropper the building appears, however the building also appears by my friend who is also playing on the world. So how could I modify the commands and/or add more commands to make it single only the person on the dropper?

2 Answers 2

0

New answer for 1.13, it's actually surprisingly easy in the new command system:

/execute as @a at @s if block ~ ~-1 ~ dropper{Items:[{Slot:4b,id:"minecraft:stone",Count:1b}]} run say spawn stuff, this gets executed at the player's location

This is what the parts do:

  • /execute as @a at @s shifts the command execution to every player. I'm not sure why as is needed, maybe the if requires it.
  • if block ~ ~-1 ~ tests the block under the player for being…
  • dropper{Items:[{Slot:4b,id:"minecraft:stone",Count:1b}]} is whatever block and data you want. You can also specify block states in [] between the name and the NBT.
  • run: All the execute stuff is over, now perform the real command.
  • You can replace say spawn stuff, this gets executed at the player's location with your structure spawning command, of course.

You'll also have to make sure that the structure doesn't get spawned repeatedly of course, but that's a different question. Depending on your system, you either don't care or you tag the player or you put a marker armour stand there or whatever.

0

If the command blocks are near the dropper, you can use @p instead of @a.

If you know the coordinates of the dropper, you can just use /clone x1 y1 z1 x2 y2 z2 x3 y3 z3, where x3 y3 z3 are the coordinates of the dropper (or whatever nearby coordinates you need), and get rid of execute.

If you want this for multiple droppers in arbitrary locations, you have to give every player on top of a dropper a tag or whatever trigger your system has, then base the remaining commands on that.

If you need a completely perfect system, one that works for multiple players in the same tick, spawning different structures at arbitrary locations all at once… Then you probably need an ID system for players, then base your other commands on the currently structure spawning player IDs and it all gets pretty complicated. But usually one of the other solutions should work.

7
  • @p does not work because they're are multiple players, the dropper coordinates are not locked, and will depend on where the player places the dropper. As for the third one you're going to have to explain what you mean.
    – GigaByte
    Commented Aug 31, 2018 at 0:52
  • For the last part, I originally thought you would need an ID system (there are many systems out there to give every player an ID in a scoreboard), but it should probably also work without, at least in 1.13. I'm not quite sure yet whether it's possible in 1.12 without giving every player an ID and then looping over those IDs. You play in 1.12, right? Is there a specific reason for that or could you also just as well switch to 1.13? There it's actually just a single command per structure type. Commented Aug 31, 2018 at 8:38
  • The reason I play in 1.12 is because lots of commands were changed up, and another thing, which I have working perfectly in 1.12, which allows me to make custom crafting recipies and craft with a dropper, does not work in 1.13 due to the changes in /execute and the removal of /testforblock (which I assume was replaced, but I don't know by what).
    – GigaByte
    Commented Aug 31, 2018 at 19:34
  • There are automatic converters for commands from 1.12 to 1.13. No ability was removed. But since you already have a working custom crafting system: Does it work with droppers or other inventories? If yes, you should be able to just modify that for your structures. Commented Aug 31, 2018 at 21:24
  • Yes, that's actually what my idea was to attempt to make this sort of structure thing, I simply changed the second command from /execute @a ~ ~-1 ~ blockdata, to /execute @a ~ ~-1 ~ clone, however, it activates for everyone instead of just the person above the dropper.
    – GigaByte
    Commented Aug 31, 2018 at 23:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .