Jump to content

[1.10.2] Detect when it's raining on a vanilla block


Daeruin

Recommended Posts

I want to do something when a particular vanilla block (dirt) is getting rained on. Any clue how to detect when a vanilla block is getting rained on? I looked over all the events and didn't see anything that seemed useful.

Edited by Daeruin
Added version
Link to comment
Share on other sites

Depending on what version you're using, I'd use either a substitution alias or the newer method of simply overriding the block registry entries to replace the vanilla block with your own class. It should extend the vanilla block class, but then change the code in the random tick method to check the weather and do something accordingly.

Note: I haven't tried the method of overriding vanilla blocks yet, and I know it's fairly new to Forge for 1.12, so there may be bugs, but try it out first and see if it works.

Whatever Minecraft needs, it is most likely not yet another tool tier.

Link to comment
Share on other sites

I'm using 1.10.2. I updated the post title accordingly.

 

I have never heard of either of your suggestions. A quick Google search brings up only complaints about substitution aliases not working, and nothing relevant for overriding block registry entries. Can you point me to an explanation somewhere?

Link to comment
Share on other sites

Honestly, I've never had much luck with substitution aliases, either. According to sources, it was finally fixed in 1.10.2, but I have no experience with that. The 1.12 registry overriding is much easier, but of course that's not available for 1.10.2.

Hopefully someone else with more experience can help you figure out how to use substitution aliases (but the general idea is the same: it replaces all references of one block, such as the vanilla one, with your own class instead).

Whatever Minecraft needs, it is most likely not yet another tool tier.

Link to comment
Share on other sites

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.