No surface when placing block.

Started by PawloZiomYT on

Topic category: Help with modding (Java Edition)

Last seen on 13:07, 15. Sep 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No surface when placing block.
Thu, 09/05/2024 - 13:53 (edited)

So i tried to place my oak table and i can see caves under my block. i'm working on neoforge and my minecraft version is 1.21. can some help me? i will attach image and my code: 

// ModBlocks.java
package com.pawloziom.furniturecraft.blocks;

import com.pawloziom.furniturecraft.FurnitureCraft;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredRegister;

//rework
public class ModBlocks {
    public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(FurnitureCraft.MODID);
    public static final DeferredBlock<Block> OAK_TABLE = BLOCKS.register(
            "oak_table",
            () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.OAK_PLANKS)));
}
// oak_table.json (made using blockbench)
{
	"texture_size": [32, 32],
	"textures": {
		"0": "furniturecraft:block/oak_table",
		"particle": "furniturecraft:block/oak_table"
	},
	"elements": [
		{
			"from": [0.25, 14, 0.25],
			"to": [15.75, 14.5, 15.75],
			"rotation": {"angle": 0, "axis": "y", "origin": [3, 12, 11]},
			"faces": {
				"north": {"uv": [8.5, 3.5, 14.25, 3.75], "texture": "#0"},
				"east": {"uv": [8.5, 4, 14.25, 4.25], "texture": "#0"},
				"south": {"uv": [8.5, 4.5, 14.25, 4.75], "texture": "#0"},
				"west": {"uv": [8.5, 5, 14.25, 5.25], "texture": "#0"},
				"up": {"uv": [5.75, 5.75, 0, 0], "texture": "#0"},
				"down": {"uv": [5.75, 6, 0, 11.75], "texture": "#0"}
			}
		},
		{
			"from": [3.5, 0, 3.5],
			"to": [5, 14.1, 5],
			"rotation": {"angle": 0, "axis": "y", "origin": [3, 0, 11]},
			"faces": {
				"north": {"uv": [6, 0, 6.5, 3.5], "texture": "#0"},
				"east": {"uv": [6, 3.5, 6.5, 7], "texture": "#0"},
				"south": {"uv": [6.5, 0, 7, 3.5], "texture": "#0"},
				"west": {"uv": [6.5, 3.5, 7, 7], "texture": "#0"},
				"up": {"uv": [9, 6, 8.5, 5.5], "texture": "#0"},
				"down": {"uv": [9, 6, 8.5, 6.5], "texture": "#0"}
			}
		},
		{
			"from": [11, 0, 3.5],
			"to": [12.5, 14.1, 5],
			"rotation": {"angle": 0, "axis": "y", "origin": [11, 0, 11]},
			"faces": {
				"north": {"uv": [7, 0, 7.5, 3.5], "texture": "#0"},
				"east": {"uv": [7, 3.5, 7.5, 7], "texture": "#0"},
				"south": {"uv": [6, 7, 6.5, 10.5], "texture": "#0"},
				"west": {"uv": [6.5, 7, 7, 10.5], "texture": "#0"},
				"up": {"uv": [9, 7, 8.5, 6.5], "texture": "#0"},
				"down": {"uv": [9, 7, 8.5, 7.5], "texture": "#0"}
			}
		},
		{
			"from": [11, 0, 11],
			"to": [12.5, 14.1, 12.5],
			"rotation": {"angle": 0, "axis": "y", "origin": [11, 0, 19]},
			"faces": {
				"north": {"uv": [7, 7, 7.5, 10.5], "texture": "#0"},
				"east": {"uv": [7.5, 0, 8, 3.5], "texture": "#0"},
				"south": {"uv": [7.5, 3.5, 8, 7], "texture": "#0"},
				"west": {"uv": [7.5, 7, 8, 10.5], "texture": "#0"},
				"up": {"uv": [9, 8, 8.5, 7.5], "texture": "#0"},
				"down": {"uv": [9, 8, 8.5, 8.5], "texture": "#0"}
			}
		},
		{
			"from": [3.5, 0, 11],
			"to": [5, 14.1, 12.5],
			"rotation": {"angle": 0, "axis": "y", "origin": [3, 0, 19]},
			"faces": {
				"north": {"uv": [8, 0, 8.5, 3.5], "texture": "#0"},
				"east": {"uv": [8, 3.5, 8.5, 7], "texture": "#0"},
				"south": {"uv": [8, 7, 8.5, 10.5], "texture": "#0"},
				"west": {"uv": [8.5, 0, 9, 3.5], "texture": "#0"},
				"up": {"uv": [9, 9, 8.5, 8.5], "texture": "#0"},
				"down": {"uv": [9.5, 0, 9, 0.5], "texture": "#0"}
			}
		}
	],
	"gui_light": "side",
	"display": {
		"thirdperson_righthand": {
			"rotation": [73, 0, 0],
			"translation": [0, 2.5, 1.75],
			"scale": [0.5, 0.5, 0.5]
		},
		"thirdperson_lefthand": {
			"rotation": [73, 0, 0],
			"translation": [0, 2.5, 1.75],
			"scale": [0.5, 0.5, 0.5]
		},
		"firstperson_righthand": {
			"rotation": [0, 130, 0],
			"translation": [-0.75, 5.75, 2.75],
			"scale": [0.5, 0.5, 0.5]
		},
		"firstperson_lefthand": {
			"rotation": [0, 130, 0],
			"translation": [-0.75, 5.75, 2.75],
			"scale": [0.5, 0.5, 0.5]
		},
		"ground": {
			"scale": [0.5, 0.5, 0.5]
		},
		"gui": {
			"rotation": [25, 160, 0]
		},
		"head": {
			"translation": [0, 14, 0]
		},
		"fixed": {
			"translation": [0, 0, -4.5]
		}
	}
}

it looks like this

Edited by PawloZiomYT on Thu, 09/05/2024 - 13:53
Last seen on 13:07, 15. Sep 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you Klemen, It worked!
Sat, 09/14/2024 - 09:54

Thank you Klemen, It worked!