Skip to content

Likes#

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

Created and maintained by BONNe.

Installation#

  1. Install BentoBox and run it on the server at least once to create its data folders.
  2. Place this jar in the addons folder of the BentoBox plugin.
  3. Restart the server.
  4. The addon will create a data folder and inside the folder will be a config.yml.
  5. Stop the server.
  6. Edit config.yml how you want.
  7. Restart the server.

Configuration#

The main config.yml file contains basic information about game-mode addon setup.

panels allows to customize some user accessible panels.

config.yml#

After addon is successfully installed, it will create config.yml file. Every option in this file comes with comments about them. Please check file for more information. You can find the latest config file: config.yml

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

The most important config option is mode:

Likes mode

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.

You can use only one mode at the time.

Customizable GUI's#

BentoBox 1.17 API introduced a function that allows to implement customizable GUI's. This addon is one of the first one which uses this functionality. We tried to be as simple as possible for customization, however, some features requires explanation. You can find more information how BentoBox custom GUI's works here: Custom GUI's

How can I customize GUI's

To customize Addon GUI's you need to have version 2.2. This is a first version that has implemented them. Addon will create a new directory under /plugins/BentoBox/addons/Likes with a name panels

Currently you can customize 3 GUI:

  • View Panel: view_panels - panel that allows to view who liked player island.
  • Top Panel: top_panel - panel that contains top islands by certain value.
  • Manage Panel: manage_panels - panel that allows to add like/dislike or stars.

View and Manage panels contains 3 different panels for each mode.

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_#rank#% Island owner name who are in place #rank# by likes 1.7.0
%[gamemode]_likes_addon_top_likes_island_name_#rank#% Island name which are in place #rank# by likes 1.7.0
%[gamemode]_likes_addon_top_likes_count_#rank#% Count of likes for island that are in place #rank# by likes 1.7.0
%[gamemode]_likes_addon_top_dislikes_owner_name_#rank#% Island owner name who are in place #rank# by dislikes 1.7.0
%[gamemode]_likes_addon_top_dislikes_island_name_#rank#% Island name which are in place #rank# by dislikes 1.7.0
%[gamemode]_likes_addon_top_dislikes_count_#rank#% Count of dislikes for island that are in place #rank# by dislikes 1.7.0
%[gamemode]_likes_addon_top_rank_owner_name_#rank#% Island owner name who are in place #rank# by rank 1.7.0
%[gamemode]_likes_addon_top_rank_island_name_#rank#% Island name which are in place #rank# by rank 1.7.0
%[gamemode]_likes_addon_top_rank_count_#rank#% Rank value for island that are in place #rank# by rank 1.7.0
%[gamemode]_likes_addon_top_stars_owner_name_#rank#% Island owner name who are in place #rank# by stars 2.0.0
%[gamemode]_likes_addon_top_stars_island_name_#rank#% Island name which are in place #rank# by stars 2.0.0
%[gamemode]_likes_addon_top_stars_count_#rank#% Average stars for island that are in place #rank# 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
Ukrainian uk progress
Dutch nl progress

API#

Since Likes 2.2.0 and BentoBox 1.17 other plugins can access to the Likes addon data directly.

Maven Dependency#

Likes provides an API for other plugins. This covers version 2.2.0 and onwards.

Note

Add the Likes dependency to your Maven POM.xml:

    <repositories>
        <repository>
            <id>codemc-repo</id>
            <url>https://repo.codemc.io/repository/maven-public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>world.bentobox</groupId>
            <artifactId>likes</artifactId>
            <version>2.2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

Use the latest Likes version.

The JavaDocs for Likes can be found here.

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.

Example

@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.

Example

@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.

Example

@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.

Example

@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)

Example

@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.

Example

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

Addon Request Handlers#

Till BentoBox 1.17 we had an issue with accessing data outside BentoBox environment doe to the class loader we used to load addons. This meant that data was accessible only from other addons. But BentoBox implemented PlAddon functionality, which means that request handlers are not necessary anymore.

More information about addon request handlers can be found here

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();
}

Last update: January 8, 2024 03:23:57