Started by
Scootied
on
Topic category: Help with Minecraft modding (Java Edition)
Says it all in the title. No matter what I do, the same 2 hearts of damage stays the same for me. It seems to have to real fix and is extremely aggravating. There seems to be no work around for this and it makes the mod unplayable at times. Please, if there is anyway to make these projectiles not affect players. Please tell me.
I assume you are talking about arrows? Here is something I came up with on the spot. KEEP IN MIND IN THIS SNIPPET OF CODE YOU CAN ADD CHECKS FOR ARMOR AND/OR OTHER PROJECTILE ENTITIES!
Thank you for helping but if I may ask, how to I plug this into my procedures with the custom code snippet? They never seem to work no matter what I do with them.
see tbroski well done.
To plug it in, Shocking Artist correct me if I am wrong, but since you are subscribing to an event I believe you can just put that in your entity class. But you are probably better off creating a forge event subscriber for your mod, so I believe you can create a custom element that does that? I would ask Shocking Artist because I haven't used MCreator in a while.
LivingDamageEvent is a forge event so you are going to want to register the class with the forge event bus,
put that on top, and change Main.MODID to your mod id.
You may have to register the class in the main class, but I believe MCreator actually does that. I would check anyway though and use this bit,
I am not sure how MCreator registers there event so what I would do in your situation.
Step 1: Create a Procedure and give it any event.
Step 2: Go into the code and switch the events around and add in the code snippet.
Step 3: That's all you have to do as long as MCreator registers procedures like a forge event subscriber
Sorry if that seems confusing but because I haven't been on MCreator for a while, it is hard for me to know the exact steps but you should be able to figure out with some tweaking.
Now for your error can you post some code and take an image of the procedure.
After adding those two lines and changing what MCreator told me to change, this is the last error:
I apologize, it didnt upload properly:
I apologize the image thing is stupid. Just go here https://imgur.com/a/uKdHpvq
mcreator will restore the code eyery time and errors will arise
lock the code
mcreator will restore the code eyery time and errors will arise
lock the code
why did i send it twice? sry
Ok from that error there are a lot of things that are wrong you need to share code ASAP! Your game is going to crash. You are setting the MODID to a variable that I believe isn't there. Your MODID needs to be a String. There is nothing I can do without code
But yes @Shocking Artist. Lock the code
Alright i examined the code i dont know how Mcreator's registration rules work.
I believe it should be something like this
when entity damaged give speed?
and yes there is a lot wrong.