Posted April 20, 20205 yr Hi everybody, I've been searching for a lot of hours today and still can't find an answer, so I decided to come and ask here. I want to override canInsertItem from ShulkerBoxTileEntity since I want to set it always to true so the player can nest shulker boxes. Can I do this? How?
April 20, 20205 yr The approach I would recommend is to replace the vanilla shulker tile entity with a custom one you wrote that accepts all items. There are other ways like ASM, but I don’t recommend it unless you are familiar with it. 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.
April 20, 20205 yr Author Thanks for answering! I am an absolute beginner of Forge but I know deeply Java, how can I attach then the tileentity to the block?
April 20, 20205 yr Author @DavidM I know that maybe you can't answer me right now but when you can, please do it as soon as possible
April 20, 20205 yr You register stuff under the same registry name as the entry you would like to override. As for the shulker block, you might also have to change the constant under the Blocks class. Your custom shulker block should return an instance of your tile entity in createTileEntity. 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.
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.