4

In the map Diversity 3, the player is tasked with putting wool into a chest, after which the wool visibly flies out of the chest, triggering an explosion and a changed block.

I'm attempting to achieve something similar: a gold ingot is spawned, flies towards a blocked cave, which sets off an explosion and opens the cave.

My problem lies in getting the gold ingot to path correctly. Currently, a repeat command block execute if entity @e[type=player,scores={deathmount=2}] run scoreboard players add @a deathmount 1 checks for the players score, and enables the chain if it's high enough.

After this, I've set up a chain that acts as follows:

/summon item -80 90 -66 {NoGravity:1b,Glowing:1b,PickupDelay:199980,Owner:"herobrine",Thrower:"notch",Tags:["triforce"],Item:{id:"minecraft:gold_ingot",Count:1b}}

First, the ingot is spawned,

/tp @e[tag=triforce] ~-.02 ~-0.1 ~-.45 

Second, it attempts to path according to the above,

/summon area_effect_cloud -82 85 -75 {NoGravity:1b,Particle:"explosion",Duration:40,Tags:["explosion"]}

When it reaches its destination, an explosion particle is spawned,

/playsound minecraft:entity.generic.explode ambient @a -82 85 -75 1 1 0.1

The sound is played,

kill @e[tag=triforce]

The ingot is killed,

setblock -82 85 -76 air replace
setblock -82 86 -76 air replace

The two blocks are replaced,

/title @a title {"text":"The way is open! Good luck!"}

And finally a voice tells the player they can enter the relevant dungeon.

What seems to occur is that the path gets cut off prematurely by the explosion. I have attempted to run the path multiple times (by chaining the same command block together) only for it to move erratically, sometimes going so far as to glitch into the ground.

I have considered taking a redstone output from the pathing command block, delaying the signal's death until the path can finish, and then reconnecting the chain once this has occured, however as it turns out, comparators cannot take an output from a chain command block, leaving that option a no-go.

Is there something obvious I'm missing here?

For reference, the coordinates I'm spawning the ingot at are x=-80 y=90 z=-66 and I'm trying to get it to path to x=-82 y=85 z=-76

Thanks for the help!

  • Couldn't you just move the target a bit further, so that the item gets killed at the right spot? Also, how does it get killed by the explosion here? There is no real explosion. – Fabian Röling Jun 10 '19 at 15:59
  • See the target is static, being a large rock wall. As for how it gets killed by the explosion, it doesn't, instead being killed by a command that runs immediately after the explosion. – Dalek_Thal Jun 11 '19 at 0:58
  • You wrote: "What seems to occur is that the path gets cut off prematurely by the explosion." But you already accepted an answer, so I assume that this is solved now. – Fabian Röling Jun 11 '19 at 1:00
  • Indeed, so we're all good. Thanks mate! – Dalek_Thal Jun 11 '19 at 1:07
2

You can probably just change the command that summons the area effect cloud, so that it executes from an entity with the tag triforce and at the specified coordinates.
That would look something like this:

/execute positioned -82 85 -75 as @e[tag=triforce,distance=..0.5] at @s run summon area_effect_cloud ~ ~ ~ {NoGravity:1b,Particle:"explosion",Duration:40,Tags:["explosion"]}

Then you do not even have to think about correct timing, because the explosion (or the particle effect) would happen when your gold bar is at that specific location.

To make it less jagged I suggest to use the Motion tag instead of teleporting.

/summon item -80 90 -66 {NoGravity:1b,Glowing:1b,PickupDelay:199980,Owner:"herobrine",Thrower:"notch",Tags:["triforce"],Item:{id:"minecraft:gold_ingot",Count:1b},Motion:[-0.02,-0.1,-0.45]}

The item will slow down over time, so you may want it to either start faster, or repeatedly set that tag. You can do that with the command block that you currently use for teleporting.

/data modify @e[tag=triforce] Motion set value [-0.02,-0.1,-0.45]
  • Just one other question, the movement of the ingot is very jagged, and it teleports a significantly longer distance than it's supposed to. I've tested the command on myself and it works fine, suggesting that it's an issue with the command block system. Should I be chaining multiple tp command blocks, or should I be using something other than an unconditional chain command block? – Dalek_Thal Jun 11 '19 at 1:20
  • 1
    I didn't check the commands for spelling and I wrote the commands from memory, so they may not be executable in their current form (I'm relatively sure that they are correct though and I did play around with them yesterday). – user232393 Jun 11 '19 at 6:07

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.