Entity AI: Kill player with custom deadth message

Started by awesomecreeck on Thu, 02/18/2021 - 10:24

Topic category: Help with modding (Java Edition)

Last seen on 10:00, 15. Aug 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Entity AI: Kill player with custom deadth message
Thu, 02/18/2021 - 10:24

So I'm making a mob called 'Nosed Villager' which has a long nose. I'm trying to implement the feature in which if any mob (including player) attacked the nosed villager, it will kill the attacked mob with a custom death message. How can I do it?

 

Last seen on 23:35, 15. May 2022
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You could make an "When this…
Thu, 02/18/2021 - 15:00

You could make an "When this entity kills another one" procedure and just make it say "Nosed Villager killed %s" (note, i don't know if %s works with the chat procedures or if there's any other things like %s)

Last seen on 10:00, 15. Aug 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
%s only works in System.out…
Thu, 02/18/2021 - 16:40

%s only works in System.out.printf() i guess. I know java but I'm not sure about it. I need it to show the custom death message on the 'You Died!' screen.