0

For a bedwars Minigame in vanilla I need TNT and fireballs, but they should only break certain blocks and deal damage. For the TNT I have this:

execute as @e[type=tnt,nbt={Fuse:1s}] at @a run function tnt_blocks
execute as @e[type=tnt,nbt={Fuse:1s}] at @a run summon creeper ~ ~ ~ {Fuse:0}
execute as @e[type=tnt,nbt={Fuse:1s}] at @a run kill @s

But I don't know how to do the block part. Does anyone have an idea how this can be efficiently and realistically done?

The second thing is the fireball. It should break only wool, deal a bit of damage and bounce the player up. But when I use the creeper-method, the player will die instantly. But that's not what I want...

1 Answer 1

2

you can summon an armor stand at the position you want

use the command

/execute at @e[type=armor_stand] fill (x, y, z) (x, y, z) air replace (block you want to remove)

repeat this command to destroy the blocks you want it to break around it then use

/effect give @a[distance=..(put radius here)] instant_damage (add damage level here)

then add

/execute at @e[type=armor_stand] run summon creeper ~ ~ ~ {Fuse:0,ExplosionRadius:0}

then

/kill @e[type=armor_stand]

it should look like this (in order to achieve multiple commands, you can use chain command blocks)

/execute at @e[type=armor_stand] fill (x, y, z) (x, y, z) air replace (block you want to remove)
/effect give @a[distance=..(put radius here)] instant_damage
/execute at @e[type=armor_stand] run summon creeper ~ ~ ~ {Fuse:0,ExplosionRadius:0}
/kill @e[type=armor_stand]

if you are already using armor stands, you can use other entities as well!

explanation of the commands:

/execute at (place or entity you want to make the explosion at) run summon armor_stand ~ ~ ~ summons an armor stand at the position you want to make the explosion at, this will be the target for the other commands

/execute at @e[type=armor_stand] fill (x, y, z) (x, y, z) air replace (block you want to remove) runs a fill command at the armor stand that will turn the blocks you want to remove into air

/effect give @a[distance=..(put radius here)] instant_damage (add damage level here) damages players in a radius with a certain level of damage

/execute at @e[type=armor_stand] run summon creeper ~ ~ ~ {Fuse:0,ExplosionRadius:0} summons a creeper at the armor stand that instantly explodes but doesn't damage any blocks

/kill @e[type=armor_stand] this will kill all armor stands (you can't just have them lying around, after all!)

just out of curiosity, can i help out on the server?

1
  • Thanks for this answer. I completly forgot about this question. We canceled the project because of time, but I will test this solution when I'm at home. Also, I put the commands into code blocks. I hope the edit will be approved soon
    – bennetr
    Sep 23, 2021 at 8:33

You must log in to answer this question.

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