[TUTORIAL] Custom death messages

Started by Shocking Artist on Tue, 07/07/2020 - 16:02

Topic category: User side tutorials

Last seen on 01:43, 23. Oct 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
[TUTORIAL] Custom death messages
Tue, 10/20/2020 - 20:01 (edited)

Ever played Rlcraft and wonder how the HECK did they create those CUSTOM DEATH MESSAGES?

Well, it's actually quite easy! You only need to create a custom damage source

First, create a procedure and choose the block name deal damage with source, input a number for amount (it would not matter as the code will be changed) and click on GENERIC.

Then, find this line of code:

entity.attackEntityFrom(DamageSource.GENERIC, (float) amount);

and change it to this:

DamageSource a = new DamageSource("b").setDamageBypassesArmor();

This line of code defines a new damage source

The a and b are things you will need to name yourself.

Below that line, add this:

entity.attackEntityFrom(a,100);

Where the 100 could be the amount you want the damage to be (1 heart = 2) and the a should be as same as the a defined above

Success! Now we need to add the translation keys! Head over to localization on the side bar!

Click on add localization entry

In the popup input box (Key name) , type

death.attack.b

Where the b should be the b defined above!

In the localized text field, type:

%1$s whatever you want the death message to be

Where the %1$s is the player name!

So if you typed

%1$s died LOL GET REKED

and the player is Mike66

It will say Mike66 died LOL GET REKED

Heads Up! You will also need to add a second death message that appears when the player has been attacked by another entity in the last few seconds before his death:

Example:

%1$s died from diabetes whilst fighting %2$s

These %1$s texts are Formatters, click here to get more info (NERD!)

AND THAT'S IT!

Errors? Post it below!

Edited by Shocking Artist on Tue, 10/20/2020 - 20:01
Last seen on 01:43, 23. Oct 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks!
Tue, 07/07/2020 - 16:44

thanks!

Last seen on 01:43, 23. Oct 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
hehe the ticket is postponed
Wed, 07/08/2020 - 01:29

hehe the ticket is postponed

Last seen on 12:26, 26. Sep 2020
Joined Feb 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
does sit work with potions…
Fri, 07/10/2020 - 09:58

does sit work with potions effects?

 

Last seen on 01:43, 23. Oct 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
YES!
Fri, 07/10/2020 - 17:33

YES!

Last seen on 06:06, 24. Oct 2020
Joined Dec 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I love this, I can use this…
Mon, 07/20/2020 - 08:37

I love this, I can use this in my mods!! Thank you Shocking Artist!

Last seen on 07:12, 24. Oct 2020
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Great! this will help me a…
Mon, 07/20/2020 - 09:14

Great! this will help me a lot! Thank you Shocking Artist!

Last seen on 11:47, 24. Oct 2020
Joined May 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think Klemen could add…
Mon, 07/20/2020 - 10:47

I think Klemen could add this feature sooner that he thinks :)

Last seen on 19:03, 24. Oct 2020
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think Klemen could add…
Mon, 07/20/2020 - 14:51

I think Klemen could add this feature sooner that he thinks :)

I have a schedule of things to add, I am amazed how after all this time I still have to repeat this.

There are over 100 tickets open here, and a few 100 in my internal TODO backlog. Give me some slack, lol.

I believe you could understand the problem is not in one ticket, but the fact there are many of them and I can only work one by one...

Last seen on 11:47, 24. Oct 2020
Joined May 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
yeah
Mon, 07/20/2020 - 18:11

yeah

Last seen on 11:47, 24. Oct 2020
Joined May 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
just some people thinks…
Mon, 07/20/2020 - 18:12

just some people thinks sometimes you dont add a feature early because you dont know to code it yet XD

Last seen on 19:03, 24. Oct 2020
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
just some people thinks…
Tue, 07/21/2020 - 06:03

just some people thinks sometimes you dont add a feature early because you dont know to code it yet XD

Now you know the real reason, I hope I won't have to explain it to you again next week

Last seen on 11:47, 24. Oct 2020
Joined May 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
"next week"? 🤔
Tue, 07/21/2020 - 11:00

"next week"? 🤔

Last seen on 01:43, 23. Oct 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Klemen has things to do,…
Fri, 07/31/2020 - 01:17

Klemen has things to do, that's why I made the tutorial

Klemen, Don't add this in Mcreator, so as to keep some mods unique