Random event sword

Started by Charizard56 on Sat, 04/17/2021 - 10:04

Topic category: Help with modding (Java Edition)

Last seen on 18:50, 4. Nov 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Random event sword
Sat, 04/17/2021 - 12:09 (edited)

Hey!

I have an idea of making and Ender Sword. I want it to randomly teleport player who is using it to its target.

I have a variable called "Teleport", it's type is number. My procedure looks like this:

Event trigger:

Set Local: Teleport to: Random [0,1)

if Get Local: Teleport = 0

do Set location of Source entity to x: x y: y z: z

It works, but the sword teleports all the time. I have no idea how to make the sword teleporting ramdomly. Can somebody help me?

Edited by Charizard56 on Sat, 04/17/2021 - 12:09
Last seen on 18:50, 4. Nov 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Okay, I did it myself. All I…
Sat, 04/17/2021 - 12:24

Okay, I did it myself. All I had to do is isnstead of = put >