Choose random entity that's not the player.

Started by RiverCape919073 on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Choose random entity that's not the player.

I want to make a staff that teleports the nearest entity within a 5-block range in front of the player, but now it just keeps teleporting the player forward. This is cool, but not what I want. How do I NOT choose the player?

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What does your current…
Sun, 05/07/2023 - 10:32

What does your current procedure look like? I imagine all that will be needed is an "if" check for [ "not" ] [ Sub type = player ]

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Couldn't figure out how to…
Mon, 05/08/2023 - 08:35

Couldn't figure out how to add an image so here it is:

 

Set Local: Nearest to NULL Get nearest entity at x: x y: y z: z in square cube with size 5 of type Ambient entity

if NULL Get Local: Nearest = NULL No entity

do:

       Set Local: Nearest to NULL Get nearest entity at x: x y: y z: z in square cube with size 5 of type Ambient entity

       if NULL Get Local: Nearest = NULL No entity

       do:

                    {do something if nothing is there}

        else:

                    Set location of NULL Get Local: Nearest to {location}

else:

        Set location of NULL Get Local: Nearest to {location}

 

 

 

I don't think an if statement would work since I'm running it at a player.

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, I figured it out! The …
Thu, 06/01/2023 - 12:55

Oh, I figured it out! The 'mob' type is everything BUT players!