Skip to content

Likes#

Likes lets players rate other islands with likes, dislikes or stars.

Created and maintained by BONNe.

Installation#

  1. Place the addon jar in the addons folder of the BentoBox plugin
  2. Start the server
  3. Stop the server
  4. Edit configuration located in /plugins/BentoBox/addons/Likes folder.
  5. Start the server.

Configuration#

Some config options can be changed via administration GUI in game. However, some options cannot.

There are 2 important config options:

  • mode: allows changing which mode addon works

    • LIKES - Allows adding only Like to island.
    • LIKES_DISLIKES - Allows adding only Like and Dislikes to island.
    • STARS - Allows adding Starts to island.
  • disabled-gamemode: allows disabling addon in some gamemode addons completely.

All other options can be changed via ingame GUI.

Commands#

Tip

[player_command] and [admin_command] are commands that differ depending on the gamemode you are running. The Gamemodes' config.yml file contains options that allows you to modify these values. As an example, on BSkyBlock, the default [player_command] is island, and the default [admin_command] is bsbadmin.

  • /[player_command] likes: opens GUI for adding / removing likes, dislikes or star.
  • /[player_command] likes top: opens GUI that display Top islands by Likes, Dislikes or Stars
  • /[player_command] likes view <player>: opens GUI that shows who add likes or stars to the island.
  • /[admin_command] likes: opens Admin GUI.
  • /[admin_command] likes settings: opens Admin Settings GUI.

Permissions#

Tip

[gamemode] is a prefix that differs depending on the gamemode you are running. The prefix is the lowercased name of the gamemode, i.e. if you are using BSkyBlock, the prefix is bskyblock. Similarly, if you are using AcidIsland, the prefix is acidisland.

  • [gamemode].likes - (default: true) - Allows the player to use '/[player_command] likes' command.
  • [gamemode].likes.top - (default: true) - Allows the player to use '/[player_command] likes top' command.
  • [gamemode].likes.view - (default: true) - Allows the player to use '/[player_command] likes top' command.
  • [gamemode].likes.icon.[MATERIAL] - (default: false) - Allows changing island owner icon in Top GUIs.
  • [gamemode].likes.view.others - (default: op) - Allows the player to use '/[player_command] likes view ' command.
  • [gamemode].likes.bypass-cost - (default: op) - Allows bypassing cost for operations in addon.
  • [gamemode].likes.admin - (default: op) - Allows using '/[admin_command] likes' command.
  • [gamemode].likes.admin.settings - (default: op) - Allows using '/[admin_command] likes settings' command.
Something is missing?

You can find the comprehensive list of permissions in the addon.yml file of this addon.
If something is indeed missing from the list below, please let us know!

Placeholders#

Tip

[gamemode] is a prefix that differs depending on the gamemode you are running.

The prefix is the lowercased name of the gamemode, i.e. if you are using BSkyBlock, the prefix is bskyblock.

Properly translated placeholders for each gamemode can be found:

Please read the main Placeholders page.

