Jump to content

[1.7.10] How to see what sort of block I placed?


Viperdream

Recommended Posts

Hi

 

I've just started modding with Forge. I have experience with Bukkit, but this seems a lot different to me.

 

I'm trying to find out how to see which block I just placed with the event 'BlockEvent.PlaceEvent'.

I want this so I can check which block I placed so I have to log it or not. Furnaces in this case.

 

I've been searching everywhere, but I can't find a clear answer.

Can I get an ID from the block event? Or can I find it out with the metadata from the block? But I'm a bit confused with the metadata, because if I do e.blockMetaData it just returns an Integer. And I have no reference to what this means.

 

A bit of a follow up question for this. Can I get the tile entity from this block? I want to check later on whether the furnace is burning (with isBurning()).

 

Sorry if this has been asked before, but I couldn't find any answers.

If anyone could help me out, that'd be great. Thanks!

Link to comment
Share on other sites

You have the ability to update them yourself which is always a pleasure. Also there is a BlockState field in the event which contains a Block field.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Does that work on 1.7.10? Because I can't find that method.

 

I did find out how to get an ID though, but it also returns an array after the ID (61[15:56:56]), these aren't coördinates I checked it.

Anyone knows what that means?

EDIT: I'm an idiot, it's the time

 

Edited by Viperdream
Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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