Posted March 5, 20196 yr 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 March 6, 20196 yr by DarkDragon117 Solved
March 5, 20196 yr 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 Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.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)
March 5, 20196 yr Author 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
March 5, 20196 yr 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 March 6, 20196 yr by DavidM Quoted the wrong part 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.
March 5, 20196 yr Author 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
March 6, 20196 yr 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" About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.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)
March 6, 20196 yr Author 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)
March 6, 20196 yr 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.
March 6, 20196 yr Author 1 hour ago, DavidM said: . This is your IDE telling you that the method does not exists; you should be able to interpret error messages like this. I knew that, I was asking for any other method because I can't use it and I see it everywhere I search
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.