Placeholder Description Likes version
%[gamemode]_likes_addon_island_likes_count% Count of likes that are set to player island 1.7.0
%[gamemode]_likes_addon_island_likes_place% Island place by likes count 1.7.0
%[gamemode]_likes_addon_island_dislikes_count% Count of dislikes that are set to player island 1.7.0
%[gamemode]_likes_addon_island_dislikes_place% Island place by dislikes count 1.7.0
%[gamemode]_likes_addon_island_rank_count% Rank number (likes - dislikes) that are set to player island 1.7.0
%[gamemode]_likes_addon_island_rank_place% Island place by rank 1.7.0
%[gamemode]_likes_addon_island_stars_value% Average stars added to player island 2.0.0
%[gamemode]_likes_addon_island_stars_place% Island place by stars 2.0.0
%[gamemode]_likes_addon_visited_island_likes_count% Count of likes that are set to island at player location 2.1.0
%[gamemode]_likes_addon_visited_island_likes_place% Island place by likes count for island at player location 2.1.0
%[gamemode]_likes_addon_visited_island_dislikes_count% Count of dislikes that are set to island at player location 2.1.0
%[gamemode]_likes_addon_visited_island_dislikes_place% Island place by dislikes count for island at player location 2.1.0
%[gamemode]_likes_addon_visited_island_rank_count% Rank number (likes - dislikes) that are set to island at player location 2.1.0
%[gamemode]_likes_addon_visited_island_rank_place% Island place by rank for island at player location 2.1.0
%[gamemode]_likes_addon_visited_island_stars_value% Average stars added to island at player location 2.1.0
%[gamemode]_likes_addon_visited_island_stars_place% Island place by stars for island at player location 2.1.0
%[gamemode]_likes_addon_top_likes_owner_name_X% Island owner name who are in place X by likes 1.7.0
%[gamemode]_likes_addon_top_likes_island_name_X% Island name which are in place X by likes 1.7.0
%[gamemode]_likes_addon_top_likes_count_X% Count of likes for island that are in place X by likes 1.7.0
%[gamemode]_likes_addon_top_dislikes_owner_name_X% Island owner name who are in place X by dislikes 1.7.0
%[gamemode]_likes_addon_top_dislikes_island_name_X% Island name which are in place X by dislikes 1.7.0
%[gamemode]_likes_addon_top_dislikes_count_X% Count of dislikes for island that are in place X by dislikes 1.7.0
%[gamemode]_likes_addon_top_rank_owner_name_X% Island owner name who are in place X by rank 1.7.0
%[gamemode]_likes_addon_top_rank_island_name_X% Island name which are in place X by rank 1.7.0
%[gamemode]_likes_addon_top_rank_count_X% Rank value for island that are in place X by rank 1.7.0
%[gamemode]_likes_addon_top_stars_owner_name_X% Island owner name who are in place X by stars 2.0.0
%[gamemode]_likes_addon_top_stars_island_name_X% Island name which are in place X by stars 2.0.0
%[gamemode]_likes_addon_top_stars_count_X% Average stars for island that are in place X by stars 2.0.0

FAQ#

Can you add a feature X?

Please add it to the list here.

Can I disable dislikes?

Yes, Likes addon supports 3 working modes:

  • Likes: allows adding only likes to the island
  • LikesDislikes: allows adding likes and dislikes
  • Stars: allows to rate player islands with 1 till 5 stars
Can I view other player likes?

Yes, but you need a permission: [gamemode].likes.view.others.

With that permission players can use /[playercmd] likes view <player> to view other player likes.

Can I change display icon just for some islands?

Yes, it is possible.

There are 2 ways:

  1. using Admin GUI you can choose island and block that will be displayed for it.
  2. adding permission to island owner: [gamemode].likes.icon.[MATERIAL]

Be aware, PLAYER_HEAD will be converted to island owner head.

Translations#

We need your help!

A vast majority of strings in BentoBox and its addons can be translated into virtually any language. However, most of the translations that are provided with BentoBox or said addons are made by the community, on which we heavily rely. We cannot review all the content of these translations nor guarantee its quality, hence why we highly appreciate any contributions.

  • If your language is not available for this addon or if you would like to improve the existing translation, please read the translation guidelines and start translating!
  • If your language is not listed below, please contact us on Discord and we will setup everything so that you can start translating!
Available Language Language code Progress
English (United States) en-US 100% (Default)
Chinese (China) zh-CN progress
Chinese (Hong Kong) zh-HK progress
Chinese (Taiwan) zh-TW progress
Croatian hr progress
Czech cs progress
French fr progress
German de progress
Hungarian hu progress
Indonesian id progress
Italian it progress
Japanese ja progress
Korean ko progress
Latvian lv progress
Polish pl progress
Portuguese pt progress
Romanian ro progress
Russian ru progress
Spanish es progress
Turkish tr progress
Vietnamese vi progress

API#

Addon Request Handlers#

Description

