Skip to content

Developer PlayerData Get

ludgart edited this page Jan 14, 2021 · 2 revisions

Developer PlayerData Get

Before you can start with reading our first data from the storage system, you need to follow the PlayerData tutorial.

Read one column
Create in your ExampleZocker class a new method:

public CompletableFuture<String> getMyColumn() {
  return this.get("my_table_here", "my_column");
}

This will call the method from the inherited class and return the value as CompletableFuture object back.

Read more columns

public CompletableFuture<String> getMyColumns() {
  return this.get("my_table_here", new String[]{"my_column_1", "my_column_2"});
}

Changing the unique key

With the default usage of the API it use the player uuid as key and value for receiving the data from the database.
In some cases you want to load non player data.

public CompletableFuture<String> getSomethingElse() {
  return this.get("my_table_here", "my_column", "my_unique_key", "my_unique_value);
}

In background the my_unique_key is the WHERE and my_unique_value is the value of the WHERE query.

Information

Server Owner

Developer

Clone this wiki locally