Jump to content

Recommended Posts

Posted (edited)

I can't use a blockstate well
the only thing that I can do a bit is to make variants which generate random blocks and when we destroy it they remain the same and rotate them a bit too

but the thing where I have the most difficulty understanding and where I have a lot of error is (true false) or more

for example, I tested something with snow and I often have errors like this

the result obviously gives me the block without texture

3:20.41 [Server-Worker-6/WARN] [minecraft/ModelBakery]: Unable to load model: 'testnt:block/bloc_1' referenced from: testnt:bloc_2#: java.io.FileNotFoundException: testnt:models/block/bloc_1.json 
33:20.41 [Server-Worker-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testnt:blockstates/bfinale.json' in resourcepack: 'Mod Resources' for variant: 'snowy=false': Unknown blockstate property: 'snowy' 
33:20.41 [Server-Worker-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testnt:blockstates/bfinale.json' in resourcepack: 'Mod Resources' for variant: 'snowy=true': Unknown blockstate property: 'snowy' 
33:20.41 [Server-Worker-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testnt:blockstates/bfinale.json' missing model for variant: 'testnt:bfinale#'
{
  "variants": {
    "snowy=false": {"model": "testnt:block/b_middle"},
    "snowy=true": {"model": "testnt:block/b_top"}
  }
}

I tested with many others as the direction still true and false

 

I would like to know if he has someone who knows about it who could know how to use better

 

in detail I use Mcreator to code this

I know but it's also to learn a little more modding

Edited by LicaSkelecario
Posted

this block conect 2 block

name:BFinale

package net.mcreator.testnt.block;

import net.minecraftforge.registries.ObjectHolder;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;

import net.minecraft.world.storage.loot.LootContext;
import net.minecraft.world.IBlockReader;
import net.minecraft.util.math.BlockPos;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Item;
import net.minecraft.item.BlockItem;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.block.material.Material;
import net.minecraft.block.SoundType;
import net.minecraft.block.BlockState;
import net.minecraft.block.Block;

import net.mcreator.testnt.TestntModElements;

import java.util.List;
import java.util.Collections;

@TestntModElements.ModElement.Tag
public class BfinaleBlock extends TestntModElements.ModElement {
	@ObjectHolder("testnt:bfinale")
	public static final Block block = null;
	public BfinaleBlock(TestntModElements instance) {
		super(instance, 17);
	}

	@Override
	public void initElements() {
		elements.blocks.add(() -> new CustomBlock());
		elements.items
				.add(() -> new BlockItem(block, new Item.Properties().group(ItemGroup.BUILDING_BLOCKS)).setRegistryName(block.getRegistryName()));
	}

	@Override
	@OnlyIn(Dist.CLIENT)
	public void clientLoad(FMLClientSetupEvent event) {
		RenderTypeLookup.setRenderLayer(block, RenderType.getCutout());
	}
	public static class CustomBlock extends Block {
		public CustomBlock() {
			super(Block.Properties.create(Material.ROCK).sound(SoundType.GROUND).hardnessAndResistance(1f, 10f).lightValue(0).notSolid());
			setRegistryName("bfinale");
		}

		@Override
		public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos) {
			return false;
		}

		@Override
		public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
			return true;
		}

		@Override
		public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
			List<ItemStack> dropsOriginal = super.getDrops(state, builder);
			if (!dropsOriginal.isEmpty())
				return dropsOriginal;
			return Collections.singletonList(new ItemStack(this, 1));
		}
	}
}

 

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.