Started by
Starslayer
on
Topic category: Advanced modding
I'm trying to make a mob that throws primed tnt at the player, how do you do that? I've tried changing the code and switching it to EntityTNTPrimed (after importing it ofcourse), I do have some basic java knowledge, can somebody please help me!
Edited by Starslayer on Tue, 06/20/2017 - 04:00
Try to find the Snow Golem Code in the MCreator code and try to find out the part where the Snow Golem throw the snow balls... I don't know how you can edit the code to make it throw Primed TNT, but if you know some java things, maybe you can use that code.
I've found this:
[spoiler]
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor)
{
EntitySnowball entitysnowball = new EntitySnowball(this.world, this);
double d0 = target.posY + (double)target.getEyeHeight() - 1.100000023841858D;
double d1 = target.posX - this.posX;
double d2 = d0 - entitysnowball.posY;
double d3 = target.posZ - this.posZ;
float f = MathHelper.sqrt(d1 * d1 + d3 * d3) * 0.2F;
entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F);
this.playSound(SoundEvents.ENTITY_SNOWMAN_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
this.world.spawnEntity(entitysnowball);
[/spoiler]
I tried this, and it didn't work. I skimmed over the code and found there are other areas related to the arrow. I replaced the arrow things with snowballs, still doesnt work. I need more of the snow golem code to do it (but it is not in mcreator).
I tried copy and pasting the entire Snow Golem Code to recreate it, seems like MCreator might just simply be incompatible with it.
Yes, the Snow Golem's code its on MCreator, but you can't edit it. You just must follow this steps:
1. Open MCreator
2. Go to: 'CODE'
3. Go to 'Minecraft Source'
4. Go to 'Entity'
5. Then go to 'monster'
6. And finally to 'EntitySnowman.java'