Addon Recommendation
Info
Available for LabyMod users with version greater than 3.6.5 (LabyMod 4 included)
Overview
With this packet the server can recommend published addons to the user and the user can install them very simple in a GUI. Multiple add-ons can be suggested at the same time or can also be flagged as being required. You have to react to the response of the client if an addon is required.
Requirements
- LabyMod API (or use the Protocol without the API)
Info
The checkbox "Do not ask again" is on the client side, you do not have to worry about it on the server side!
Warning
In LabyMod 4 the uuid
key has been replaced with the namespace
field due to technical changes - both in the server-side request and the client response.
Example code
public void recommendAddons() {
JsonObject object = new JsonObject();
JsonArray addons = new JsonArray();
JsonObject addon = new JsonObject();
addon.addProperty( "uuid", "3bd2a3c0-0309-47d4-a6f9-320b0e93bce1" ); // Published uuid of the addon
addon.addProperty( "required", true ); // Required for this server?
addons.add( addon );
object.add( "addons", addons );
// Send to LabyMod using the API
LabyModProtocol.sendLabyModMessage( player, "addon_recommendation", object );
}
Warning
It only works with published addons! Here is the list of all available addons and their UUID: addons.json
Client response
Message key: addon_recommendation
You will receive this packet before the GUI is opened and after the GUI is closed.
gui_closed
Is the user prompt still open or is it closed?
all_installed
Are all recommended addons installed?
missing
List of addons which are not installed by the user of the recommended list