I'm Trying to have vector3f save the coords to memory, then retrive it From a command
Ive tried attributes but that resulted in errors, id post the console here, but its not writing any errors into the debug console.
it writes fine, i can get it from the same event, but i want to get the vector3f from the other event.
Its me again -- Having issies with Vector3f, how can i retrive it from a command?
-
- English
- King Nothing
- Thread is marked as Resolved.
-
-
What error did you get exactly? Maybe post your code here.
Storing the Vector as attribute is actually the right way (or more precisely, the most convenient way) to store data. Make sure to use a unique attribute key name to avoid collisions with other plugins, e.g. use your package name or something like this (for example "testplugin.captaincornball.playerdata.vector"). When retrieving the data, you have to cast it to a Vector3f (since the "getAttribute()" function returns an "Object"). Example:
Java -
Java
I don't know why it won;t write any Error logs or anything, It won't write to the debug console, i checked the logs, nothing.
-
That code should work as intended (if you replace "testvector" in line 17 by "DeathPosition").
Do you get the "died" message in chat upon death? If it's also missing, make sure that you register your event listener (registerEventListener()) -
It was the "testvector" i missed it, now it works like it's Supposed to..
thank you.
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!