-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling Registry.ATTRIBUTE.getKey(attribute) when Attribute is a PlayerEx attribute returns null. #99
Comments
Hi there, When the world is created server-side, Data Attributes loads any attributes defined in a datapack and registers them to the game. When a player joins the world, the server sends this information to the client and the attributes are then registered to the client's game too. For singleplayer this happens at the same time but for multiplayer this occurs on the server once at startup and then on the client(s) whenever a player joins the server. Additionally, when a player disconnects from a server, the attributes are unregistered from that client. This is so that different servers/worlds can have different datapack-defined attributes. Outside of the aforementioned events, the JSON loaded attributes do not exist in the game's memory. In summary, Data Attributes implements lazy-loading attributes and PlayerEx registers its attribute using this method. If you link me your repo I can maybe have a look and make some recommendations? I don't know exactly how (or when) you're dynamically generating datadriven rpg-style loot; is it pregame? On world load? I'm sure this is fixable. |
Hey, sure. https://github.com/amoooooo/Affixated most of the impl is in the common package, but some stuff is inside fabric too. Forge hasnt been touched much yet, so can safely be ignored. |
I actually got it working, mostly, but the AttributeModifiers i apply to it dont show up in the tooltip nor apply, but they do with default Trinket attribute modifiers. Specifically PlayerEx attributes. |
Hi,
I'm sure you're doing things your own way, so I don't want to step on your toes - but you might find it helpful/insightful to take a look at some of the code in RelicEx. Not sure about the tooltip though; I think you're storing the modifiers using a custom nbt tag/format on the ItemStack, right? Is there a reason why you're not appending to the default vanilla attribute modifiers list (I think it's nbt list with key 'Attributes')? |
Hi, i've gotten something working but come back with another issue. We're running the server with proxies via velocity for some custom stuff, but PlayerEx and DataAttributes will not allow you to connect to a Velocity proxy at all. Is this something that can be fixed? |
Ah - please see this issue. I don't really know how to fix this! Edit: I think it's either the size of the packet Data Attributes sends on connection or the bit of code that checks to see that the client got the packet and is running the right version. I could maybe output a release tomorrow without the latter feature for you to test to see if that fixes it? |
final question... you can't seem to add PlayerEx attributes via origins as the attribute doesn't exist, is there a workaround or is this something origins would have to fix? i assume it's because of Data Attributes |
See this issue. Note that one of the issues that stopped me from contributing to Origins/Apoli seems to have been resolved - regardless, the incompatibility persists until I can fix it. |
Alright, thank you. One final final question, albeit the wrong repo x) How can i change the potency of attributes rolled on relics? |
Hi there, |
I see, thank you. Would it be possible to contact you on Discord or somewhere? We are using PlayerEx, RelicEx and the mod i wrote as the core part of a modpack for ~100 streamers, and I'm wanting to look into balance options but don't want to fill up the github issues with "How would i x" |
I've sent you a friend request on Discord. I'm back at work starting today so I'll only be able to reply evening. |
Hi there. I'm writing a mod that adds RPG-style affixes to loot, and it's fully data-driven. I assume i am running into this issue due to PlayerEx using Data Attributes, but i'm using the safe supplier method that is used in Data Attributes and it's still erroring out.
The text was updated successfully, but these errors were encountered: