TransWikia.com

Is there a way to detect every of a single entity and make another entity ride it at all times?

Arqade Asked on June 30, 2021

I want to make an execute command so that, for example, a command that detects all snowballs and summons one falling sand riding all snowballs that are currently in the air (you know, an entity). I always was confused by the Riding entity nbt tag and I never knew if it meant that it summons a new entity and rides on it or it would summon a new entity and make that entity RIDE it. Is this effectively the same thing as the command?

execute positioned as @e[type=snowball) run summon ~ ~ ~ snowball{Riding:FallingSand}

Another question, if two snowballs hit each other, will they both disappear?

One Answer

If I understand correctly you want to summon a fallingblock on every snowball that already exists?

I think the best way would be to constantly summon a fallingblock on top that has a "Time:0" nbt so it despawns again, but because it's constantly spawned it doesn't seem like it's despawning.From what I vaguely understand, you want it to be able to hit things too, right? Since you said something about "not dealing knockback instead of my wanted result" I'm assuming you want it to hit stuff.

In that case you need

/execute as @e[type=snowball] at @s run summon minecraft:falling_block ~ ~ ~ {BlockState:{Name:"minecraft:sand"},Time:0,Motion:[0.0d,-0.1d,0.0d],HurtEntities:1,FallHurtAmount:1,FallHurtMax:1,DropItem:0}

Which should allow the block to hit entities and deal 1 damage. But it doesn't actually deal damage, because the block needs to hit the ground and the entity to deal damage to it, I noticed while testing.

I would have suggested

/execute as @e[type=snowball] run data merge entity @s {Passengers:[{id:"minecraft:fallingblock",BlockState:{Name:"minecraft:sand"},Time:1}]}

But this doesn't work somehow. (I tested it)

Edit: For question two, snowballs can't hit eachother mid-air. (you can test by throwing a few straight up in the air)

Correct answer by Wicked Grinn on June 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP