Jump to content

Recommended Posts

Posted

So I'm trying to get the comparator input override of a block (if it has one) with something like:

@OnlyIn(Dist.CLIENT)
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Post event)
{
    //...
  
    if (blockstate.hasComparatorInputOverride())
    {
        int p = blockstate.getComparatorInputOverride(minecraft.world, tBlockPos);
    }
  
    //...
}

For blocks like bee nest and cauldron it worked, but for blocks with inventory it always returns 0 because when it tries to get the block inventory gets an air full inventory(not null) even when the chest is full.

Posted

I have tried without it but same result.

In what event should I get the value, dose RenderGameOverlayEvent occur in the server, because I want the value in this event, and how to send it to client?

 

 

Posted (edited)
4 minutes ago, diesieben07 said:

What blocks do you need to know this value for on the client?

Any block the player looking at.

Edited by Adham-084

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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