Jump to content

Making a 2 wide block [Solved]


DarkDragon117

Recommended Posts

Hi, I am starting in the forge programming (I think I know enough java) and I would like to create a 2 wide block like a bed, but I want it to be a table, I've been searching in the forums and I saw this.setBlockBounds(and a serie of floats) but when i put it it gives me an error saying me "Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)". Can anyone help me please? 

 

EDIT: SOLVED

Edited by DarkDragon117
Solved
Link to comment
Share on other sites

30 minutes ago, DarkDragon117 said:

"Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)". Can anyone help me please? 

This leads me to believe you don’t know enough Java/have enough experience with an IDE. Either that or your using code from an ancient version. To change a blocks bounding box, you can override Block#getBoundingBox. However this box can be at maximum 1x1.5x1. Anything bigger than this needs multiple blocks. You can look at how the bed works (probably not the best example for your needs, but looking at vanilla code is always helpful), or at other mods that do similar things. 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

6 hours ago, Cadiboo said:

This leads me to believe you don’t know enough Java/have enough experience with an IDE. Either that or your using code from an ancient version. To change a blocks bounding box, you can override Block#getBoundingBox. However this box can be at maximum 1x1.5x1. Anything bigger than this needs multiple blocks. You can look at how the bed works (probably not the best example for your needs, but looking at vanilla code is always helpful), or at other mods that do similar things. 

I can't do it, it says me it's deprecated, I am using forge 1.12.2 MDK

Link to comment
Share on other sites

1. You might want to try looking at the vanilla bed and see how it handles it (manually sets and breaks adjacent bed block).

 

2.

16 hours ago, DarkDragon117 said:

I can't do it, it says me it's deprecated,

23 hours ago, DarkDragon117 said:

Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)

These indicate that you are not familiar with basic java. Please learn java before making a mod.

Edited by DavidM
Quoted the wrong part
  • Confused 1

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

4 minutes ago, DavidM said:

This indicates that you are not familiar with basic java. Please learn java before making a mod.

Why? When it's deprecated it means that it remains in the api but it may be removed in future releases, am I wrong? I prefer not using deprecated methods, but if I need to use them I will ? there is no more chance I see

Link to comment
Share on other sites

Mojang uses "depreciated" in the Block class (and only in the block class) to mean "invoke this from a BlockState, however overriding this is fine"

  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

12 hours ago, Cadiboo said:

Mojang uses "depreciated" in the Block class (and only in the block class) to mean "invoke this from a BlockState, however overriding this is fine"

Okay, thanks for explaining it, as I said i am new in forge programming, now I understand it (you or I had to start from there xD)

Link to comment
Share on other sites

16 hours ago, DarkDragon117 said:

Why?

I was mainly referring to this:

23 hours ago, DarkDragon117 said:

Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)

. This is your IDE telling you that the method does not exists; you should be able to interpret error messages like this.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

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.



×
×
  • Create New...

Important Information

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