Topic category: Help with Minecraft modding (Java Edition)
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 variable from entity, what player to check if there are multiple?
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.
So, is there no solution for my problem?
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
How can I add NBT tag to player?
No idea, id assume you just use Entity NBT but im no expert at Mcreator