Returns island likes data that is stored for island in given world.

Input

  • world-name: String - the name of the world.
  • island: String - the UUID of the island.

Output

The output is a Map<String, Object> with the following keys:

  • likes: long - the number of likes that are set for given island.
  • dislikes: long - the number of dislikes that are set for given island.
  • rank: long - the number of rank for given island.
  • stars: double - the average stars value for given island.
  • placeByLikes: integer - the place in ranking by likes that are set for given island.
  • placeByDislikes: integer - the place in ranking by dislikes that are set for given island.
  • placeByRank: integer - the place in ranking by rank that are set for given island.
  • placeByStars: integer - the place in ranking by stars that are set for given island.
  • likedBy: List<UUID> - the list of player UUIDs who liked given island.
  • dislikedBy: List<UUID> - the list of player UUIDs who disliked given island.
  • staredBy: Map<UUID, Integer> - the map of player UUIDs who stared given island with a number of stars that they added.

Failure

This handler will return an empty map if the world-name has not been provided or if the world-name does not exist or is not a gamemode world or island is not provided or data for island is empty.

Code example

public Map<String, Object> getLikesData(String worldName, String islandUUID) {
    return (Map<String, Object>) new AddonRequestBuilder()
        .addon("Likes")
        .label("island-likes")
        .addMetadata("world-name", worldName)
        .addMetadata("island", islandUUID)
        .request();
}

Description

Returns a Map<String, Number> containing top 10 island UUID's, and their values in given top.

Input

  • world-name: String - the name of the world.
  • type: String - the type of the Top. Supports: STARS, LIKES, DISLIKES, RANK.

Output

A Map containing the UUIDs of the islands is in the Top 10, mapped to the top value of their island.

Failure

This handler will return an empty map if the world-name has not been provided or if the world-name does not exist or is not a gamemode world or provided top type does not have any data in it.

Code example

public Map<String, Number> getTopTenLikes(String worldName, String type) {
    return (Map<String, Number>) new AddonRequestBuilder()
        .addon("Likes")
        .label("top-ten-likes")
        .addMetadata("world-name", worldName)
        .addMetadata("type", type)
        .request();
}

Events#

Description

Event that is triggered when player adds a new like to the island.

Event is only informative. Cannot be cancelled.

Link to the class: LikeAddEvent

Variables

  • UUID user - id of the player who added the like.
  • String islandId - id of the island which receive the like.

Class Loader Issue

Due Java Class Loader hierarchy, plugins cannot listen for the event directly. Only BentoBox addons can use event class directly.

Code example for Plugins

@EventHandler(priority = EventPriority.MONITOR)
public void onLike(BentoBoxEvent event) {
    if (event.getEventName().equals("LikeAddEvent")) {
        UUID user = (UUID) event.getKeyValues().get("user");
        String islandId = (String) event.getKeyValues().get("islandId");
    }
}

Code example for Addons

@EventHandler(priority = EventPriority.MONITOR)
public void onLike(LikeAddEvent event) {
    UUID user = event.getUser();
    String islandId = event.getIslandId();
}

Description

Event that is triggered when player removes his like from the island.

Event is only informative. Cannot be cancelled.

Link to the class: LikeRemoveEvent

Variables

  • UUID user - id of the player who removed the like.
  • String islandId - id of the island which lose the like.

Class Loader Issue

Due Java Class Loader hierarchy, plugins cannot listen for the event directly. Only BentoBox addons can use event class directly.

Code example for Plugins

@EventHandler(priority = EventPriority.MONITOR)
public void onLikeRemove(BentoBoxEvent event) {
    if (event.getEventName().equals("LikeRemoveEvent")) {
        UUID user = (UUID) event.getKeyValues().get("user");
        String islandId = (String) event.getKeyValues().get("islandId");
    }
}

Code example for Addons

@EventHandler(priority = EventPriority.MONITOR)
public void onLikeRemove(LikeRemoveEvent event) {
    UUID user = event.getUser();
    String islandId = event.getIslandId();
}

