• Hey! Register here to create your account, engage with the community, and talk about what is new!

How to make snowballs able to break blocks they land on?

mike5530

New member
Joined
Jul 27, 2023
Messages
2
Reaction score
0
I've tried figuring it out through previous forum messages but I couldn't find anything about the topic. I also need the snowballs to only be able to break specified blocks
 
Solution
Hey! After some tinkering, I found a viable way to do this!

Using the Player Event -> Damage Events -> Player Projectile Hit (not to be confused with Projectile Damage Player), you can detect if any projectile hits anything, including the ground.
If you want to use just snowballs, you can use an If Entity -> Is Type, then put a snowball in the chest.
Game Values support the locations of projectiles, but unfortunately using just this will not break any blocks as the location is too high.
To get around this, you can use a Set Variable -> Location Manipulation -> Shift Location on Axis, then shift it down on the Y axis by -1.
Afterwards, you can use a Game Action -> Block Manipulation -> Break Block to...

Jell-O

New member
Joined
Jul 21, 2023
Messages
5
Reaction score
0
Hey! After some tinkering, I found a viable way to do this!

Using the Player Event -> Damage Events -> Player Projectile Hit (not to be confused with Projectile Damage Player), you can detect if any projectile hits anything, including the ground.
If you want to use just snowballs, you can use an If Entity -> Is Type, then put a snowball in the chest.
Game Values support the locations of projectiles, but unfortunately using just this will not break any blocks as the location is too high.
To get around this, you can use a Set Variable -> Location Manipulation -> Shift Location on Axis, then shift it down on the Y axis by -1.
Afterwards, you can use a Game Action -> Block Manipulation -> Break Block to break the block at the specified location.

This will break any block a snowball hits by the way, it is possible to detect which block the snowball hits, then check if the block is a block you wish to break. If you want to do this, I do recommend messing around with Set Variables and If Variables first, but if you're stumped feel free to ask!
Hope this helps, and if you have any questions feel free to ask!

1690505360945.png
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,260
Reaction score
356
Hey! After some tinkering, I found a viable way to do this!

Using the Player Event -> Damage Events -> Player Projectile Hit (not to be confused with Projectile Damage Player), you can detect if any projectile hits anything, including the ground.
If you want to use just snowballs, you can use an If Entity -> Is Type, then put a snowball in the chest.
Game Values support the locations of projectiles, but unfortunately using just this will not break any blocks as the location is too high.
To get around this, you can use a Set Variable -> Location Manipulation -> Shift Location on Axis, then shift it down on the Y axis by -1.
Afterwards, you can use a Game Action -> Block Manipulation -> Break Block to break the block at the specified location.

This will break any block a snowball hits by the way, it is possible to detect which block the snowball hits, then check if the block is a block you wish to break. If you want to do this, I do recommend messing around with Set Variables and If Variables first, but if you're stumped feel free to ask!
Hope this helps, and if you have any questions feel free to ask!

View attachment 2468
instead of Game Value: Location - Projectile, you can use Game Value: Event Block Location (that returns the hit block location)

so you can remove the set variable and put the game value straight in the chest
 

mike5530

New member
Joined
Jul 27, 2023
Messages
2
Reaction score
0
Hey! After some tinkering, I found a viable way to do this!

Using the Player Event -> Damage Events -> Player Projectile Hit (not to be confused with Projectile Damage Player), you can detect if any projectile hits anything, including the ground.
If you want to use just snowballs, you can use an If Entity -> Is Type, then put a snowball in the chest.
Game Values support the locations of projectiles, but unfortunately using just this will not break any blocks as the location is too high.
To get around this, you can use a Set Variable -> Location Manipulation -> Shift Location on Axis, then shift it down on the Y axis by -1.
Afterwards, you can use a Game Action -> Block Manipulation -> Break Block to break the block at the specified location.

This will break any block a snowball hits by the way, it is possible to detect which block the snowball hits, then check if the block is a block you wish to break. If you want to do this, I do recommend messing around with Set Variables and If Variables first, but if you're stumped feel free to ask!
Hope this helps, and if you have any questions feel free to ask!

View attachment 2468
Thank you for the solution! It works well
 
Solution
Top Bottom