Jump to content

How to add more features to blocks in other mods?


jordsta95

Recommended Posts

The potion will be a custom potion I add, yes.

 

And I already have the code:

  List<EntityPlayer> list = SpellHelper.getPlayersInRange(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 15, 15);
//                for (EntityPlayer player : list)
//                {
//                    PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
//                    if (regenEffect != null && regenEffect.getAmplifier() > 0)
//                    {
//                    	if(AlchemicalWizardry.causeHungerChatMessage && !player.isPotionActive(Potion.hunger.id))
//                    	{
//                        	player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger")));
//                    	}
//                        player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier() * 2 - 2));
//                    }
//                }

(Ignore that it is commented out)

That is what (used to be) there, and I want to replicate what I am doing, but instead of causing hunger it will fill the altar, slowly.

 

I already know how I will do this bit though. I just need to know how to "inject" my bit of code into the class file for the Blood Altar (which is a tile entity).

 

i.e. Blood Altar's tile entity file, which is where this code goes, will load with my bit of code added in.

Why bother?

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.



×
×
  • Create New...

Important Information

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