Retrieves data from an offline player (using arrays and list variables)

So a few days ago I came up with an idea of an alternative way to retrieve data from an offline player without using Entities’ Interference (EI). So the solution goes like this:

First, I will have a variable that consists of every player’s name within the world (called a list variable).
For instance:

List = [“deefer”, “adam”, “sprink”]

So the list variable is not important in this code but if you want to add like checking whether if the user exists or not to avoid errors then you can utilize If variable text contains to check if the list encompasses the name or not.

Now to the second step which is the most crucial step in the whole code, Arrays.
So basically you would first need to find the length of the string/name of the player to be retrieved so we can indicate the position where the name ended:

Output: 6

So now we have the ended position which is 6, you will then set up a recursive function which will then consecutively truncate the name to splits into individual letters. From those letters multiply each of them with 1, 2, 2^2, 2^3, 2^4, etc… (geometric sequence). After that add all the values together and we will get a sum. The sum will then be used as the “index” to be retrieved from the array. And done, the value that you just got from the array’s index is the value to be retrieved from the offline player. Very simple yet lengthy, not recommend doing this unless you are some typical try harder. Just use EI, trust me it is more compact and relatable but I won’t tell since only a few coders know how to use that.

Edit: I’m not the first one to propose the idea of retrieving offline players’ data using arrays. I’m just the person that approved the idea is possible.


pog but can i unban a offline player from my world using it?


Yeah just replace the array value with “true” or “no” so when the player joined just check the array’s value


What are you multiplying exactly? I did not understand this. Are you trying to get unique index number in array based on players name?


yep just make function that extract the letters from the name into number like “a” = “1”, “b” = “2” and so on


That makes sense. Only problem is non English letters in nickname. Where are you storing letter values? And how are you extracting them?


Well then I had no solutions to extract that but we can make a system to detect the user’s name whether contains special characters or not.


Ok what about only English alphabet? Where are you storing letter values and how are you extracting them?

1 Like

Store it inside an array then set up a function to extract all the index values from it. Or maybe like create 10 - 15 variables and then store each letter within each one of them. I know this code is super lengthy and the easiest way is to use entities.


UPD: I have found a much easier method!

That is complicated…

Not at all it is just complicated at the truncate part

Maybe for you, I didn’t understand a single thing in the codes

Use entity then don’t you read the end part? It literally says “very complicated”.

I didn’t read it whole, I just read some of the start…

Yeah better you don’t.

O_O that is alot of writing :skull:

Nope. Also why the hell is my post kept getting edited automatically.

Idk how can it auto-edit lol

Me neither. Ok stop here.