Please update, not working anymore
Hello, it's not working anymore, I'm using paper, a bukkit based server, thank you
What minecraft version? What error do you get in the server console or game (if any)?
Is the plugin not starting at all, or does the error occur when using certain features or triggers?
The latest, 1.16.5
The plugin is starting, the events are triggered but error 400 The webhook is working fine on other plugins
[03:25:07 WARN]: [SimpleWebhooks] POST webhook for URL (edited) returned error code 400: Bad Request
[03:25:07 ERROR]: [SimpleWebhooks] Server returned HTTP response code: 400 for URL: (edited)
Rysanlos left the game
[03:25:15 INFO]: UUID of player Rysanlos is (edited)
[03:25:15 WARN]: [SimpleWebhooks] POST webhook for URL (edited) returned error code 400: Bad Request
[SimpleWebhooks] Server returned HTTP response code: 400 for URL: (edited)
[03:25:15 INFO]: Rysanlos joined the game
Those errors come directly from the server you are making the request to, not the plugin.
400 means the receiving server didn't understand the data that it received.
Make sure your query and json data are correct. The query data is appended to the url, and the json key-value pairs are formatted as proper json and sent as the request body. When using json data, the request is sent as a POST request, make sure this is what the receiving server expects.
~~If the receiving server expects a User-Agent, this could potentially be a problem as I don't believe this plugin currently includes one. Most servers don't require one, but some do. If you think this is the issue I should be able to add this quickly.~~ EDIT: just checked and I actually did have it send a User-Agent, mimicking a browser.
Without knowing the API of the server you are trying to reach, it's gonna be a bit hard for me to troubleshoot more in-depth. If you can provide any of the config file, it might be helpful - at the very least I could tell you exactly what the plugin is sending out.
I'm using the config exemple generated by default, just changed the url to my webhook, this webhook was tested with another webhook plugin fine. I will send you my config file when I'll be back at my place, thank you
I'm using this config.txt (I edited yml to txt to upload here)
And when I trigger the join event, it's have this error:

EDIT: The only think working is chat sync, but join and quit trigger error 400
Discord's webhook API expects that the json values are "content" and optionally "username" and "avatar_url", if you want to manually specify the name/avatar that will be displayed in Discord (otherwise it defaults to whatever was set up in your discord server's webhook settings).
It doesn't recognize a value called "message" or "player-count" (as those were just examples, not specifically for discord) which is why it is giving an error. The example I wrote for the chat sync one does follow the Discord API, so that is why that one works,
You can see the full Discord documentation here https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params although the rest is not really relevant for this plugin (I think the only other option that might work is "tts")
This is the config that I use on my own server, to send join, quit, and chat messages to Discord, also supports sending messages via command (or command block) with /webhooks execute discord {message to send...}
webhooks:
# Webhooks in this section are executed automatically when any player joins the server.
join:
discord-join:
url: https://discord.com/api/webhooks/{id}/{token}
json:
content: "{EVENT_MESSAGE}"
# Webhooks in this section are executed automatically when any chat message is sent.
chat:
# An example to mirror your server's chat into a Discord channel. Create your Discord webhook URL in Server/Channel Settings.
# The player's display name and skin will also be sent into Discord, so it looks like a normal Discord message.
discord-chat-sync:
url: https://discord.com/api/webhooks/{id}/{token}
json:
content: "{CHAT_MESSAGE}"
username: "{PLAYER_DISPLAYNAME}"
avatar_url: "https://minotar.net/helm/{PLAYER_USERNAME}"
# Webhooks in this section are executed automatically when any player leaves the server.
quit:
discord-quit:
url: https://discord.com/api/webhooks/{id}/{token}
json:
content: "{EVENT_MESSAGE}"
# Webhooks in this section are not executed automatically - only through the command "/webhooks execute <webhook name> [params...]""
other:
discord:
url: https://discord.com/api/webhooks/{id}/{token}
json:
content: "{COMMAND_PARAM_ALL}"
Ok thank you, it's working now, BUT, I try to make embeds works, and no success no far with any different combinaisons of "", [] and even {}. The official documentation of discord json uses this format:
{
"content": "",
"embeds": [
{
"description": "{PLAYER_USERNAME} vient de rejoindre le jeu",
"color": 2096896
}
],
"avatar_url": "https://crafatar.com/avatars/{PLAYER_UUID}"
}
but on your plugin config, the {], the commas , and the [] are missing, and no official documentation uses your formatting, so I'm a bit lost... I successfully made the config like this without crashing the plugin:
webhooks:
# Webhooks in this section are executed automatically when any player joins the server.
join:
discord-join:
url: https://discord.com/api/webhooks/edited
json:
content: ""
embeds: [
description: "{PLAYER_USERNAME} vient de rejoindre le jeu",
color: "2096896"
]
avatar_url: "https://crafatar.com/avatars/{PLAYER_UUID}"
but of course it ends with error 400 if not crashing... Any tips?
I even tried a json to yalm converter:
webhooks:
# Webhooks in this section are executed automatically when any player joins the server.
join:
discord-join:
url: https://discord.com/api/webhooks/edited
json:
content: "test"
embeds:
- description: "{PLAYER_USERNAME} vient de rejoindre le jeu"
- color: "2096896"
avatar_url: "https://crafatar.com/avatars/{PLAYER_UUID}"
with no luck
try this:
embeds: “[description:\"{PLAYER_USERNAME} vient de rejoindre le jeu\",color:\"2096896\"]”
or this:
embeds: [description:"{PLAYER_USERNAME} vient de rejoindre le jeu",color:"2096896"]
I put it all in one line, wrapped it in quotes, and escaped the quotes inside the json. This might work but I am not 100% sure as I didn’t really plan for more advanced scenarios like this.
If that does not work I think I could update the plugin to support raw json directly, as an alternative to the current auto-formatted key-value system.
None of these two are working sadly :/ the first give 400 error and the second crash the plugin