How to make entities also use my sword?

Started by TheEmperorScorpion on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make entities also use my sword?

Hey everyone, today im trying to make a fire sword that lights you on fire and also an ice sword that applies slowness on whoever it hits. But im also trying to make mobs that could wield these swords and also apply the effects whenever they swing at you, this also applies to zombies and other mobs that can pick up the swords. Any help would be appreciated thanks!

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hi uhhhh i think zombies and…
Thu, 09/11/2025 - 19:53

hi uhhhh i think zombies and skeletons etc. and custom modded mobs with either the biped or zombie model can already hold your custom swords?? it's just a matter of making them spawn naturally with the swords i guess

for that you would have to create a procedure with the global trigger (the big green block that appears when you first create the procedure) set to when a mob spawns, then check if the mob is a zombie or skeleton or whatever, then if a random number is less that a certain rarity value, set the item in its hand to one of your swords.

if you want custom mobs without the biped or zombie model to hold the sword, probably just check the option to turn on mob inventory and then manually make a different model for holding the sword that it switches to once it's holding the sword. or maybe there's a different way idk