Tags
Creators
Details
10.7.9
Compatibility
Changes
CraftersStaff v10.7.9 โ Sanctions Webhooks & LibertyBans Integration
๐ Summary
- More flexible and granular sanctions webhook integration.
- New sanction types:
UNMUTEandUNWARNwith their own templates. - Per-type toggles (
enabled: true/false) to easily enable/disable each webhook. - Clear separation between the Discord endpoint (
webhook-url) and the embed clickable link (link). - Reinforced webhook client: correct JSON escaping and HTTP error body logging.
- Command observer for sanctions (ban/mute/warn/kick/unban/unmute/unwarn).
- Reflective LibertyBans hook (PunishEvent) prepared; ID capture temporarily disabled.
- Unified console prefix (no duplicates), independent of
general.prefix. - Safe "update available" message with fallback.
- Safe
cstaff_aliases to avoid command name conflicts.
โ๏ธ Technical Changes
๐จ Sanctions Manager
- New types:
UNMUTEandUNWARN. - Per-type
enabled: true/falsecheck before sending each webhook. - Support for
webhook-url(endpoint) andlink(embed URL), withurlas backwards compatibility fallback.
๐๏ธ Sanctions Command Observer
- Maps commands to sanction types and fires the webhook:
- ban/tempban/ipban โ
BAN(orBANIPif containsip) - mute/tempmute/ipmute โ
MUTE - unban/pardon โ
UNBAN - unmute โ
UNMUTE - warn โ
WARN - unwarn โ
UNWARN
- ban/tempban/ipban โ
โ๏ธ LibertyBans Integration (Reflective)
- Hook to
PunishEventvia Omnibus to capture sanction data without compile-time dependency. - ID capture temporarily disabled (sends
null) for multi-version stability. LibertyBansadded tosoftdependinplugin.yml.
๐ Discord Webhook Client
- Correct escaping of JSON characters (quotes, slashes, newlines, control unicode).
- Error body reading on HTTP 4xx/5xx responses for clear diagnostics.
๐ฅ๏ธ Unified Console Prefix
- All logs go through
ConsoleUtilwith the internal prefix[CraftersStaff], without using or duplicatinggeneral.prefix.
๐ Safe Update Fallback
- If
general.update-availableis missing from language files, a default message is used.
๐ Conflict-free Command Aliases
- A
cstaff_<name>alias is automatically added for every command loaded fromcommands.yml.
๐ Configuration Changes
New file: sanctions-webhooks.yml
- Global:
sanctions-webhook.enabledโ enables/disables all sanction webhooks.sanctions-webhook.use-embedโ use embed or simple message.
- Per type (ban, mute, unmute, kick, warn, unwarn, unban, banip):
enabled: true/false(new)webhook-urlโ Discord endpoint (new;urlstill works as fallback)linkโ clickable embed title URL (new)title,description,content,color
- New sections for
unmuteandunwarnwith their own titles, descriptions and colors. IDremoved from templates temporarily (capture disabled for stability).
๐ Webhook Send Flow
- A staff member executes a sanction command (or LibertyBans fires the event).
SanctionsCommandListener(orLibertyBansHook) interprets type, target, staff, duration and reason.SanctionsWebhookManagerchecks if the type is enabled, resolveswebhook-urlandlink, builds the embed and sends it.- On HTTP error, the log shows the code and Discord's response body.
๐งช Quick Testing Guide
- Set
webhook-urlfor the desired types insanctions-webhooks.yml. Optionally setlinkandenabled. - Restart the server.
- Run e.g.
/mute <player> 10m testand check your Discord channel. - Test
/unmute <player>and/unwarn <player>to see the new embeds. - Set a type to
enabled: falseand repeat โ that webhook should not fire.
๐ Final Notes
The webhook system is now modular per type and more resilient against API errors. LibertyBans ID capture will be re-enabled once the stable API for version 1.1.2 is confirmed in your environment. In the meantime, ID will not appear in embeds to avoid empty placeholders.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:UAUjFHnX:zP33sB9B"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:UAUjFHnX:zP33sB9B"
}

