Started by
Jacko22
on
Topic category: Help with Minecraft modding (Java Edition)
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.

For some reason the variable isn't appearing in the editor.
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
So both would be redundant?
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
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.
Turn off ai. Shouldn’t be semi transparent? In what way is it?
Show me your procedures
Also when importing the model, override the animation with head movement animation
Procedures:
In-game:
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
Change the variable as in swapping the true and false values in the procedure?
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.
Not sure how to fix it, just thought I'd share my hypothesis.
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