Skip to content

User (In Edit)

EtroakaSunny edited this page Apr 30, 2023 · 3 revisions

Online Status

To receive the online user object, you can use the getOnlineUser() method. This will give you the OnlineUser object that contains information about the user.

If you need to reload the user object , you can use the refresh() method. This will update the object.

To check if a user is online, you can use the isOnline() method. This will return a boolean whether this user is currently online.

If you need to obtain the UUID for a user, you can use the getUniqueId() method. This returns a string containing the UUID.

To get the name of a user, you can use the getName() method. This returns a string containing the user's name.

Telephone

The Telephone of an user can be received by using Telephone getTelephone(); method.

Friends & Marriage

Friends

If you want to obtain all the friends of an user, you can use the getTelephone() method. This returns a user list (List) that contains the list of friends.

To add a friend to an users list you can use the method addFriend(User user). This adds the user to the friend list. This also adds the other user to the other users list.

If you want to remove a friend you can use removeFriend(User user). This removes the user of the friend list.

Mariage

If you want to obtain all the spouses of an user, you can use the getMarriage method. This returns a user list (List) that contains the list of spouses.

To add someone to a marriage, you can use the addMarriage(User user) method. This adds the user to the users Marriage list.

When you want to remove an user from a marriage, you can use the void leaveMarriage() method.

Bell

Users can be blocked from ringing the bell. To receive the list of users blocked by an user, you can use the getBellBlacklist method. This returns a user list (List) that contains the list of blocked users.

An user can be added or removed from the blacklist. If you want to remove a user, you can use the removeFromBellBlacklist(User user) method, to add an user you can use the addToBellBlacklist(User user) method.

Settings

If you want to receive a setting from an user, you can use the String getUserSetting(String key) method. The key is the key of the setting. When a user did not provide a value, null will be returned. An other String can be added to set a default value which will be returned if the setting is null.

A setting can be changed using the changeUserSetting(String key, String newValue) method.

Team

If you want to check if an user is allowed to join Team Service, you can use the boolean isTeamAuth() method.

Debug

NEED MORE INFORMATION

Shop purchases

A Purchase Array can be received by using the getPurchases() method.

If you want to add a purchase to an user, you can use the addPurchase(Purchase purchase method. This method will add a purchase to the selected user. To remove a purchase from a user, you can use the removePurchase(Purchase purchase) method. If you want to check if someone has a premium rank, you can use the boolean isPremium() method. This returns true when a user has a premium rank.

Education

To check if an user has a education, you can use the boolean hasEducation(Education education) method. This returns true if a user has the selected education.

Licenses

Driver license

In order to check if an user has a driving license, you can use the boolean hasDriversLicense() method. This returns true whether the user has a driving license

Gun license

When you want to check if an user has a gun license, you can use the int getGunLicense() method. The method returns zero when someone doesn't habe a license. If the user has a license the class is returned.

Money

The balance of an users wallet can be checked by using the int getCashInCents()` method. This returns the amount of cash in cents.

If you want to remove money from an users walltet, you can use the boolean payCash(int amountInCents) method. When a user doesn't have enough money the boolean returns false.

To update the users cash from the database, you can use the void updateCash() method.

Wanted System

Important Notice: The wanted system is dangerous to use at the moment. Problems may occur.

If you want to receive the current wanted Level of an user, yo can use the int getWantedLevel() method. When a user ist wanted the method return 0.

The wanted level of an user can be changed using the void setWantedLevel(int level) method. This sets the wanted level to the given level.

Knocked out user

To know whether an user is knocked out at the moment, you can use the boolean isKnockedOut() method.

Imprisonment

To check whether a user is imprisoned in a state prison, you can use the isImprisoned() method.

Registration

To check if an user has completed the registration on our network the method boolean isRegistered() can be used.

Block placement

If you want to check if an user is allowed to break/place/use a block using the regions-system you can use the boolean isAllowedToUse(Block block) method.

Freeze

A player can be frozen by a team member. To check if someone is frozen, you can use the boolean isFrozen() method.

To freeze a user, you can use the void freeze() method. This freezes the players and stops any motion of the user.

To unfreeze the user, you can use the void unfreeze() method.

Latest join

To get the latest join of an user, you can use the long getLatestJoin() method. You can get the latest join formatted using the String getLatestJoinFormatted() method.

Tutorial

If you want to get the current tutorial a user is in, you can use the int getTutorialStep() method. A user can be set into a tutorial step by using void setTutorialStep(int step) method. To check if a user is in a tutorial, you can use the isInTutorial() method.