You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OliviaTheVampire edited this page Jun 29, 2019
·
3 revisions
RegistryUtils can be used to make registering blocks a lot simpler becaus you don't need to stress with all of the things related to registering a block or an item or a block entity.
Examples
publicclassRegisteringExamples {
publicstaticvoidinit() {
// Would create a basic block with the modid and name you defined and it would be placed into the build blocks creative tabRegistryUtils.register(newBlock(Block.Settings.of(Material.STONE)), newIdentifier("modid", "test_block"), ItemGroup.BUILDING_BLOCKS);
// Would create a basic block with the modid and name you defined but with no item, can only be used through /setblockRegistryUtils.registerBlockWithoutItem(newBlock(Block.Settings.of(Material.STONE)), newIdentifier("modid", "test_block"));
// Would create a basic item with the modid and name you defined and would place it in the misc creative tab, can add more things onto the item settingsRegistryUtils.registerItem(newItem(newItem.Settings().group(ItemGroup.MISC)), newIdentifier("modid", "test_item"));
}
}