• 0

    posted a message on [Solved] Block inventory item varient not registering

    fun registerRender(item: Item) {
        val name = item.registryName
        if (name != null) {
            logger.info("{Started} registerRender: $name")
            ModelLoader.setCustomModelResourceLocation(item, 0, ModelResourceLocation(name, "inventory"))
            logger.info("{Finished} registerRender: $name")
        } else {
            logger.warn("Item's `registryName` is null: ${item.unlocalizedName}")

    Hello Liyanin_Natara,

    Could you please provide your Log?

    Maybe it tells something about not finding a file ...

    Nice Greetings


    Posted in: Modification Development
  • 1

    posted a message on Any ideas how to detect player uuid which creating the item and add to NBT?

    Hello Johnson,

    I can think of two different places where you could detect the player who crafted the Item and set the owner tag.

    The place you wanna use depends, if you want to set the owner only for your own Items or for others as well.

    1. Override Item#onCreated

    2. Subscribe to PlayerEvent::ItemCraftedEvent

    Both give you access to the crafted ItemStack as well as the Player who performed the crafting operation.

    You can get the UUID from EntityPlayer#getUniqueID()

    FIY: Check out the official Forge Modder Support for faster response time

    Nice Greetings


    Posted in: Modification Development
  • To post a comment, please or register a new account.