Jump to content

[1.7] How to get ActiveWaterBlock to spawn instead of Water Block


iluvpie777

Recommended Posts

Hi so I'm trying to make it so that when a mob gets hit by my projectile a puddle of water will spawn at it's feet however I'm not quite sure how to get the active water to spawn so that it goes away after a little bit.

 

My code:

@Override

protected void onImpact(MovingObjectPosition movingobjectposition)

{

if (movingobjectposition.entityHit != null)

{

float getDmg = 2;

movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), getDmg);

int rand = random.nextInt(5);

if (rand == 4)

{

int x = MathHelper.floor_double(this.posX);

int y = MathHelper.floor_double(movingobjectposition.entityHit.posY);

int z = MathHelper.floor_double(this.posZ);

 

this.worldObj.setBlock(x, y, z, Blocks.water);

}

}

for (int l = 0; l <7; ++l)

{

this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);

}

if (!this.worldObj.isRemote)

{

this.setDead();

}

}

 

 

as you see right now its block.water how do i get the active water?

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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