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?
This doesn't work, using no entity doesn't compile properly
It worked for me. Can you send a your procedure?
Here:
btw I'm on 1.20.1 if that helps
It is not possible for an enderman be the event/target entity, as far as I know. You have to check all entities around the player on helmet tick. Then, if they are in an enderman , you have to set their target entity to no entity.
PS.: On helmet tick means the target entity is the player wearing the helmet or, if it is possible for the helmet to be worn by another entity, whatever entity is wearing the helmet.
Mind sharing your procedure? I'm not quite sure how I'm supposed to check for endermen in an area
Also no matter if I use Event/target entity, Source entity or Immediate source entity none of them compile properly
Nah, don't wanna start my computer now. There is a block for entities in cube of size [ ] or something like that. Use the search bar search for words like "entities", "each", "cube", ... Checking the type of an entity can be done with the "is [ ] subtype of [ ]" block. You can do it 😉