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

I tried make tile entity render but nothing work,

//doClientStuff(final FMLClientSetupEvent event)
ClientRegistry.bindTileEntityRenderer(TileEntityType.Builder.create(TankTileEntity::new,
                ModBlocks.TANK
        ).build(null), TankTileEntityRender::new);
//ModTileEntities
public static final DeferredRegister<TileEntityType<?>> ENTITY_TYPES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES, Reference.MOD_ID);
public static RegistryObject<TileEntityType<?>> TANK_TE = ENTITY_TYPES.register("tank_te", () ->
            TileEntityType.Builder.create(TankTileEntity::new,ModBlocks.TANK).build(null)
    );

 

public class TankTileEntityRender extends TileEntityRenderer<TankTileEntity>
{
    public TankTileEntityRender(TileEntityRendererDispatcher p_i226006_1_)
    {
        super(p_i226006_1_);
    }

    @Override
    public void render(TankTileEntity tankTileEntity, float v, MatrixStack matrixStack, IRenderTypeBuffer iRenderTypeBuffer, int i, int i1)
    {
        matrixStack.push();
        matrixStack.translate(tankTileEntity.getPos().getX(),tankTileEntity.getPos().getY(),tankTileEntity.getPos().getZ());
        matrixStack.rotate(new Quaternion(0,0,0,0));
        matrixStack.translate(0.5,0.1,0);
        Minecraft.getInstance().getItemRenderer().renderItem(new ItemStack(Items.REDSTONE_TORCH), ItemCameraTransforms.TransformType.GROUND,i,i1,matrixStack,iRenderTypeBuffer);
        matrixStack.pop();
    }
}
public class TankTileEntity extends TileEntity
{
    public TankTileEntity()
    {
        super(ModTileEntities.TANK_TE.get());
    }
}
public class TankBlock extends Block
{
    public VoxelShape SHAPE = Block.makeCuboidShape(1,0,1,15,16,15);

    public TankBlock(Properties properties)
    {
        super(properties);
    }

    @Override
    public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
    {
        return SHAPE;
    }

    @Override
    public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
    {
        return SHAPE;
    }
}

 

  • Author

Ok I fixed,

I'm creating new tile entity instead of using existing TE.

ClientRegistry.bindTileEntityRenderer(ModTileEntities.INFUSER_TE.get(), InfuserTileEntityRender::new);

 

  • DcZipPL changed the title to [SOLVED][1.15.2] Tile Entity Render doesn't work

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.