Posted 14 April 2016 - 02:43 AM
So I've been fooling around with the terminal glasses, specifically the addIcon method. The method itself requires an x position and a y position where the icon will be placed on the screen, a string of the item id to be placed on the screen, and an optional metadata {addIcon(x, y, id, metadata)}.
So, I know the id parameter requires a string, but I've seen some older code around that would call addIcon with a number id instead of a string (ie. 1 instead of "minecraft:stone"). I'm assuming this was just before minecraft changed its naming system, yet I can still call addIcon with a number id, kinda.
If I do some code like this:
the code won't throw an error. But it also won't show any icons on the screen. It will, however, still create the object, because I can still change it and create a visible icon:
So my question is this: why is the icon object still created with the number id? Also, is there a way I can use the method with a number id, considering that even the vanilla /give command can use both item id strings and item id numbers? And finally, is there an easy way to see the different item id strings in game (through nei or something else)? Because, although it's easy enough to remember the vanilla items, I don't really have much hope knowing mod item string ids.
Thanks,
Whitecatblack
So, I know the id parameter requires a string, but I've seen some older code around that would call addIcon with a number id instead of a string (ie. 1 instead of "minecraft:stone"). I'm assuming this was just before minecraft changed its naming system, yet I can still call addIcon with a number id, kinda.
If I do some code like this:
glass = peripheral.wrap("right") --to a terminal bridge
icon = glass.addIcon(15, 15, 1)
glass.sync()
the code won't throw an error. But it also won't show any icons on the screen. It will, however, still create the object, because I can still change it and create a visible icon:
icon.setItemId("minecraft:diamond")
glass.sync()
This changes the icon to a diamond and it will now show up on my screen in the expected place.So my question is this: why is the icon object still created with the number id? Also, is there a way I can use the method with a number id, considering that even the vanilla /give command can use both item id strings and item id numbers? And finally, is there an easy way to see the different item id strings in game (through nei or something else)? Because, although it's easy enough to remember the vanilla items, I don't really have much hope knowing mod item string ids.
Thanks,
Whitecatblack