Created
March 14, 2018 18:45
-
-
Save kindlich/63d2faa387fdf0610252da1c2dfff5e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #loader contenttweaker | |
| import mods.contenttweaker.VanillaFactory; | |
| import mods.contenttweaker.PartType; | |
| import mods.contenttweaker.MaterialSystem; | |
| import mods.contenttweaker.Commands; | |
| var egg = VanillaFactory.createItem("charmander_spawn_egg"); | |
| egg.maxStackSize = 64; | |
| egg.itemRightClick = function(stack, world, player, hand) { | |
| if (stack.tag has "entity") { | |
| logger.logWarning("pokespawn " ~ stack.tag.entity.asString()); | |
| Commands.call("pokespawn " ~ stack.tag.entity.asString(), player, world); | |
| } | |
| stack.shrink(1); | |
| return "Success"; | |
| }; | |
| egg.localizedNameSupplier = function(itemStack) { | |
| return (itemStack.tag has "entity" ? itemStack.tag.entity.asString() : "Empty") + " spawn egg"; | |
| }; | |
| egg.itemColorSupplier = function(itemStack, tint) { | |
| return mods.contenttweaker.Color.fromHex((itemStack.tag has "color") ? itemStack.tag.color.asString() : "000000"); | |
| }; | |
| egg.register(); |
This file contains hidden or 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
| val map as string[string] = { | |
| //Poke name : Hexcolor | |
| Charmander : "ffffff", | |
| Salamander : "abcdef", | |
| Something : "000a49" | |
| }; | |
| val egg = <contenttweaker:charmander_spawn_egg>; | |
| for name, colorString in map { | |
| mods.jei.JEI.addItem(egg.withTag({entity: name, color : colorString})); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment