How would I get the 'local' player?

Started by funnytevinn on

Topic category: Help with modding (Java Edition)

Last seen on 21:27, 14. May 2022
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How would I get the 'local' player?

In my mod, I need to access a global player persistent variable from another entity.

 

My procedure is kind of like this :

On loaded entity tick update

if entity is subtype of villager

<add 1 to the PLAYER's player-persistent global variable>

 

How would I get the player in this way?