How To Make Entity Drop What They're Holding

Started by husaria1863 on

Topic category: Help with MCreator software

Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How To Make Entity Drop What They're Holding

Basically What I'm trying to do is make a sword that when you hit an entity (a skeleton) it forces them to drop what they're holding in their main hand. How can I do that with procedures?

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can create a new…
Mon, 08/09/2021 - 19:24

You can create a new procedure on when the entity dies, it will spawn the same item that they were holding.

For vanilla mobs, you can add a global procedure. Create a new procedure and set the global trigger to when the entity dies. 
Then an if and do block, where the if would check for the entity, and if it has the item. (In Entity Data, the main hand and the off hand procedure block). Then in the Do area, simply add the "Spawn Item/gem" block with the item they are holding. 

You can add a random variable, where it would damage the item if you want to make it like vanilla. 

If you need more help, let me know!

Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
See that would work however,…
Mon, 08/09/2021 - 20:38

See that would work however, the item that I spawned spawns at my coordinates instead of at the entity i'm killing.

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That's easy to fix, simply…
Mon, 08/09/2021 - 20:49

That's easy to fix, simply add this block:
procedure

Instead of at X, Y, and Z, add it as the X position of the entity, same for Y and Z. These can be found in the Entity Data section.

Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
OOOOOOMMMMMMMGGGGGGGGGGGG…
Mon, 08/09/2021 - 20:56

OOOOOOMMMMMMMGGGGGGGGGGGG THANK YOU SOOOOO MUCH I'VE BEEN STRESSING OVER THIS FOR THREE DAYS NOW!!! Because of you my mod is complete. Ty.

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Haha, glad to be able to…
Mon, 08/09/2021 - 21:03

Haha, glad to be able to help! If you need any more help, feel free to add me at my Discord: AidenR0#8651
I'd be more than happy to help