Posted March 1, 201411 yr 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? http://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.
March 1, 201411 yr 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/
March 1, 201411 yr Author Thank you. Makes it easier to figure this out. http://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.
March 1, 201411 yr Hi A bit of background info on Blocks here http://greyminecraftcoder.blogspot.com.au/2013/07/blocks.html and here http://greyminecraftcoder.blogspot.com.au/2013/10/the-most-important-minecraft-classes_9.html if you have 16 types or less, use metadata. Vanilla wood uses this, for example. oak, birch, etc -TGG
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.