How to check if an entity is a player?

Started by RoboMan on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to check if an entity is a player?

I need to make a procedure that only affects players, but not other entities. For example, "If a player is at *x y z* coordinates, do *so and so*. However, I have no idea how to only make this affect players at that coordinate rather than all entities. 

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so your procedure should…
Tue, 10/05/2021 - 01:41

so your procedure should look like this: for every entity iterator on a block radius of 30 blocks

if entity iterator is type: Player

 do give potion effect to entity iterator for # ticks type: EFFECT

you might want to search before posting

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you. Also, I apologize…
Tue, 10/05/2021 - 22:57

Thank you. Also, I apologize. I did search, but nothing came up regarding my issue.

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
all fine :)
Tue, 10/05/2021 - 23:30

all fine :)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
there is no "if entity is…
Thu, 01/25/2024 - 17:06

there is no "if entity is player"

Joined Oct 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nop there is Kjuhj_, you…
Thu, 02/08/2024 - 15:35

Nop there is Kjuhj_, you have to use the Is <entity selector> (sub)type of <entity type> block and select player as the entity type.

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For anyone else struggling:…
Wed, 08/14/2024 - 17:50

For anyone else struggling: 
The procedure block that @CookieGamer77 is referring to, " Is [entity] (sub)type [entity type] " can be found at the bottom of the "Logic" section of procedure blocks.

You can also find it by entering "sub" into the search bar. It should be the first result.