Started by
MaxVinicius
on
Topic category: Help with Minecraft modding (Java Edition)
I want make trapdoor 3x3, but i cant to do rotatio the block! who can help me?
Edited by MaxVinicius on Fri, 01/12/2024 - 12:23
Topic category: Help with Minecraft modding (Java Edition)
I want make trapdoor 3x3, but i cant to do rotatio the block! who can help me?
Tricky, but not impossible. This is difficult because you're going to need nine seperate blocks, each of which needs to change its position and rotation differently whenever any of the blocks is clicked, and you're going to have to make a seperate case for every possible rotation and state of your trapdoor. The basic idea would be that, whenever any of the blocks is clicked, it runs a procedure on all of the other trapdoor blocks, (determining their position based on which type it is), that changes their rotation/nbt data and positions correctly. (Again, the 'correct' way to change them will be different for each block and each possible position, making this really annoying to get working.)
As for the specific rotation thing, the problem your having is that trap doors have both rotation, as well as an 'open/closed' nbt property that determines how they're flipped, and which is independent of rotation. You'll need to do something similar for these, or use the trapdoor block preset. You'll also need to make a procedure to deal with breaking all the other blocks whenever one is destroyed or removed, etc. Again, not impossible, but difficult- if you want to save yourself the trouble, it would be way easier to make the block just replace itself with a non-solid transparent block, and update all the adjacent blocks of the same type, but if you really need it to work like a trapdoor, you can give this method a try.