From aff620f07282aaf83669fd36a3c973d1356491fc Mon Sep 17 00:00:00 2001 From: Veyronity Date: Fri, 27 Mar 2026 13:43:35 +0200 Subject: [PATCH 1/7] Remove world name from URL path --- src/main/java/net/earthmc/emcapi/EMCAPI.java | 2 +- src/main/resources/config.yml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/net/earthmc/emcapi/EMCAPI.java b/src/main/java/net/earthmc/emcapi/EMCAPI.java index 43ab026..6b0fa84 100644 --- a/src/main/java/net/earthmc/emcapi/EMCAPI.java +++ b/src/main/java/net/earthmc/emcapi/EMCAPI.java @@ -176,7 +176,7 @@ public Integrations integrations() { public String getURLPath() { String version = getConfig().getString("networking.api_version", "3"); - return "v" + version + "/" + getConfig().getString("networking.url_path"); + return "v" + version; } public APIDatabase getDatabase() { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index e8cb92b..a2c722d 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -10,9 +10,6 @@ networking: # The version number for endpoints api_version: 3 - # The URL path, formatted as: https://example.com/{api_version}/{url_path} - url_path: aurora - behaviour: # The maximum entries a player can enter when looking up objects by name max_lookup_size: 100 From 1f0d708e43fd4e10e0272a1e93893bbbd472b248 Mon Sep 17 00:00:00 2001 From: Veyronity Date: Fri, 27 Mar 2026 13:44:19 +0200 Subject: [PATCH 2/7] Move Discord endpoint to legacy --- .../endpoint/{ => legacy}/DiscordEndpoint.java | 2 +- .../earthmc/emcapi/manager/EndpointManager.java | 15 --------------- .../emcapi/manager/LegacyEndpointManager.java | 2 +- 3 files changed, 2 insertions(+), 17 deletions(-) rename src/main/java/net/earthmc/emcapi/endpoint/{ => legacy}/DiscordEndpoint.java (98%) diff --git a/src/main/java/net/earthmc/emcapi/endpoint/DiscordEndpoint.java b/src/main/java/net/earthmc/emcapi/endpoint/legacy/DiscordEndpoint.java similarity index 98% rename from src/main/java/net/earthmc/emcapi/endpoint/DiscordEndpoint.java rename to src/main/java/net/earthmc/emcapi/endpoint/legacy/DiscordEndpoint.java index 73d6277..153790c 100644 --- a/src/main/java/net/earthmc/emcapi/endpoint/DiscordEndpoint.java +++ b/src/main/java/net/earthmc/emcapi/endpoint/legacy/DiscordEndpoint.java @@ -1,4 +1,4 @@ -package net.earthmc.emcapi.endpoint; +package net.earthmc.emcapi.endpoint.legacy; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/src/main/java/net/earthmc/emcapi/manager/EndpointManager.java b/src/main/java/net/earthmc/emcapi/manager/EndpointManager.java index 2c56c15..b69ea75 100644 --- a/src/main/java/net/earthmc/emcapi/manager/EndpointManager.java +++ b/src/main/java/net/earthmc/emcapi/manager/EndpointManager.java @@ -6,7 +6,6 @@ import io.javalin.Javalin; import io.javalin.http.BadRequestResponse; import net.earthmc.emcapi.EMCAPI; -import net.earthmc.emcapi.endpoint.DiscordEndpoint; import net.earthmc.emcapi.endpoint.LocationEndpoint; import net.earthmc.emcapi.endpoint.MysteryMasterEndpoint; import net.earthmc.emcapi.endpoint.NearbyEndpoint; @@ -21,7 +20,6 @@ import net.earthmc.emcapi.endpoint.towny.list.PlayersListEndpoint; import net.earthmc.emcapi.endpoint.towny.list.QuartersListEndpoint; import net.earthmc.emcapi.endpoint.towny.list.TownsListEndpoint; -import net.earthmc.emcapi.integration.DiscordIntegration; import net.earthmc.emcapi.integration.MysteryMasterIntegration; import net.earthmc.emcapi.integration.QuartersIntegration; import net.earthmc.emcapi.integration.QuickShopIntegration; @@ -50,7 +48,6 @@ public void loadEndpoints() { loadQuartersEndpoint(); loadLocationEndpoint(); loadNearbyEndpoint(); - loadDiscordEndpoint(); loadOnlinePlayersEndpoint(); loadMysteryMasterEndpoint(); loadShopsEndpoint(); @@ -141,18 +138,6 @@ private void loadNearbyEndpoint() { }); } - private void loadDiscordEndpoint() { - DiscordEndpoint discordEndpoint = new DiscordEndpoint(plugin); - final DiscordIntegration discordIntegration = plugin.integrations().discordIntegration(); - - javalin.post(URLPath + "/discord", ctx -> { - discordIntegration.throwIfDisabled(); - - QueryBody parsedBody = parseBody(ctx.body()); - ctx.json(discordEndpoint.lookup(parsedBody.query, parsedBody.template, parsedBody.key)); - }); - } - private void loadOnlinePlayersEndpoint() { OnlineEndpoint onlineEndpoint = new OnlineEndpoint(); javalin.get(URLPath + "/online", ctx -> ctx.json(onlineEndpoint.lookup())); diff --git a/src/main/java/net/earthmc/emcapi/manager/LegacyEndpointManager.java b/src/main/java/net/earthmc/emcapi/manager/LegacyEndpointManager.java index b569ab8..c8c17a6 100644 --- a/src/main/java/net/earthmc/emcapi/manager/LegacyEndpointManager.java +++ b/src/main/java/net/earthmc/emcapi/manager/LegacyEndpointManager.java @@ -7,7 +7,7 @@ import io.javalin.http.BadRequestResponse; import kotlin.Pair; import net.earthmc.emcapi.EMCAPI; -import net.earthmc.emcapi.endpoint.DiscordEndpoint; +import net.earthmc.emcapi.endpoint.legacy.DiscordEndpoint; import net.earthmc.emcapi.endpoint.legacy.DocumentationEndpoint; import net.earthmc.emcapi.endpoint.LocationEndpoint; import net.earthmc.emcapi.endpoint.legacy.MudkipEndpoint; From 9c7e76d522afe7273db9bcf306095e91a8bbe0bf Mon Sep 17 00:00:00 2001 From: Veyronity Date: Fri, 27 Mar 2026 13:45:07 +0200 Subject: [PATCH 3/7] Update shop API - Add 1h cooldown on all-shop queries - Add "amount" to shop sale SSE events - Add "location" field with x,y,z in all shop json objects --- .../earthmc/emcapi/endpoint/ShopEndpoint.java | 18 ++++++++++++++++++ .../emcapi/sse/listeners/ShopSSEListener.java | 1 + .../net/earthmc/emcapi/util/EndpointUtils.java | 8 ++++++++ 3 files changed, 27 insertions(+) diff --git a/src/main/java/net/earthmc/emcapi/endpoint/ShopEndpoint.java b/src/main/java/net/earthmc/emcapi/endpoint/ShopEndpoint.java index dbe37e0..70754fe 100644 --- a/src/main/java/net/earthmc/emcapi/endpoint/ShopEndpoint.java +++ b/src/main/java/net/earthmc/emcapi/endpoint/ShopEndpoint.java @@ -12,19 +12,30 @@ import org.jetbrains.annotations.Nullable; import org.maxgamer.quickshop.api.shop.Shop; +import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; public class ShopEndpoint extends PostEndpoint> { private final QuickShopIntegration integration; + private static final Map LAST_QUERY_MAP = new ConcurrentHashMap<>(); + private static final int COOLDOWN_SECONDS = 3600; public ShopEndpoint(EMCAPI plugin) { super(plugin); this.integration = plugin.integrations().quickShopIntegration(); + plugin.getServer().getAsyncScheduler().runAtFixedRate(plugin, t -> + LAST_QUERY_MAP.entrySet().removeIf(entry -> entry.getValue() < Instant.now().getEpochSecond() - COOLDOWN_SECONDS), + 1, + 1, + TimeUnit.HOURS + ); } @Override @@ -48,6 +59,9 @@ public JsonElement getJsonElement(List object, @Nullable String key) { final Map shops = new ConcurrentHashMap<>(); int counter = 0; UUID keyOwner = KeyManager.getKeyOwner(key); + if (keyOwner == null) { + return null; + } final List> shopFutures = new ArrayList<>(); @@ -72,6 +86,10 @@ public JsonElement getJsonElement(List object, @Nullable String key) { } CompletableFuture.allOf(shopFutures.toArray(new CompletableFuture[]{})).join(); + if (shops.isEmpty()) { + LAST_QUERY_MAP.put(keyOwner, Instant.now().getEpochSecond()); + return null; + } final JsonObject shopsObject = new JsonObject(); for (final Map.Entry entry : shops.entrySet()) { diff --git a/src/main/java/net/earthmc/emcapi/sse/listeners/ShopSSEListener.java b/src/main/java/net/earthmc/emcapi/sse/listeners/ShopSSEListener.java index cd5ed26..4d843a1 100644 --- a/src/main/java/net/earthmc/emcapi/sse/listeners/ShopSSEListener.java +++ b/src/main/java/net/earthmc/emcapi/sse/listeners/ShopSSEListener.java @@ -27,6 +27,7 @@ public void onShopPurchase(ShopSuccessPurchaseEvent event) { String purchaser = getPlayerName(event.getPurchaser()); JsonObject saleMessage = new JsonObject(); saleMessage.add("shop", EndpointUtils.getShopObject(shop)); + saleMessage.addProperty("amount", event.getAmount()); if (isSelling) { saleMessage.addProperty("buyer", purchaser); sse.sendEvent("ShopSoldItem", saleMessage, owner); diff --git a/src/main/java/net/earthmc/emcapi/util/EndpointUtils.java b/src/main/java/net/earthmc/emcapi/util/EndpointUtils.java index 164d583..a4c7a68 100644 --- a/src/main/java/net/earthmc/emcapi/util/EndpointUtils.java +++ b/src/main/java/net/earthmc/emcapi/util/EndpointUtils.java @@ -179,6 +179,14 @@ public static JsonObject getShopObject(Shop shop) { jsonObject.addProperty("amount", shop.getItem().getAmount()); jsonObject.addProperty("type", shop.isSelling() ? "selling" : "buying"); jsonObject.addProperty("stock", shop.isSelling() ? shop.getRemainingStock() : shop.getRemainingSpace()); + + Location location = shop.getLocation(); + JsonObject locationObject = new JsonObject(); + locationObject.addProperty("x", location.getBlockX()); + locationObject.addProperty("y", location.getBlockY()); + locationObject.addProperty("z", location.getBlockZ()); + + jsonObject.add("location", locationObject); return jsonObject; } } From c86f20a4f20ceb67b2e0ee1ce216f98f77868b71 Mon Sep 17 00:00:00 2001 From: Veyronity Date: Fri, 27 Mar 2026 13:45:39 +0200 Subject: [PATCH 4/7] Add discord support for players endpoint - Add "discord" field with the linked discord ID - Allow querying players with their discord ID --- .../endpoint/towny/PlayersEndpoint.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main/java/net/earthmc/emcapi/endpoint/towny/PlayersEndpoint.java b/src/main/java/net/earthmc/emcapi/endpoint/towny/PlayersEndpoint.java index 9262094..d3ff25a 100644 --- a/src/main/java/net/earthmc/emcapi/endpoint/towny/PlayersEndpoint.java +++ b/src/main/java/net/earthmc/emcapi/endpoint/towny/PlayersEndpoint.java @@ -6,6 +6,7 @@ import com.palmergames.bukkit.towny.TownyAPI; import com.palmergames.bukkit.towny.TownyEconomyHandler; import com.palmergames.bukkit.towny.object.Resident; +import github.scarsz.discordsrv.DiscordSRV; import io.javalin.http.BadRequestResponse; import net.earthmc.emcapi.EMCAPI; import net.earthmc.emcapi.manager.KeyManager; @@ -16,8 +17,10 @@ import java.util.List; import java.util.UUID; +import java.util.regex.Pattern; public class PlayersEndpoint extends PostEndpoint { + private static final Pattern DISCORD_ID_PATTERN = Pattern.compile("^\\d{17,19}$"); public PlayersEndpoint(final EMCAPI plugin) { super(plugin); @@ -34,6 +37,12 @@ public Resident getObjectOrNull(JsonElement element, @Nullable String key) { } catch (IllegalArgumentException e) { resident = TownyAPI.getInstance().getResident(string); } + if (resident == null && DISCORD_ID_PATTERN.matcher(string).find()) { + UUID uuid = getUUIDFromDiscordId(string); + if (uuid != null) { + resident = TownyAPI.getInstance().getResident(uuid); + } + } if (resident != null && plugin.getOptOut().playerOptedOut(resident.getUUID()) && !resident.getUUID().equals(KeyManager.getKeyOwner(key))) { return null; @@ -85,6 +94,8 @@ public JsonElement getJsonElement(Resident resident, @Nullable String key) { playerObject.add("friends", EndpointUtils.getResidentArray(resident.getFriends())); + playerObject.addProperty("discord", getDiscordId(resident.getUUID())); + return playerObject; } @@ -97,4 +108,20 @@ private JsonArray getRankArray(List ranks) { return jsonArray; } + + private String getDiscordId(UUID uuid) { + if (!plugin.integrations().discordIntegration().isEnabled()) { + return null; + } + return DiscordSRV.getPlugin().getAccountLinkManager().getDiscordId(uuid); + } + + private UUID getUUIDFromDiscordId(String discordId) { + if (!plugin.integrations().discordIntegration().isEnabled()) { + return null; + } + if (!DISCORD_ID_PATTERN.matcher(discordId).find()) return null; + + return DiscordSRV.getPlugin().getAccountLinkManager().getUuid(discordId); + } } From 181850d374c6db9e85892ac3d37127239743133e Mon Sep 17 00:00:00 2001 From: Veyronity Date: Fri, 27 Mar 2026 13:45:58 +0200 Subject: [PATCH 5/7] Allow returning null in PostEndpoint#getJsonElement - Add basic javadoc --- .../emcapi/object/endpoint/PostEndpoint.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/earthmc/emcapi/object/endpoint/PostEndpoint.java b/src/main/java/net/earthmc/emcapi/object/endpoint/PostEndpoint.java index d20c642..96c7f4c 100644 --- a/src/main/java/net/earthmc/emcapi/object/endpoint/PostEndpoint.java +++ b/src/main/java/net/earthmc/emcapi/object/endpoint/PostEndpoint.java @@ -27,14 +27,28 @@ public String lookup(JsonArray queryArray, @Nullable JsonObject template, @Nulla if (object == null) { continue; } - jsonArray.add(getTemplateJsonElement(object, template, key)); + JsonElement formatted = getTemplateJsonElement(object, template, key); + if (formatted == null) { + continue; + } + jsonArray.add(formatted); } return jsonArray.toString(); } + /** + * @param element The query provided by the user + * @param key The API key, if any provided + * @return The queried object if found, otherwise null + */ public abstract T getObjectOrNull(JsonElement element, @Nullable String key); + /** + * @param object The object to describe + * @param key The API key, if any provided + * @return A JsonElement describing this object, or null if anything went wrong (E.g. cooldown, unauthorized key) + */ public abstract JsonElement getJsonElement(T object, @Nullable String key); public JsonElement getTemplateJsonElement(T object, JsonObject template, @Nullable String key) { From b59250669409e95458f6eeabe34c04251de43f70 Mon Sep 17 00:00:00 2001 From: Veyronity Date: Fri, 27 Mar 2026 17:12:48 +0200 Subject: [PATCH 6/7] Increase keepalive frequency, invalidate disconnected clients faster --- src/main/java/net/earthmc/emcapi/sse/SSEManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/earthmc/emcapi/sse/SSEManager.java b/src/main/java/net/earthmc/emcapi/sse/SSEManager.java index e7a5ff6..1ea4f49 100644 --- a/src/main/java/net/earthmc/emcapi/sse/SSEManager.java +++ b/src/main/java/net/earthmc/emcapi/sse/SSEManager.java @@ -143,7 +143,7 @@ public void loadSSE() { for (final ClientData data : CLIENTS.values()) { data.client.sendComment("keepalive"); } - }, 5L, 5L, TimeUnit.MINUTES); + }, 30, 30, TimeUnit.SECONDS); } public void shutdown() { From b79e719724eae612f99c0b2364e25b5be2cab302 Mon Sep 17 00:00:00 2001 From: Veyronity Date: Sat, 11 Apr 2026 23:37:44 +0200 Subject: [PATCH 7/7] Update docs --- docs/discord.md | 2 +- docs/global-player-stats.md | 88 ------------------------------------- docs/location.md | 2 +- docs/mysterymaster.md | 2 +- docs/nations.md | 2 +- docs/nearby.md | 2 +- docs/online.md | 2 +- docs/players.md | 2 +- docs/quarters.md | 2 +- docs/server.md | 2 +- docs/shop.md | 2 +- docs/sse.md | 4 +- docs/towns.md | 2 +- 13 files changed, 13 insertions(+), 101 deletions(-) delete mode 100644 docs/global-player-stats.md diff --git a/docs/discord.md b/docs/discord.md index 860ccde..af8cf24 100644 --- a/docs/discord.md +++ b/docs/discord.md @@ -1,5 +1,5 @@ # Discord Endpoint -Accessed at https://api.earthmc.net/v3/aurora/discord?query= +Accessed at https://api.earthmc.net/v4/discord Determine a player's Discord ID from their Minecraft UUID and vice versa using DiscordSRV's link feature. The player needs to have linked their account beforehand (`/discord link` in game). diff --git a/docs/global-player-stats.md b/docs/global-player-stats.md deleted file mode 100644 index 474590a..0000000 --- a/docs/global-player-stats.md +++ /dev/null @@ -1,88 +0,0 @@ -# Player Statistics Endpoint -Accessed at https://api.earthmc.net/v3/aurora/player-stats - -> [!WARNING] -> As of July 28, 2025, the player statistics endpoint is no longer updated with new data and is considered deprecated. This was done because of the high cost of reading the statistics for all players. - -Returns a JSON object with the aggregated statistics for all players for [untyped statistics](https://minecraft.wiki/w/Statistics#List_of_custom_statistic_names). - -The following is an example of the response to a **GET** request to the above URL. -```json5 -{ - "damage_resisted": 152, - "fish_caught": 0, - "animals_bred": 1, - "raid_win": 0, - "interact_with_brewingstand": 50, - "play_record": 0, - "interact_with_lectern": 25, - "damage_absorbed": 329, - "interact_with_blast_furnace": 9, - "trigger_trapped_chest": 0, - "walk_one_cm": 7603889, - "interact_with_cartography_table": 10, - "open_barrel": 16, - "pot_flower": 1, - "boat_one_cm": 278944, - "time_since_rest": 1428316, - "pig_one_cm": 0, - "climb_one_cm": 392920, - "strider_one_cm": 0, - "clean_shulker_box": 0, - "minecart_one_cm": 20103, - "inspect_dropper": 0, - "target_hit": 0, - "play_time": 59989386, - "damage_blocked_by_shield": 0, - "total_world_time": 59989386, - "inspect_hopper": 4, - "jump": 676210, - "interact_with_crafting_table": 47, - "interact_with_smithing_table": 5, - "interact_with_anvil": 28, - "deaths": 237, - "crouch_one_cm": 118920, - "leave_game": 2606, - "play_noteblock": 0, - "sleep_in_bed": 20, - "aviate_one_cm": 66262, - "open_chest": 377, - "sneak_time": 191138, - "interact_with_grindstone": 0, - "open_shulker_box": 0, - "clean_armor": 3, - "mob_kills": 625, - "fill_cauldron": 31, - "damage_dealt": 79494, - "walk_under_water_one_cm": 4601850, - "enchant_item": 0, - "player_kills": 3, - "open_enderchest": 249, - "fly_one_cm": 574812589, - "interact_with_stonecutter": 0, - "interact_with_smoker": 0, - "interact_with_furnace": 70, - "tune_noteblock": 0, - "fall_one_cm": 647687, - "raid_trigger": 0, - "swim_one_cm": 163930, - "inspect_dispenser": 26, - "drop_count": 3263, - "damage_dealt_absorbed": 0, - "eat_cake_slice": 0, - "time_since_death": 1428273, - "horse_one_cm": 439916, - "traded_with_villager": 86, - "damage_dealt_resisted": 10269, - "use_cauldron": 21, - "talked_to_villager": 65, - "sprint_one_cm": 79906439, - "interact_with_loom": 3, - "interact_with_campfire": 36, - "damage_taken": 15871, - "clean_banner": 0, - "bell_ring": 61, - "interact_with_beacon": 0, - "walk_on_water_one_cm": 759287 -} -``` diff --git a/docs/location.md b/docs/location.md index 4824125..67ca5e2 100644 --- a/docs/location.md +++ b/docs/location.md @@ -1,5 +1,5 @@ # Location Endpoint -Accessed at https://api.earthmc.net/v3/aurora/location +Accessed at https://api.earthmc.net/v4/location Get Towny-related information on a specific location, for instance if it belongs to a town. diff --git a/docs/mysterymaster.md b/docs/mysterymaster.md index afc6e80..a535018 100644 --- a/docs/mysterymaster.md +++ b/docs/mysterymaster.md @@ -1,5 +1,5 @@ # Mystery Master Endpoint -Accessed at https://api.earthmc.net/v3/aurora/mm +Accessed at https://api.earthmc.net/v4/mm The following is an example of the response to a **GET** request to the above URL. ```json5 diff --git a/docs/nations.md b/docs/nations.md index 115f827..4d3d267 100644 --- a/docs/nations.md +++ b/docs/nations.md @@ -1,5 +1,5 @@ # Nations Endpoint -Accessed at https://api.earthmc.net/v3/aurora/nations +Accessed at https://api.earthmc.net/v4/nations The following is an abridged version of the response to a **GET** request to the above URL which contains every currently registered Towny nation within a JSON array. ```json5 diff --git a/docs/nearby.md b/docs/nearby.md index f50609c..68729f6 100644 --- a/docs/nearby.md +++ b/docs/nearby.md @@ -1,5 +1,5 @@ # Nearby Endpoint -Accessed at https://api.earthmc.net/v3/aurora/nearby +Accessed at https://api.earthmc.net/v4/nearby Returns an array of all the elements of type `search_type` (`TOWN`) in a given `radius` of a target location of type `target_type` (`TOWN`|`COORDINATE`). diff --git a/docs/online.md b/docs/online.md index 0d9bb1f..0ab0007 100644 --- a/docs/online.md +++ b/docs/online.md @@ -1,5 +1,5 @@ # Online Players Endpoint -Accessed at https://api.earthmc.net/v3/aurora/online +Accessed at https://api.earthmc.net/v4/online Returns a JSON object with a count of how many players are online and their names and uuid. Players that have opted themselves out of appearing in the API will not appear in the players array, but are included in the count. diff --git a/docs/players.md b/docs/players.md index 57db83f..68e0633 100644 --- a/docs/players.md +++ b/docs/players.md @@ -1,5 +1,5 @@ # Players Endpoint -Accessed at https://api.earthmc.net/v3/aurora/players +Accessed at https://api.earthmc.net/v4/players The following is an abridged version of the response to a **GET** request to the above URL which contains every currently registered Towny resident within a JSON array. ```json5 diff --git a/docs/quarters.md b/docs/quarters.md index fd2e15c..25698ef 100644 --- a/docs/quarters.md +++ b/docs/quarters.md @@ -1,5 +1,5 @@ # Quarters Endpoint -Accessed at https://api.earthmc.net/v3/aurora/quarters +Accessed at https://api.earthmc.net/v4/quarters The following is an abridged version of the response to a **GET** request to the above URL which contains every currently registered quarter within a JSON array. ```json5 diff --git a/docs/server.md b/docs/server.md index 9139b74..1ad5c98 100644 --- a/docs/server.md +++ b/docs/server.md @@ -1,5 +1,5 @@ # Server Endpoint -Accessed at https://api.earthmc.net/v3/aurora/ +Accessed at https://api.earthmc.net/v4/ The following is an example of the response to a **GET** request to the above URL. ```json5 diff --git a/docs/shop.md b/docs/shop.md index 1c6b0cb..7a41557 100644 --- a/docs/shop.md +++ b/docs/shop.md @@ -1,5 +1,5 @@ # Shop Endpoint -Accessed at https://api.earthmc.net/v4/aurora/shop +Accessed at https://api.earthmc.net/v4/shop The shop endpoint provides information about player-owned QuickShops. It is important to note that the information here is not public, and players can only access their own shops' information, using their API key. diff --git a/docs/sse.md b/docs/sse.md index 5d15c73..319f243 100644 --- a/docs/sse.md +++ b/docs/sse.md @@ -1,5 +1,5 @@ # Server Sent Events (SSE) -Accessed at https://api.earthmc.net/v4/aurora/events +Accessed at https://api.earthmc.net/v4/events Server sent events allow clients to connect & listen to specific events sent by the server. @@ -19,7 +19,7 @@ These are the current events available: "ShopSoldItem", "ShopBoughtItem", "ShopOutOfStock", "ShopOutOfSpace", "ShopOutOfGold" ``` Clients must specify which events to listen to by specifying a `?listen=` query parameter in the URL. -Example: `https://api.earthmc.net/v4/aurora/events?listen=NewDay,TownDeleted,NationRenamed`. This would make it so only these events are sent to the client. +Example: `https://api.earthmc.net/v4/events?listen=NewDay,TownDeleted,NationRenamed`. This would make it so only these events are sent to the client. Most Town events include a `town` field with the name & UUID of the town. The same applies to nations with a `nation` field. ### Authorized player events diff --git a/docs/towns.md b/docs/towns.md index 9034cc0..7fe7455 100644 --- a/docs/towns.md +++ b/docs/towns.md @@ -1,5 +1,5 @@ # Towns Endpoint -Accessed at https://api.earthmc.net/v3/aurora/towns +Accessed at https://api.earthmc.net/v4/towns The following is an abridged version of the response to a **GET** request to the above URL which contains every currently registered Towny town within a JSON array. ```json5