Wasted - Plugin for changing death messages

This is a discussion topic for the Ore project, Wasted. View the full project on Ore for downloads and more information.


Wasted

LocaleAPI - required.

Plugin for setting custom death messages.
The plugin supports work with mods.
The plugin takes into account the in-game rule of showing death messages.

All messages are stored in localization files → {CONFIG_DIR}/localeapi/wasted/*.
Initially, the plugin does not contain death messages. They will be added to the localization by default with each new unique player death.
If you’d like, you can provide me with a default localization file filled with all the vanilla death messages and I’ll add it to the next release.

Commands:

/sponge plugins refresh wasted - Reload plugin config.

Placeholders:

%player% - The Player Who Died
%killer% - Player Killer
%indirect-killer%- Killer player who indirectly used %killer%
%item% - An item in the hands of a murderer.

API7 Docs → GitHub

Reading over your code, I have a couple of questions.

  • Text.of(TextSerializers.formattingCode('§').serialize(TextSerializers.FORMATTING_CODE.deserialize(string)));
    
    I’ve seen this in like five places and I have no idea what the purpose of it is. What’s wrong with just TextSerializers.FORMATTING_CODE.deserialize(string)?
  • Why are you @Injecting a logger but then overwriting it with a LoggerFactory call?
  • Why are you using the /assets directory, but then using getResource anyway instead of the Asset API?
  • Why do you have a custom mcmod.info instead of letting it auto-generate?
1 Like

I had problems with the loss of text formatting, possibly because of my mistakes. So I decided to change it to the standard one for the game.

I have little experience so far. I will take this into account in the future.

I tried to use the Asset API, but every time I got an error that the file was not found. I already had the code ready for Asset, but I could not use it.

I type the code in Eclipse, this program can not generate it.

There is nothing that what you wrote will do that what I wrote won’t do.

Possibly your bug is that you are trying to use the full file path. With the asset API you are not supposed to have the /assets/myplugin, only the file name after that.

The Sponge API is what autogenerates it, not your IDE. Anything using Maven or Gradle, or that explicitly enabled APT, should have it autogenerated.

I will take this into account in my future work.

Does it work for custom messages for specific players?

I didn’t even think about this when I created the plugin.

Is it a possibility?

I think for this need to change the code of the plugin. But I do not have time for this now.

I have problem
can i fix it?

when I blew up with TNT
massege -> Error 404

when I fall
massege -> Error 404

when I drowned
massege -> Error 404 … “Unknown” message

All same message…

Turn on debug in the config. In the console, the plugin displays the cause of death of the player. Next, enter it in the config.
Sponge developers changed some of the names after I published the plugin, which is why you got this problem.

A new version has been released for Wasted, it is available for download here.


Release for API8.

A new version has been released for Wasted, it is available for download here.


Deleted the key of the weapons configuration section.

A new version has been released for Wasted, it is available for download here.


Fixed config reload.

A new version has been released for Wasted, it is available for download here.


Support API10.
The format for writing text to localization files has been changed.
Added message variation indicating a block when a player dies from falling, drowning, or strangulation. This can seriously increase the size of the localization, but allows for more elaborate message customization.
If you notice bugs or some messages won’t be written/read(from localization), report it on GitHub or Discord.