Jump to content

[1.7.2.]Player drowning onEntityUpdate


nekpek

Recommended Posts

Hello There. I run into a small issue which i cannot for the life of me figure out.

So here is my problem

 

I am making a "potion effect" which when active should make you loose air.

The problem however  is, when i decrease the air from the player with player.setAir(par1);

but it instantaneous replenish the air supply because the player is not in water.

i cannot figure out how to stop this.

i looked into how it "stops" it while under water and its code is private or protected in the entity class.

so i cannot change the  "player.inwater" to true from the eventhandler.

 

if you need any code i can post them.

the event does work (as i am using it for other potion effects) but i can still post it if relevant.

Naturalis - The easy way for nature.!

Esquire - A helping hand for your adventure.

Jimanju - The Random Disasters!

Link to comment
Share on other sites

I went for another round, i thought it through an chose to just damage the player with DamageSource.drown as the source.

 

Naturalis - The easy way for nature.!

Esquire - A helping hand for your adventure.

Jimanju - The Random Disasters!

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.