How do you make a mob throw entities

Started by Starslayer on Tue, 06/20/2017 - 00:35

Topic category: Advanced modding

Last seen on 01:52, 22. Jun 2017
Joined Jun 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How do you make a mob throw entities
Tue, 06/20/2017 - 04:00 (edited)

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
Last seen on 16:15, 6. May 2020
Joined Oct 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Try to find the Snow Golem
Tue, 06/20/2017 - 10:05

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.

Last seen on 16:15, 6. May 2020
Joined Oct 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I've found this:
Tue, 06/20/2017 - 10:10

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]

Last seen on 01:52, 22. Jun 2017
Joined Jun 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I tried this, and it didn't
Tue, 06/20/2017 - 15:43

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).

Last seen on 01:52, 22. Jun 2017
Joined Jun 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I tried copy and pasting the
Tue, 06/20/2017 - 15:53

I tried copy and pasting the entire Snow Golem Code to recreate it, seems like MCreator might just simply be incompatible with it.

Last seen on 16:15, 6. May 2020
Joined Oct 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Yes, the Snow Golem's code
Wed, 06/21/2017 - 10:36

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'