Jump to content

Recommended Posts

Posted

Again having Problems, now try my first Block that can do something!

i have a Block, TileEntity

in the TileEntity want to store something like Water so i make a Variable waterLevel

ItemStack var10 = par5EntityPlayer.inventory.getCurrentItem();
        	
            
            if (var10.itemID == Item.bucketWater.shiftedIndex)
            {
                par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
            	  if(waterLevel < 10)
            	  {
            		  waterLevel = 10;	
            	  }
            }

 

The variable waterLevel change the texture of the Block, this work so variable change like i want.

But the Item not change to BucketEmpty!

and when leave the game and come back the watellevel is again 0;

i use NBT tags to store the waterLevel, and i know that i need PacketHandler, but what sending from server to client and from client to server. have look in the Tutorials but not help me alot.

Please can someone me explain it!

special how update item in the Hand

Thanks

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.