Posted December 31, 20204 yr in items class we have... public static final Item TORCH = register(new WallOrFloorItem(Blocks.TORCH, Blocks.WALL_TORCH, (new Item.Properties()).group(ItemGroup.DECORATIONS))); and in blocks we have... public static final Block SOUL_TORCH = register("soul_torch", new TorchBlock(AbstractBlock.Properties.create(Material.MISCELLANEOUS).doesNotBlockMovement().zeroHardnessAndResistance().setLightLevel((state) -> { return 10; }).sound(SoundType.WOOD), ParticleTypes.SOUL_FIRE_FLAME)); public static final Block SOUL_WALL_TORCH = register("soul_wall_torch", new WallTorchBlock(AbstractBlock.Properties.create(Material.MISCELLANEOUS).doesNotBlockMovement().zeroHardnessAndResistance().setLightLevel((state) -> { return 10; }).sound(SoundType.WOOD).lootFrom(SOUL_TORCH), ParticleTypes.SOUL_FIRE_FLAME)); So is there any way to get the (Block wallBlockIn) value that is set by WallOrFloorItem through the item or the registry? It makes sense that if the two are intertwined as they are there should be some way of doing this. Or should I just start the gymnastic to loop over and pull out using the register names [basically using soul from "soul_torch" to look for "soul_"+wall+"_torch"] to get the correct block. Of course I could also skip using tags to get my item list and instead make it a config in pairs to get the data in a more reliable and configurable by mod pack developers. Edited December 31, 20204 yr by frakier
December 31, 20204 yr Author though of an idea... in my tags json I can do ""minecraft:redstone_wall_torch" and then use Item.getItemFromBlock(blockIn) to get the Item instead of the other way around. I'll give it a try and report back. Edited December 31, 20204 yr by frakier
December 31, 20204 yr Author Solved, that was the answer I made the tags json using the "wall_torch" version of each torch and then use that to get the other information i needed. { "replace": false, "values": [ "minecraft:wall_torch", "minecraft:redstone_wall_torch", "minecraft:soul_wall_torch" ] } Then I was able to get the item using the wall_torch blocks and then from the item I could get the normal torch blocks. Kind of backwards way around but it worked. Edited December 31, 20204 yr by frakier
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.