Jump to content

Gettings an exact block object at a coord or setting a custom variable for it


Recommended Posts

Posted

I have the problem of wanting to make "efficient" code.  I want to set a custom variable on a new plant block.  This variable would allow the custom plant to know what it will produce when it is fully grown and broken.  The problem is there seems to be no way to set this on the block because there is no way to get the block object itself.  Anyone know a way of setting this variable without getting the exact block from the world, with the world, or if I should just code individual crop blocks?

width=320 height=64http://www.slothygaming.com/img/ota.png[/img]

If your grammar is shit and you blatantly don't know what you're doing, I will not help you.

Posted

A block is a static Object, so if you set a variable to one in the world, they all get the same variable. So if you want to make a variable that's unique to each block, you need to make it a TileEntity, or you can make all seperate blocks.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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.