Description

Event that is triggered when player adds a new dislike to the island.

Event is only informative. Cannot be cancelled.

Link to the class: DislikeAddEvent

Variables

  • UUID user - id of the player who added the dislike.
  • String islandId - id of the island which receive the dislike.

Class Loader Issue

Due Java Class Loader hierarchy, plugins cannot listen for the event directly. Only BentoBox addons can use event class directly.

Code example for Plugins

@EventHandler(priority = EventPriority.MONITOR)
public void onDislike(BentoBoxEvent event) {
    if (event.getEventName().equals("DislikeAddEvent")) {
        UUID user = (UUID) event.getKeyValues().get("user");
        String islandId = (String) event.getKeyValues().get("islandId");
    }
}

Code example for Addons

@EventHandler(priority = EventPriority.MONITOR)
public void onDislike(DislikeAddEvent event) {
    UUID user = event.getUser();
    String islandId = event.getIslandId();
}

Description

Event that is triggered when player removes his dislike from the island.

Event is only informative. Cannot be cancelled.

Link to the class: DislikeRemoveEvent

Variables

  • UUID user - id of the player who removed the dislike.
  • String islandId - id of the island which lose the dislike.

Class Loader Issue

Due Java Class Loader hierarchy, plugins cannot listen for the event directly. Only BentoBox addons can use event class directly.

Code example for Plugins

@EventHandler(priority = EventPriority.MONITOR)
public void onDislikeRemove(BentoBoxEvent event) {
    if (event.getEventName().equals("DislikeRemoveEvent")) {
        UUID user = (UUID) event.getKeyValues().get("user");
        String islandId = (String) event.getKeyValues().get("islandId");
    }
}

Code example for Addons

@EventHandler(priority = EventPriority.MONITOR)
public void onDislikeRemove(DislikeRemoveEvent event) {
    UUID user = event.getUser();
    String islandId = event.getIslandId();
}

Description

Event that is triggered when player adds new stars to the island.

Event is only informative. Cannot be cancelled.

Link to the class: StarsAddEvent

Variables

  • UUID user - id of the player who added the stars.
  • String islandId - id of the island which receive the stars.
  • int value - the value of added stars (from 1 till 5)

Class Loader Issue

Due Java Class Loader hierarchy, plugins cannot listen for the event directly. Only BentoBox addons can use event class directly.

Code example for Plugins

@EventHandler(priority = EventPriority.MONITOR)
public void onStarsAdd(BentoBoxEvent event) {
    if (event.getEventName().equals("StarsAddEvent")) {
        UUID user = (UUID) event.getKeyValues().get("user");
        String islandId = (String) event.getKeyValues().get("islandId");
        int value = (int) event.getKeyValues().get("value");
    }
}

Code example for Addons

@EventHandler(priority = EventPriority.MONITOR)
public void onStarsAdd(StarsAddEvent event) {
    UUID user = event.getUser();
    String islandId = event.getIslandId();
    int value = event.getValue();
}

Description

Event that is triggered when player removes his stars from the island.

Event is only informative. Cannot be cancelled.

Link to the class: StarsRemoveEvent

Variables

  • UUID user - id of the player who added the stars.
  • String islandId - id of the island which lose the stars.

Class Loader Issue

Due Java Class Loader hierarchy, plugins cannot listen for the event directly. Only BentoBox addons can use event class directly.

Code example for Plugins

@EventHandler(priority = EventPriority.MONITOR)
public void onStarsRemove(BentoBoxEvent event) {
    if (event.getEventName().equals("StarsRemoveEvent")) {
        UUID user = (UUID) event.getKeyValues().get("user");
        String islandId = (String) event.getKeyValues().get("islandId");
    }
}

Code example for Addons

@EventHandler(priority = EventPriority.MONITOR)
public void onStarsRemove(StarsRemoveEvent event) {
    UUID user = event.getUser();
    String islandId = event.getIslandId();
}

Last update: March 8, 2021 09:25:17