How to check if an entity is a player?

Started by RoboMan on

Topic category: Help with modding (Java Edition)

Last seen on 06:49, 13. Oct 2022
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. 

Last seen on 04:28, 26. Jan 2024
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

Last seen on 06:49, 13. Oct 2022
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.

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

User statistics:

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

all fine :)

Last seen on 11:55, 28. Jan 2024
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"

Last seen on 13:05, 7. Mar 2024
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.