Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Guys i just updated one of my Mob AI's from 1.6.4 but in 1.6.4 the lightning that my mob spawn renders ( as in it shows the lightning bolt)

in 1.7.2 it doesnt show anything i mean it just shows the fire on the targeted entity.

 

Here's my updateTasks on my one of Entity AI's

 

public void updateTask(){
	if(e.getAnimTick() == 30){
		List list = e.worldObj.getEntitiesWithinAABBExcludingEntity(e, e.boundingBox.expand(12.0D, 8.0D, 12.0D));
		for (int i = 0; i < list.size(); i++) {
		Entity entity = (Entity)list.get(i);
		if (e.getDistanceSqToEntity(entity) <= 100.0D) {
		double x = entity.posX - e.posX;
		double z = entity.posZ - e.posZ;
		double d = Math.sqrt(x * x + z * z);
		EntityLightningBolt l = new EntityLightningBolt(e.worldObj, entity.posX - 0.2D, entity.posY, entity.posZ - 0.2D);
		e.worldObj.addWeatherEffect(l);
		entity.motionX = (x / d * 0.699999988079071D);
		entity.motionY = 0.300000011920929D;
		entity.motionZ = (z / d * 0.699999988079071D);
		if ((entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer))) entity.attackEntityFrom(DamageSource.generic, 85 + this.rand.nextInt(2)); 
		}if((entity instanceof EntityPlayer)){
			entity.attackEntityFrom(DamageSource.generic, 35 + this.rand.nextInt(2));
    }
   }


  • Author

Bump:

Got a progress on a while and create my own throwable but still it own render the lightning bolt when it spawn

any help pleaes/

 

package mhfc.net.client.projectile;

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public class MHFCLightning extends EntityThrowable
{
public EntityLiving el;
public long field_92057_e;
private int fire;

    public MHFCLightning(World world)
    {
        super(world);
    }

    public MHFCLightning(World world, EntityLiving entityliving)
    {
        super(world, entityliving);
    }

    public MHFCLightning(World world, double d, double d1, double d2)
    {
        super(world, d, d1, d2);
    }

    /**
     * Called when the throwable hits a block or entity.
     */
    protected void onImpact(MovingObjectPosition movingobjectposition)
    {
    	worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    	
        if (movingobjectposition.entityHit != null)
        {
            if (!movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 0));
        }

        if (!worldObj.isRemote)
        {
        	EntityLightningBolt entitylightningbolt = new EntityLightningBolt(worldObj, posX, posY, posZ);
            entitylightningbolt.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0.0F);
            worldObj.addWeatherEffect(entitylightningbolt);
        }

        for (int i = 0; i < 8; i++)
        {
            worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
        }

        if (!worldObj.isRemote)
        {
            setDead();
        }
    }
    
    
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.