Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

 

According to the website: https://forge.gemwire.uk/wiki/BlockEntityWithoutLevelRenderer. I should create a BEWLRInstance. However, I do exactly as described on the website except for the BakedModel#isCustomRenderer(I want to edit the model created by json, but without creating a model from ZERO like TridentModel). Could anyone help me with this?

Minecraft completely ignores edits made in the Item Custom Renderer. That is, it does not increase the item's scale by 3x for example. he doesn't do anything!

Item Registering:

Spoiler
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ModCraft.MOD_ID);

    public static RegistryObject<Item> CUSTOM_RENDER_ITEM;

    static {
        CUSTOM_RENDER_ITEM = ITEMS.register("custom_render_item", () -> new CustomRenderItem(Tiers.IRON,5,5F,new Item.Properties().tab(MOD_TAB_ICON)));
    }

    public static void register(IEventBus eventBus) {
        ITEMS.register(eventBus);
    }

 

Custom Item Class:

Spoiler
public class CustomRenderItem extends SwordItem {

    public CustomRenderItem(Tier tier, int i, float v, Properties properties) {
        super(tier, i, v, properties);
    }

    @Override
    public boolean canPerformAction(ItemStack stack, ToolAction toolAction) {
        return true;
    }

    @Override
    public void initializeClient(Consumer<IClientItemExtensions> consumer) {
        consumer.accept(new IClientItemExtensions() {
            @Override
            public BlockEntityWithoutLevelRenderer getCustomRenderer() {
                //return IClientItemExtensions.super.getCustomRenderer();
                return new CustomItemRenderer();
            }

            @Override
            public @Nullable Font getFont(ItemStack stack, FontContext context) {
                return IClientItemExtensions.super.getFont(stack, context);
            }

        });
    }

}

 

Custom item Renderer:

Spoiler
public class CustomItemRenderer extends BlockEntityWithoutLevelRenderer {

    public CustomItemRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher, EntityModelSet modelSet) {
        super(blockEntityRenderDispatcher, modelSet);
    }

    public CustomItemRenderer() {
        super(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels());
        //super(null, null);
    }

    @Override
    public void renderByItem(ItemStack itemStack, ItemTransforms.TransformType type, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int i1) {
        if(itemStack.getItem() == ModItem.CUSTOM_RENDER_ITEM.get()) {
            poseStack.pushPose();

            poseStack.scale(3, 3, 3);

            poseStack.popPose();
        }
        super.renderByItem(itemStack, type, poseStack, multiBufferSource, i, i1);
    }

}

 

 

  • 1 month later...

Have you figured out how to do that yet? Also, do you know how to make an Item return true for BakedModel#isCustomRenderer?

Edited by AppleBeanie

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.