Jump to content

Recommended Posts

Posted

I am under the impression that I can change the qualities of the airBlock. The problem is that I cannot find where the airblock is defined so that I can look into it. It is not in the Block class but you can find the isAirBlock Method in many different places.

 

At first I tried to make the block null and replace it with a custom block of my own. This doesn't even let you load into minecraft.

 

My goal is to make is fo that under certain conditions you will get a poison effect from just "breathing" the air.

 

If you have some helpfull suggestions I would be glad to hear them.

 

Thanks.

Posted

Well, this would depend greatly on what you want to trigger the poison effect. You could use player ticks, Forge Events, and custom potion effects that check if the player is in air. Could you give some more insight on how you want to activate the effect?:)

Posted

The end goal is

 

if(player is above lvl 30 && player is on surface)

{

    ((EntityPlayer)Entity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 20, 2));

}

 

This could be activated if the player is walking I guess, that would probably be the easiest, but I want to make it that the player gets the effect even if they are standing still.

I know how to attatch an effect to a block that the player walks on but I thought that is would be easier this way if its possible.

 

Posted

Well, I don't know much about tick handlers but it seems that you could either use a player tick handler or the EntityLiving event. You can check the Tutorials tab on the forum's main page for a link to getting started with events. Other than that, you seem like you know how to add a potioneffect, so you should be fine.

Posted

Yes I know how to add the potion effect, the problem that I am running into is finding where I can alter the aspects of the air block.

 

Example: I can make my own block by extending block then replace a vanilla block with my own thus giving sand, for example, the ability to drop something other than it's self.

 

Where can I replace the air block. It is not listed in Block.blocklist[]. If someone could help me find it, and find what I need to extend to make my class work, then I think that I can take it from there.

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.