samjviana
Members-
Posts
82 -
Joined
-
Last visited
-
Days Won
1
Everything posted by samjviana
-
Sorry for bringing back this topic but can you explain better how i can get the current rotation of the block? I looked at WeightedBakedModel but i couldn't find/understand how can i get the current rotated baked model.
-
Oohhh, now i understand what you're mean with "multiple models" lol, the answer was on my face. I'll edit to 1 model only, thanks
-
can i override this? or at least get what is the current rotation.
-
Sorry, i'm creating a mod. The block has multiple models, with 1, 2 and 3 mushrooms, like so: but i still does'n get why is it that it appears in diferent directions when placed, i'll post the blockstate.json below. Actually was started to think that is some default mechanic of minecraft even the grass block has some "randomness" when placed, you can see this pushing it with an piston, right when it change it position, the block "rotates": { "variants": { "mushrooms=1": [ { "model": "bunchofthings:block/yellow_mushroom" }, { "model": "bunchofthings:block/yellow_mushroom", "y": 90 }, { "model": "bunchofthings:block/yellow_mushroom", "y": 180 }, { "model": "bunchofthings:block/yellow_mushroom", "y": 270 } ], "mushrooms=2": [ { "model": "bunchofthings:block/two_yellow_mushroom" }, { "model": "bunchofthings:block/two_yellow_mushroom", "y": 90 }, { "model": "bunchofthings:block/two_yellow_mushroom", "y": 180 }, { "model": "bunchofthings:block/two_yellow_mushroom", "y": 270 } ], "mushrooms=3": [ { "model": "bunchofthings:block/three_yellow_mushroom" }, { "model": "bunchofthings:block/three_yellow_mushroom", "y": 90 }, { "model": "bunchofthings:block/three_yellow_mushroom", "y": 180 }, { "model": "bunchofthings:block/three_yellow_mushroom", "y": 270 } ] } }
-
So i have this mushroom block, that should be the same when placed, but event without any facing or direction property set it appears pointing to an direction:
-
Thanks... I was implementing your idea, then i realized that if i check the block using the height 0 (kinda like "the block that the entity is in") it will always detect air when the player is standing in any full block (OF COURSE), including an full block of slabs but when the entity is standing in an half slab block, the block detected will be the slab, the entity is above the half salb, but is inside the block containing the slab, pretty confuse hahaha. With that in mind i verify if the block that the player is inserted in, is an slab, and if it's not than i verify the block below with world.getBlockState(entity.getPosition().down()), worked like a charm.
-
Is there a way to detect which block is below and given entity, in a way that it work for full blocks, slabs, and fences/walls. Actually i can detect the block below the entity using world.getBlockState(entity.getPosition().down()), but then it won't work for half slabs, and if i write an "verification" if the Y pos is .5 (half slab) then it won't detect if it is above an wall.
-
As from the integer "6" you asked ... it represent the vein size that the ore will try to generate.
-
Only of it is something specific that the default vanilla features can't solve. For ore generation you could use Feature.ORE (default ore generation), Feature.EMERALD_ORE (which generates only in mountain biome) or Feature.No_SURFACE_ORE (ancient debris feature, an ore that has no contact with air blocks)
-
The add function needs an "Supplier<ConfiguredFeature<?, ?>>" your lambda function is returning a type Ingredient you would need to return an ConfiguredFeature, like so: if (event.getCategory() != Biome.Category.NETHER && event.getCategory() != Biome.Category.THEEND) { event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES).add( () -> Feature.ORE.withConfiguration( new OreFeatureConfig(OreFeatureConfig.FillerBlockType.BASE_STONE_OVERWORLD, RegistryHandler.MY_ORE.get().getDefaultState(), 6) ) ); }
-
You can use your IDE to look the source code of Vanilla Classes ... The classes you would like to see are net.minecraft.world.gen.feature.Feature and net.minecraft.world.gen.feature.Features.
-
AL lib: (EE) alc_cleanup: 1 device not closed when opening a GUI
samjviana replied to PutoPug's topic in Modder Support
In which moment the game crashes? on you interact with a block? -
It might have an better way to do this by checking the dimension of the biome, but i have to admit that i don't know how to check the dimension XD So ... you could check if the biome is NOT NETHER or THEEND Category, something like: if (event.getCategory() != Biome.Category.NETHER && event.getCategory() != Biome.Category.THEEND)
-
AL lib: (EE) alc_cleanup: 1 device not closed when opening a GUI
samjviana replied to PutoPug's topic in Modder Support
The error is happening when it tries to get the Player inventoty but it seems to get an empty Array right?🤔 -
You would need to listen to BiomeLoadingEvent (), you could register an function to it like this: MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, onBiomeLoading); As from the javadocs of the event: "This event fires when a Biome is created from json or when a registered biome is re-created for worldgen" With this done you would just need to "treat" the biome in the listener and add any feature (like ore generation) you need. An exemple of listener: public static void onBiomeLoading(final BiomeLoadingEvent event) { /* Check which biome are being loaded, example: if the biome is TAIGA or SWAMP */ if (event.getCategory() == Biome.Category.TAIGA || event.getCategory() == Biome.Category.SWAMP) { /* Get UNDERGROUND_ORES features of the biome */ event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES ).add( /* adding COAL_ORE with some configuration */ () -> Blocks.COAL_ORE.withConfiguration(...) ); } } As from the configuration you could look at the Vanilla default ore generation features to get what you want.
-
which version of forge are you using?
-
AL lib: (EE) alc_cleanup: 1 device not closed when opening a GUI
samjviana replied to PutoPug's topic in Modder Support
Can you show this function? com.putopug.combat7.objects.blocks.CraftoxBlock$BlockCus.onBlockActivated(CraftoxBlock.java:176) -
Maybe he could do something like this, if i'm not mistaken: @SubscribeEvent public static void onRegisterItem(final RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block -> { if (!isInFilter(block)) { return; } else { final BlockItem blockItem = new BlockItem(block, properties); blockItem.setRegistryName(block.getRegistryName()); registry.register(blockItem); } }); }
-
[1.16.5] How to make EnchantedBook go to Custom ItemGroup
samjviana replied to samjviana's topic in Modder Support
Oh ... such a simple thing LOL, pretty dumb of me by not realizing that. Thanks for the help ... i'll remove this line. -
[1.16.5] How to make EnchantedBook go to Custom ItemGroup
samjviana replied to samjviana's topic in Modder Support
i have other entries in the lang file that work well ... https://github.com/samjviana/bunchofthings