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

Help with executing code for projectiles

luna_0_7

New member
Joined
Nov 28, 2023
Messages
5
Reaction score
0
I made a weapon that makes trident rain down from the sky, and i am trying to make them strike lightning on the ground when they die. Which seems simple enough. But no matter what I do it doesn't work with the tridents. The line of code is simple enough. It goes like this. EntityDeath -> If Entity Type = Trident -> Spawnlightning Location is a game value with the location of projectile. But it doesn't work. I dont know if its because i have the trident in the chest and i need something else, or because of the game value. But please help me.
 

CoderElias

Notorious member
Overlord
Joined
Jun 15, 2022
Messages
93
Reaction score
16
You should try to change the EntityDeath event to ProjectileHit, which runs when any projectile lands on a block or hits a player. You were using EntityDeath which doesn't work because a trident does not "die" when landing.
 

luna_0_7

New member
Joined
Nov 28, 2023
Messages
5
Reaction score
0
So I changed it to projectile damage, but it still doesn't work, i used a game value location and damager as the lightning location. but no lightning struck
 

luna_0_7

New member
Joined
Nov 28, 2023
Messages
5
Reaction score
0
You should try to change the EntityDeath event to ProjectileHit, which runs when any projectile lands on a block or hits a player. You were using EntityDeath which doesn't work because a trident does not "die" when landing.
The if type = trident is the thing that isn't working. Do i just put a trident in the chest?
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,260
Reaction score
356
So I changed it to projectile damage, but it still doesn't work, i used a game value location and damager as the lightning location. but no lightning struck
not projectile damage, Projectile Hit
1714210547927.png

The if type = trident is the thing that isn't working. Do i just put a trident in the chest?
yes, put an item of a trident in chest, not a string (y)
 
Top Bottom