Package net.minecraft.entity.effect

Examples of net.minecraft.entity.effect.EntityLightningBolt


    {
        if (args.length >= 1)
        {
            if (args[0].toLowerCase().equals("me"))
            {
                sender.worldObj.addWeatherEffect(new EntityLightningBolt(sender.worldObj, sender.posX, sender.posY, sender.posZ));
                OutputHandler.chatConfirmation(sender, "Was that really a good idea?");
            }
            else
            {
                EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
                if (player != null)
                {
                    player.worldObj.addWeatherEffect(new EntityLightningBolt(player.worldObj, player.posX, player.posY, player.posZ));
                    OutputHandler.chatConfirmation(sender, "You should feel bad about doing that.");
                }
                else
                {
                    OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
                }
            }
        }
        else
        {
            MovingObjectPosition mop = FunctionHelper.getPlayerLookingSpot(sender, 500);
            if (mop == null)
            {
                OutputHandler.chatError(sender, "You must first look at the ground!");
            }
            else
            {
                sender.worldObj.addWeatherEffect(new EntityLightningBolt(sender.worldObj, mop.blockX, mop.blockY, mop.blockZ));
                OutputHandler.chatConfirmation(sender, "I hope that didn't start a fire.");
            }
        }
    }
View Full Code Here


        if (args.length >= 1)
        {
            EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
            if (player != null)
            {
                player.worldObj.addWeatherEffect(new EntityLightningBolt(player.worldObj, player.posX, player.posY, player.posZ));
                OutputHandler.chatConfirmation(sender, "You should feel bad about doing that.");
            }
            else
            {
                OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
View Full Code Here

    }

    @Override
    public void execute(WorldBorder wb, EntityPlayerMP player)
    {
        player.worldObj.addWeatherEffect(new EntityLightningBolt(player.worldObj, player.posX, player.posY, player.posZ));
    }
View Full Code Here

        var9 = xPos + (var8 & 15);
        var10 = zPos + (var8 >> 8 & 15);
        var11 = this.getPrecipitationHeight(var9, var10);

        if (this.canLightningStrikeAt(var9, var11, var10)) {
          this.addWeatherEffect(new EntityLightningBolt(this, (double) var9, (double) var11, (double) var10));
        }
      }

      int blockID;
View Full Code Here

        if(!world.isRemote) {
            int j = MathHelper.floor_double(x) + rand.nextInt(20) - 10;
            int k = MathHelper.floor_double(z) + rand.nextInt(20) - 10;
            int l = world.getPrecipitationHeight(j, k);
            if(world.canLightningStrikeAt(j, l, k)) {
                EntityLightningBolt lightning = new EntityLightningBolt(world, j, l, k);
                world.addWeatherEffect(lightning);
                world.setBlockMetadataWithNotify(x, y, z, 11, 3);
            }
        }
    }
View Full Code Here

TOP

Related Classes of net.minecraft.entity.effect.EntityLightningBolt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.