-
Posts
687 -
Joined
-
Last visited
-
Days Won
10
Everything posted by Beethoven92
-
Nevermind, i just made some tests, you can just override getCollisionShape without all that onEntityCollision stuff(even if it somehow worked). Still we are at the starting point again, by returning the full block collision shape in case your condition is not verified, the block pushes you back, and the only way i managed to get that working is still to return a voxel shape which is slightly smaller than the full cube as i showed earlier..why that works? i honestly still have to figure it out ๐ค
-
And thats why you need to override getShape and leave getCollisionShape as it is
-
I just stick something together trying to solve the problem you had, so my block just extends Block and overrides onEntityCollision and getShape, nothing more
-
That's what i was thinking, but after testing with multiple blocks it appears that with my code if i am inside one block (and so its voxel shape its null), all the other blocks also have null voxel shapes ๐ค
-
[1.16] Run two different projects in Eclipse
Beethoven92 replied to KidKoderMod033109's topic in Modder Support
So...lets do it again. In your package explorer on the left you have all your projects folders right? Select the one you want to work on and right click it. Then select Run As and Run Configurations. In the window that appears you should see in the box on the left various voices. You should see "Java Application". Inside it there is a runClient voice, left click on that. Then on the right side of the window, in the box with the 'Project' label you have to select the mod project you want to run (use browse button, it should let you see all the project you currently have in your workspace). When you have your project selected click the Run button below. If that doesn't work i swear i do not know what is wrong, as i am doing the same process without any issue -
There are some "#missing" textures in your model file
-
[1.16] Run two different projects in Eclipse
Beethoven92 replied to KidKoderMod033109's topic in Modder Support
Specify what isn't working, is it loading the wrong project or not running the project at all? -
[1.16] Run two different projects in Eclipse
Beethoven92 replied to KidKoderMod033109's topic in Modder Support
Then just select the project you want to run in the box above (click browse to see all existing projects and select one)...also the project needs to be run with the runClient configuration if you want to start a client instance of minecraft -
[1.16] Run two different projects in Eclipse
Beethoven92 replied to KidKoderMod033109's topic in Modder Support
On the bottom-right of the window, just click the "Run" button -
[1.16] Run two different projects in Eclipse
Beethoven92 replied to KidKoderMod033109's topic in Modder Support
Of course. Right click on the main folder of the project you want to run, then Run As ---> Run Configurations. Inside the window that shows up you can select which of your current workspace projects you want to run -
Yes, they will, because i return the selected voxel shape (null or "full" block) from the getShape method
-
Of course you have to represent your item in code. You need to register it in the forge registries so the game knows it exists
-
So...i tried to code that myself and i made it work, but my solution may not be the best or the most elegant one. Turns out that onEntityCollision happens only if the shape of the block is set to be smaller than the full block. So i set two different voxel shapes, a null voxel shape and one that is slightly smaller than the cube, with dimensions: Block.makeCuboidShape(0.1F, 0.1F, 0.1F, 15.9F, 15.9F, 15.9F) which doesn't basically change anything visually but lets the collision event happen (For some reason i am still unable to understand). Inside the event i just check for the condition and select the appropriate voxel shape, which then needs to be returned by getShape (not getCollisionShape). It works but as i said before this seems to be a slightly "hacky" solution and also present some issues: 1) you will be able to walk on the border of your block when in its solid form 2) any other entity will be able to walk through your block while you are inside the block with your condition being verified 3) being the voxel shapes static and shared between all blocks of the same type, when you make one of them not solid, if other are present they will all become not solid
-
๐ i guess by removing the entity (your player in this case) bounding box, collision with the ground are not checked anymore, thats why you just sank out of the world. Don't touch the entity bounding box...i was thinking at something like...is there a collision between your block and the player? Is your condition satisfied? ----> get rid of the collision shape of the block , else the block is acting as normal with the collisions and all the rest
-
Well, since you are trying to make the block uncollidable under your conditions, you should check for that condition inside this method (eg check if the player is holding a special item when colliding with your block) and take the appropriate measure.
-
GlassBlock doesn't override onEntityCollision, but it is inheriting it from the Block class, so you can specify your own version of this method in your custom block, even if the original method is doing nothing.
-
What about overriding the onEntityCollision method?
-
Well, if you specify doesNotBlockMovement in the block properties, instead of returning a VoxelShapes#empty under your conditions,you could instead return the collision shape of the block when the condition is not verified. Basically invert what you were doing here: @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { if(/*some condition*/) { return VoxelShapes.empty(); } return super.getCollisionShape(state, worldIn, pos, context); }
-
[1.16.2] How to add a Description/Lore to an Item?
Beethoven92 replied to winkeyface14's topic in Modder Support
Check Item#addInformation -
Oh ok, you are overriding the vanilla block with your custom one in the registry, i missed that, my bad! What Draco18 suggested you should be fine
-
Show your code please
-
Trying to Create and Enter World Crash
Beethoven92 replied to jinuji's topic in Support & Bug Reports
My guess is that Optifine is not updated to 1.16.2 yet. See if it works without it, or consider switching back to 1.16.1 until they update -
Do you want to make the Vanilla block have no collision or your custom block? You cannot modify a vanilla block behaviour by extending the block and overriding a method in your custom block