How to make entity have a 70% chance of being struck by lightning

Started by BlazingGreenFire on

Topic category: Help with modding (Java Edition)

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make entity have a 70% chance of being struck by lightning

Hello so I am remaking the copper golem in Minecraft, and I wanna figure out how to make it so if the copper golem is out in the open if it is thundering, it has a 70% chance of getting struck by lightning. Any help?

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
entity tick update if is…
Tue, 10/19/2021 - 18:54

entity tick update

if is thundering in the provided world

 do if random 0, 1 <= 0.7

       do strike lightning at x y z

Search before posting

 

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello so I just did that,…
Wed, 10/20/2021 - 16:52

Hello so I just did that, and it worked... a little too well.... lightning was being spammed on the entity, do you know how to fix that

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also the lightning damages…
Wed, 10/20/2021 - 16:53

also the lightning damages it

 

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
then check the checkbox…
Wed, 10/20/2021 - 17:27

then check the checkbox Effect Only

and change 0.7 to 0.5

delete all and put this:

if is thundering in the provided world

  do if random 0, 1 <= 0.5

       do wait 100 ticks on server side and do Striker Lightning at X Y Z effect only

 

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Wed, 10/20/2021 - 17:58

After I did that, this happened until I made it stop thundering...

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
that happened after I did…
Wed, 10/20/2021 - 17:58

that happened after I did that till I made it stop thundering

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also after 100 ticks have…
Wed, 10/20/2021 - 18:00

also after 100 ticks have past it then continues to forever strike lightning

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
show me your procedure
Wed, 10/20/2021 - 18:10

show me your procedure

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Wed, 10/20/2021 - 19:01

Procedure

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
3 errors.  First. on your…
Wed, 10/20/2021 - 19:17

3 errors. 

First. on your Entity put the procedure on Update Tick. and don't put anything on Global Triggers

Second. it is <= not < (< but with a line under it)

Third. don't specify the entity, just put the Wait block on random 0 , 1

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Thu, 10/21/2021 - 17:16

Screenshot

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I changed all the things but…
Thu, 10/21/2021 - 17:18

I changed all the things but now like before, after 100 ticks pass, lightning is just spammed on the copper golem. I want any lightning that strikes nearby to strike him instead, not to generate new ones also

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
then use NBT Number Tags…
Thu, 10/21/2021 - 17:26

then use NBT Number Tags

remove the wait button. and instead put this: Set NBT Number Tag Timer of entity to Get NBT Number Tag Timer + 1

and then: if NBT Number Tag Timer of entity = 100

do strike lightning at X Y Z

inside Random 0, 1 <= 0.5

if not even that works, you could try setting the 0.5 even lower.

Last seen on 12:24, 19. Mar 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
where do I get the "Set NBT…
Thu, 10/21/2021 - 17:54

where do I get the "Set NBT Number Tag Timer of entity" thing cuz the search doesn't work that well and I can't find it