Jump to content

[1.12][Solved] Block GUI is not modifying the block state


Recommended Posts

Posted (edited)

Hi!

I made a redstone clock. It emits redstone signal by a period of time, and then go off, then on and so on.

I want the clocking period to be changable in game, so I tried to make a GUI. In the GUI, is a button '+' and a button '-', they change the max number the block has to wait until changing its state.

But, for some reason, the game is not updating to this, the frecuency is the same.

What am I doing wrong?

 

Code:

  Reveal hidden contents

 

 

  Reveal hidden contents

 

The github repo is here.

Thanks for your time.

Edited by AngheloAlf
Posted (edited)

Well, GUI button presses only occur on the client while the clock's logic occurs on the server. The server has no idea that the data was changed. You need to use packets to notify the server.

Edited by V0idWa1k3r
  • Like 1
Posted

Hi

 

I added an IMessage to notify the server:

 

  Reveal hidden contents

 

My new problem is, how do I access the corresponding tile entity from the IMessageHandler::onMessage method?

 

Thanks a lot.

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.