Started by
TheSwitzVirgin
on
Topic category: Help with Minecraft modding (Java Edition)
So I want to swap a mob to another when offered gold ingot and this is the event I have until now:
But instead of despawning the mob, it despawn the Player.
Edited by TheSwitzVirgin on Sun, 03/29/2020 - 06:55
Perhaps you could use the "Entity (sub)type of" block to only check for your entity and despawn that? I'm guessing it's targeting the player because the GUI test you have at the top checks the player, so in that instance, the provided entity is the player.
And how do I do that? I already tried with "if current entity is (the custom mob) = true" and it doesn't despawn.
Well then maybe you could use a custom code snippet. Try using one in place of "despawn provided entity" and type entity.remove(); into it (with the semicolon)
how do you add the entity.remove(); where is the custom code snippet
It's located in the "Advanced" tab when making a procedure. It's purple and has a text box as its only input
The procedure "despawn provided entity" already add that code like ilustrated on the image:
https://imgur.com/QOAAgS2
And it despawns the player.
I see. Could you paste the full code? Does it mention any other entities than the one on that line?
Sure, this is the full code so far:
I'm not sure if it mentions another entity or not.
It doesn't. I think the only way to make this work is to put this code into the entity directly instead of using a procedure. I'm not sure how comfortable you are with coding, but if you can find in you custom entity where this procedure is triggered, you could basically copy-paste this code with a few tweaks. If you do that, then you'd be able to differentiate the player from the entity.