Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Giving a mob a GUI?

mob gui mob gui help

  • Please log in to reply
5 replies to this topic

#1

CraftMuch

Posted 15 November 2012 - 06:18 PM

I am trying to give a the furnace GUI to a mob, but am finding it really hard. I have looked inside of the villager code to try and figure out what I can do, but I just can't seem to find a method that will work!
Thanks in advance.
public static... :D

Register or log in to remove.

#2

CraftMuch

Posted 15 November 2012 - 09:23 PM

Is there anything that can be done?
public static... :D

#3

CertainlyNot

Posted 16 November 2012 - 04:36 AM

From my very quick look into the source code, it looks like you are going to want to override the interact() method for your Entity.  It is the method called when you right click a mob.  I would suggest looking at the interact() method from EntityCow for further advice...
-- CN --
What'd you expect from Notch? Jesus walking on water?

#4

CraftMuch

Posted 16 November 2012 - 08:46 PM

View PostCertainlyNot, on 16 November 2012 - 04:36 AM, said:

From my very quick look into the source code, it looks like you are going to want to override the interact() method for your Entity.  It is the method called when you right click a mob.  I would suggest looking at the interact() method from EntityCow for further advice...
Here's my code Im having some errors:
public boolean interact(EntityPlayer par1EntityPlayer)
{
{
			par1EntityPlayer.displayGUIFurnace(this);
	}
		return true;
}
private static boolean keepInventory = false;
Error is "The method displayGUIFurnace(TileEntityFurnace) in the type EntityPlayer is not applicable for the arguments (EntityBMO)"
Is there something I can do?
public static... :D

#5

Anglican
  • Location: Idling at the DecoMod thread.
  • Minecraft: Anglican

Posted 17 November 2012 - 12:13 AM

View PostCraftMuch, on 16 November 2012 - 08:46 PM, said:

Here's my code Im having some errors:
public boolean interact(EntityPlayer par1EntityPlayer)
{
{
		 par1EntityPlayer.displayGUIFurnace(this);
}
	 return true;
}
private static boolean keepInventory = false;
Error is "The method displayGUIFurnace(TileEntityFurnace) in the type EntityPlayer is not applicable for the arguments (EntityBMO)"
Is there something I can do?
Ah. First off, the   par1EntityPlayer.displayGUIFurnace(this) should be   par1EntityPlayer.displayGUIFurnace(par1EntityPlayer). It's attempting to run the method displayGUIFurnace(EntityBMO). Tell me if this works.
Posted Image

#6

CraftMuch

Posted 17 November 2012 - 11:22 AM

View PostAnglican, on 17 November 2012 - 12:13 AM, said:

Ah. First off, the   par1EntityPlayer.displayGUIFurnace(this) should be   par1EntityPlayer.displayGUIFurnace(par1EntityPlayer). It's attempting to run the method displayGUIFurnace(EntityBMO). Tell me if this works.

public boolean interact(EntityPlayer par1EntityPlayer)
{
{
par1EntityPlayer.displayGUIFurnace(par1EntityPlayer);
}
		 return true;
}
private static boolean keepInventory = false;
}
New Error
The method displayGUIFurnace(TileEntityFurnace) in the type EntityPlayer is not applicable for the arguments (EntityPlayer)
public static... :D