How to make an item that heals on pickup?

Started by Jacko22 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make an item that heals on pickup?

For those of you familiar with Terraria, I plan to add something akin to the small hearts that occasionally drop from enemies in that game. (if you are not familiar, they simply heal you a certain amount when picked up and then disappear) I'm having issues with my procedure, as events seem to not work half the time. I've put the procedure below, what I'm trying to do is first heal the player for 5 HP, and then remove the item from their inventory. I understand that there could then be issues if the player has a full inventory, if you have a possible fix for that it would be really appreciated.

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For some reason the variable…
Mon, 06/01/2026 - 04:06

For some reason the variable isn't appearing in the editor. 

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No a local variable is one…
Mon, 06/01/2026 - 06:46

No a local variable is one made only within a single procedure. Top right, local variable, click add, make it a logic, call it whatever. It resets each time the procedure is called

It’s only use is to stop the entity flickering between players if there are more than one, alternatively you could have this run only on client side which might make it so the entity always looks at every player,  however every player thinks that it is looking at them, should work that way actually 

Add an if around everything, is world provided client side. Search client in the procedure search bar

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So both would be redundant?
Tue, 06/02/2026 - 04:28

So both would be redundant?

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No, just use the local…
Tue, 06/02/2026 - 05:55

No, just use the local variable, I don’t know how the client side I was talking about would work, you would need more effort because the entity isn’t on anyone’s specific client it’s just on server, anyway just use a local variable or don’t it only affects multiplayer

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just tried it out in game…
Tue, 06/02/2026 - 20:07

I just tried it out in game for the first time. Few issues. The mob is semi-transparent, wanders around, and both procedures don't seem to work.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Turn off ai. Shouldn’t be…
Tue, 06/02/2026 - 20:51

Turn off ai. Shouldn’t be semi transparent? In what way is it?

Show me your procedures

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also when importing the…
Tue, 06/02/2026 - 20:52

Also when importing the model, override the animation with head movement animation

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedures: 
Wed, 06/03/2026 - 03:50

Procedures: 

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In-game:
Wed, 06/03/2026 - 03:52

In-game:

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Switch the true and false of…
Wed, 06/03/2026 - 18:22

Switch the true and false of the local variable in your second procedure, it is by default false so will never go through how you have it now

No idea why it is transparent like that, seems like a model issue

Maybe try just a cube, with a single side textured, then move the cube so the textured face sits in the centre of the workspace that way it rotates correctly

Also I would make the visual scale and bounding box scale to 0.5 as it's quite large but up to personal preference

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change the variable as in…
Thu, 06/04/2026 - 05:14

Change the variable as in swapping the true and false values in the procedure?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think the issue with the…
Thu, 06/04/2026 - 05:20

I think the issue with the healing procedure is that [Event/Target Entity] is calling on the heart entity and not the player that I want to be healed.

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Not sure how to fix it, just…
Thu, 06/04/2026 - 05:22

Not sure how to fix it, just thought I'd share my hypothesis.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes switch the true and…
Thu, 06/04/2026 - 08:04

Yes switch the true and false, yes you are right the entity targeting is so, source entity is the player as the trigger is player collides with entity