Jump to content

[1.7.10] Read-Ony Inventory


jmylifecolor

Recommended Posts

MyCode:

@SubscribeEvent

public void onEntityRightClicked(EntityInteractEvent e)

{

if (e.target instanceof EntityPlayer)

{

EntityPlayer player = (EntityPlayer)e.target;

 

e.entityPlayer.addChatMessage(new ChatComponentText(player.getDisplayName() +"을 선택했습니다."));

InventoryPlayer inv = player.inventory;

e.entityPlayer.displayGUIChest(inv);

}

}

 

 

I Want to Read-Only InventoryPlayer..  How to?

Link to comment
Share on other sites

i do in but 1.8 may is not the same but

 

you have to make a custom Gui class

whith an custom container class  and a

custom slot class designed whith a boolean to enable or dissable the player interacction way the item can be seen in the gui but cannot be taken

 

soo is long work

so bether begins here

 

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-forge-1-6-4-1-8-custom-inventories-in-items-and

 

http://jabelarminecraft.blogspot.com.co/p/minecraft-modding-containers.html

Link to comment
Share on other sites

I am not sure what is this meant to do, but you can create regular container, but you must create your own slit that  overrides default slot. In the class you must define that it cannot accept any item.

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Link to comment
Share on other sites

I made a class for doing this. Simply create new class in your lib(?) package and copy this into it.

 

 

 

public class DisplaySlot extends Slot{

public DisplaySlot(IInventory inv, int id, int x, int y)
{
	super(inv, id, x, y);
}

@Override
public boolean isItemValid(ItemStack item)
    {
        return false;
    }

@Override
public boolean canTakeStack(EntityPlayer player)
    {
        return false;
    }

}

 

 

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

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.