PLAYER_PRESISTENT variable checking from mob AI conditions

Started by артур багдасаров on Fri, 07/09/2021 - 23:57

Topic category: Help with modding (Java Edition)

Last seen on 19:19, 20. Sep 2021
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
PLAYER_PRESISTENT variable checking from mob AI conditions
Fri, 07/09/2021 - 23:57

Good night.

I create a reputation system and save the data about player's relations with fractions using PLAYER_PRESISTENT variables (int variables with relation level (0 - neutral; > 0 - positive; < 0 - negative)). And I have a problem with mob AI. I want to create system: mob looking at player, cheking relations with a certain fraction and attack (if relation level is negative) or don't react (neutral or positive) on this player. But the condition on attack node calling from mob and can't check certain player variable. How can I do this?

I can make relation variable global for world, but there will be a problem on server in the future, becouse all the players will affect on reputation (every fraction will react on all players the same way).

Have someone ideas, how to do this?

You can not access player…
Sat, 07/10/2021 - 12:38

You can not access player variable from entity, what player to check if there are multiple?

Last seen on 19:19, 20. Sep 2021
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Sorry, I don't understand…
Sun, 07/11/2021 - 17:25

Sorry, I don't understand the question. English is foreign for me.

There are more then one players and mob must understand, how's hostile to this mob (the mob belongs to a certain faction) and attack only this player.

Last seen on 19:19, 20. Sep 2021
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
So, is there no solution for…
Tue, 07/20/2021 - 09:46

So, is there no solution for my problem?

Last seen on 02:01, 27. Aug 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think I understand   Hes…
Tue, 07/20/2021 - 18:01

I think I understand

 

Hes saying how are you checking the player variable when multiple players could be checked

 

Id suggest using NBT tags instead so that they are actually tied to a player and can be checked against multiple players

Last seen on 19:19, 20. Sep 2021
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How can I add NBT tag to…
Tue, 07/20/2021 - 20:20

How can I add NBT tag to player?

Last seen on 02:01, 27. Aug 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
No idea, id assume you just…
Tue, 07/20/2021 - 22:23

No idea, id assume you just use Entity NBT but im no expert at Mcreator