Started by
Cyke
on
Topic category: Help with Minecraft modding (Java Edition)
Hi, I'm making a mod and I'm trying to make a helmet that basically replicates the behavior of a pumpkin. I already coded the overlay and all, but I can't figure out how to make it so when looking at an Enderman, it doesn't attack you. I'm also having issues with making the overlay disappear when the player is not in 1st person. Thanks!
I'm not sure how you would go about doing this in an optimized way without actually changing the vanilla Enderman's code.
You could try setting up a procedure that adds every nearby enderman to the same team as the player whenever the player is wearing a pumpkin and then remove every enderman from their team when the pumpkin is taken off. You'd also have to make it so that if the player hits an enderman, that enderman is removed from the player's team as well... This however would run poorly and also might have some issues. I'm unsure if the endermen would attack whatever entity the player hits if the endermen are on the player's team or not
Similar problem- not sure if there's a good way to do this. Probably some way custom code could be used to disable aggravation; I've seen it done with other mods.
I have a solution for this. Use the helmet tick and put in:
if [enderman near you targets you]
set attack target of [enderman near you] to [no entity]
Different question tho: Do any of you have an idea to make a complete jack o lantern? A block that can behave as a helmet?