-
Cross block is strange
Hello! I'm trying to create a grass block, using json's "parent": "block/cross", but it works incorrectly. What have I done wrong? BLOCK MODEL: { "parent": "block/cross", "textures": { "cross": "examplemod:block/example_sapling", "particle": "examplemod:block/example_sapling" } } BLOCKSTATE: { "variants": { "": { "model": "examplemod:block/example_sapling" } } } BlockItem is working, so textures are on the right place.
-
SaplingBlock don't work
Hello! I don't know why, but my block doesn't work in the game. It is registered in the game, but textures are unavailable and I can't place it. I can't find a mistake///// Cusom Block class: // CUSTOM BLOCK CLASS public class CustomSaplingBlock extends SaplingBlock { private final TreeSpawner tree; public CustomSaplingBlock(Properties properties, TreeSpawner spawner) { super(null, properties); this.tree = spawner; } @Override public void placeTree(ServerWorld world, BlockPos pos, BlockState state, Random rand) { if (state.get(STAGE) == 0) { world.setBlockState(pos, state.cycleValue(STAGE), 4); } else { tree.spawn(world, world.getChunkProvider().getChunkGenerator(), pos, state, rand); } } } public abstract class TreeSpawner { @Nullable protected abstract Feature<IFeatureConfig> getFeature(Random random); @Nullable protected abstract IFeatureConfig getConfig(Random random); public boolean spawn(ISeedReader reader, ChunkGenerator generator, BlockPos pos, BlockState blockunder, Random random) { Feature<IFeatureConfig> tree = getFeature(random); if (tree == null) return false; IFeatureConfig config = getConfig(random); if (config == null) return false; reader.setBlockState(pos, Blocks.AIR.getDefaultState(), 4); if (tree.generate(reader, generator, random, pos, config)) { return true; } reader.setBlockState(pos, blockunder, 4); return false; } } BLOCK INIT: public static final RegistryObject<Block> EXAMPLE_SAPLING = BLOCKS.register("example_sapling", () -> new CustomSaplingBlock(AbstractBlock.Properties.create(Material.LEAVES).sound(SoundType.PLANT) .hardnessAndResistance(0f).tickRandomly().notSolid(), null)); BLOCKSTATE (json): { "variants": { "": { "model": "examplemod:block/example_sapling" } } } BLOCK MODEL: { "parent": "block/cross", "textures": { "cross": "examplemod:block/example_sapling", "particle": "examplemod:block/example_sapling" } } Leaves and log are working perfectly. I think something is wrong with the model (?), but I think everything is right
-
Custom biome generation (where is my stone)
Yes, it's in the correct place, because the top layer is generated correctly. public class MiracleSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig> { public static final BlockState MIRACLE_GRASS = BlockInit.MIRACLE_GRASS.get().getDefaultState(); public static final SurfaceBuilderConfig MIRACLE_GRASS_CONFIG = new SurfaceBuilderConfig(MIRACLE_GRASS, MIRACLE_GRASS, MIRACLE_GRASS); public MiracleSurfaceBuilder(Codec<SurfaceBuilderConfig> codec) { super(codec); // TODO Auto-generated constructor stub } @Override public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) { SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, MIRACLE_GRASS_CONFIG); } } }
-
Custom biome generation (where is my stone)
Hi! I'm currently making my biome (i'm using json files). Everything is alright, but only top layer appears. Stone IS in the game, but just don't go to the biome. What should I do? { "config": { "top_material":{ "Name": "mymode:miracle_grass" }, "under_material":{ "Name": "mymode:miracle_stone" }, "underwater_material":{ "Name": "mymode:miracle_stone" } }, "type": "mymode:miracle" }
-
Variations of entity's texure (like differently colored flowers)
Hi! Sorry, didin't understand how exactly I should randomize what color to use. If I have an enum in my entity class, how should I randlomly pick one?
-
Variations of entity's texure (like differently colored flowers)
I'm working on an entity, which texture should have several variations. You know, there is blue sheep, black sheep, white sheep. I want to do the same thing. How should I do that? I'm working with Geckolib.
-
Event Handler doesn't work
THANK YOU SO MUCH I WOULD NEVER NOTICED IT MYSELF!!! 😭😭😭 Thank you that you invested so much time to help me! It works perfectly! I hope you'll have a nice day! Thank you so much!
-
Event Handler doesn't work
I was getting aan error, but now I've fixed it!!! My git repo: https://github.com/daekgorsel/ArmorPlusGit
-
Event Handler doesn't work
Sorry, I can't do that. My project is not loading to git repo. Can I just provide a screenshot or something?
-
Event Handler doesn't work
@SubscribeEvent public static void onLivingAttackEvent(LivingAttackEvent event) { LavaArmor.LOGGER.info("event is here"); . . . } Only this way! I've put Logger into this method and let a zombie hit me. Logger didn't show up.
-
Event Handler doesn't work
Sorry. I've deleted this stuff you mantioned: But it still doesn't work. I'm registering it only once in main class and I don't have @OnlyIn thingy. I can't even imagine why it doesn't work
-
Event Handler doesn't work
No, I'm not using them. My EventHandler and Main class sools exactly as I mentioned before. I've dropped gist to show other classes.
-
Event Handler doesn't work
I register it in the main class: @Mod(LavaArmor.MODID) public class LavaArmor { public static final String MODID = "lavaarmor"; public LavaArmor() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(EventHandler.class); } @SuppressWarnings("deprecation") private void setup(final FMLCommonSetupEvent event) { } } Whole code: https://gist.github.com/daekgorsel/c903cff212bb5e8ecdad20bf2dd13c9a
-
Event Handler doesn't work
Yes, Logger is silent. @SubscribeEvent public static void onLivingAttackEvent(LivingAttackEvent event) { LavaArmor.LOGGER.info("event is here"); . . . } It doesn't appear. Why? I'm so confused because the exact same thing works in another project
-
Event Handler doesn't work
I'm not sure about you question, but when Entity attacks my, nothing appears on Console. So I think it's not called... am I right?
IPS spam blocked by CleanTalk.