Created
April 25, 2016 23:13
-
-
Save TehNut/a096ab00955d219e0a438fa06e6e17c5 to your computer and use it in GitHub Desktop.
Forge 1.9 Registry examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Block | |
Block myBlock = new Block(Materials.ROCK); | |
GameRegistry.register(myBlock.setRegistryName("myBlock")); | |
// Block with inventory Item | |
Block myBlock = new Block(Materials.ROCK); | |
GameRegistry.register(myBlock.setRegistryName("myBlock")); | |
GameRegistry.register(new ItemBlock(myBlock).setRegistryName(myBlock.getRegistryName()); | |
// Item | |
Item myItem = new Item(); | |
GameRegistry.register(myItem.setRegistryName("myItem")); | |
// Potion | |
Potion myPotion = new Potion(false, 0); | |
GameRegistry.register(myPotion.setRegistryName("myPotion")); | |
// Enchantment | |
Enchantment myEnchant = new Enchantment(Enchantment.Rarity.COMMON, EnumEnchantmentType.ALL, new EntityEquipmentSlot[]{EntityEquipmentSlot.MAINHAND}); | |
GameRegistry.register(myEnchant.setRegistryName("myEnchant")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment