Luis_ST
Members-
Posts
5704 -
Joined
-
Last visited
-
Days Won
72
Everything posted by Luis_ST
-
I creat a Glass Block which is called Tinted Glass so my problem is the RenderType the block is Translucent but i dont get normal black outlines Look there a can't upload my picture of the in game block: https://drive.google.com/file/d/1KNW5KPiNZbml95sNRnAZHUpXPBndSnWm/view?usp=sharing This is the code to set it Translucent : private void setup(final FMLCommonSetupEvent event) { RenderTypeLookup.setRenderLayer(CaveBlocks.TINTED_GLASS.get(), RenderType.getTranslucent()); }
-
i creat this but i get an error when i remove try catch: @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { PlayerEntity player = (PlayerEntity) context.getEntity(); try { if (player.inventory.armorItemInSlot(0).getItem() == Items.LEATHER_BOOTS) { return VoxelShapes.fullCube(); } else { return VoxelShapes.empty(); } } catch (Exception e) { return VoxelShapes.empty(); } } net.minecraft.crash.ReportedException: Rendering overlay at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:489) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:988) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:587) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.3.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {} Caused by: java.lang.NullPointerException at net.luis.cave.blocks.PowderSnow.getCollisionShape(PowderSnow.java:62) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:845) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:817) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState.cacheState(AbstractBlock.java:470) ~[?:?] {re:classloading} at net.minecraftforge.registries.GameData$BlockCallbacks.onBake(GameData.java:474) ~[?:?] {re:classloading} at net.minecraftforge.registries.ForgeRegistry.bake(ForgeRegistry.java:503) ~[?:?] {re:classloading} at net.minecraftforge.registries.GameData.lambda$freezeData$5(GameData.java:330) ~[?:?] {re:classloading} at com.google.common.collect.HashBiMap.forEach(HashBiMap.java:528) ~[guava-21.0.jar:?] {} at net.minecraftforge.registries.GameData.freezeData(GameData.java:328) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModLoader.finishMods(ModLoader.java:273) ~[?:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.lambda$finishModLoading$7(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:103) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:783) ~[?:?] {} at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479) ~[?:?] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[?:?] {} at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016) ~[?:?] {} at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665) ~[?:?] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598) ~[?:?] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[?:?] {} [m[32m[17:40:03] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:127]: ---- Minecraft Crash Report ---- // I let you down. Sorry :( Time: 02.12.20, 17:40 Description: Rendering overlay java.lang.NullPointerException: Rendering overlay at net.luis.cave.blocks.PowderSnow.getCollisionShape(PowderSnow.java:62) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:845) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:817) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState.cacheState(AbstractBlock.java:470) ~[?:?] {re:classloading} at net.minecraftforge.registries.GameData$BlockCallbacks.onBake(GameData.java:474) ~[?:?] {re:classloading} at net.minecraftforge.registries.ForgeRegistry.bake(ForgeRegistry.java:503) ~[?:?] {re:classloading} at net.minecraftforge.registries.GameData.lambda$freezeData$5(GameData.java:330) ~[?:?] {re:classloading} at com.google.common.collect.HashBiMap.forEach(HashBiMap.java:528) ~[guava-21.0.jar:?] {} at net.minecraftforge.registries.GameData.freezeData(GameData.java:328) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModLoader.finishMods(ModLoader.java:273) ~[?:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.lambda$finishModLoading$7(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:103) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:783) ~[?:?] {} at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479) ~[?:?] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[?:?] {} at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016) ~[?:?] {} at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665) ~[?:?] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598) ~[?:?] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[?:?] {}
-
Is there a way to set the Block Propertie ".doesNotBlockMovement()" only if the player has an Enchantment
-
okay thanks so much the Shield works perfectly
-
Okay i just look into this class so i creat this: package net.luis.cave.models; import net.luis.cave.init.CaveTools; import net.minecraft.item.ItemModelsProperties; import net.minecraft.util.ResourceLocation; public class ShieldItemModelProperties extends ItemModelsProperties { public ShieldItemModelProperties() { func_239418_a_(CaveTools.ENDERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> { return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F; }); } } Where should I add this to the shield or where should i register this
-
okay thanks it work now and another question/problem i dont get the normal blocking model i think the predicate blocking dosent work { "parent": "builtin/entity", "gui_light": "front", "textures": { "particle": "block/dark_oak_planks" }, "display": { "thirdperson_righthand": { "rotation": [0, 90, 0], "translation": [10, 6, -4], "scale": [1, 1, 1] }, "thirdperson_lefthand": { "rotation": [0, 90, 0], "translation": [10, 6, 12], "scale": [1, 1, 1] }, "firstperson_righthand": { "rotation": [0, 180, 5], "translation": [-10, 2, -10], "scale": [1.25, 1.25, 1.25] }, "firstperson_lefthand": { "rotation": [0, 180, 5], "translation": [10, 0, -10], "scale": [1.25, 1.25, 1.25] }, "gui": { "rotation": [15, -25, -5], "translation": [2, 3, 0], "scale": [0.65, 0.65, 0.65] }, "fixed": { "rotation": [0, 180, 0], "translation": [-2, 4, -5], "scale": [0.5, 0.5, 0.5] }, "ground": { "rotation": [0, 0, 0], "translation": [4, 4, 2], "scale": [0.25, 0.25, 0.25] } }, "overrides": [ { "predicate": { "blocking": 1 }, "model": "cave:item/enderite_shield_blocking" } ] }
-
okay i think i found the methods but it dosen't work this now my model class package net.luis.cave.model; import java.util.List; import java.util.Random; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.entity.model.ShieldModel; import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.Direction; public class EnderiteShieldModel extends ShieldModel implements IBakedModel { private final ModelRenderer plate; private final ModelRenderer handle; public EnderiteShieldModel() { this.textureWidth = 64; this.textureHeight = 64; this.plate = new ModelRenderer(this, 0, 0); this.plate.addBox(-6.0F, -11.0F, -2.0F, 12.0F, 22.0F, 1.0F, 0.0F); this.handle = new ModelRenderer(this, 26, 0); this.handle.addBox(-1.0F, -3.0F, -1.0F, 2.0F, 6.0F, 6.0F, 0.0F); } @Override public ModelRenderer func_228293_a_() { return this.plate; } @Override public ModelRenderer func_228294_b_() { return this.handle; } @Override public void render(MatrixStack matrixStackIn, IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { this.plate.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha); this.handle.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha); } @Override public List<BakedQuad> getQuads(BlockState state, Direction side, Random rand) { return null; } @Override public boolean isAmbientOcclusion() { return false; } @Override public boolean isGui3d() { return false; } @Override public boolean func_230044_c_() { return false; } @Override public boolean isBuiltInRenderer() { return true; } @Override public TextureAtlasSprite getParticleTexture() { return null; } @Override public ItemOverrideList getOverrides() { return null; } }
-
okay this are the render class: package net.luis.cave.render; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import net.luis.cave.model.EnderiteShieldModel; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.entity.model.ShieldModel; import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; public class EnderiteShieldRender extends ItemStackTileEntityRenderer { private final ShieldModel modelShield = new EnderiteShieldModel(); public void func_239207_a_(ItemStack p_239207_1_, ItemCameraTransforms.TransformType p_239207_2_, MatrixStack p_239207_3_, IRenderTypeBuffer p_239207_4_, int p_239207_5_, int p_239207_6_) { p_239207_3_.push(); p_239207_3_.scale(1.0F, -1.0F, -1.0F); final IVertexBuilder VertexBuilder = ItemRenderer.func_239391_c_(p_239207_4_, this.modelShield .getRenderType(new ResourceLocation("cave:textures/entity/enderite_shield.png")), true, p_239207_1_.hasEffect()); this.modelShield.func_228294_b_().render(p_239207_3_, VertexBuilder, p_239207_5_, p_239207_6_, 1.0F, 1.0F, 1.0F, 1.0F); p_239207_3_.pop(); } } and this are the model: package net.luis.cave.model; import java.util.List; import java.util.Random; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.entity.model.ShieldModel; import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.Direction; public class EnderiteShieldModel extends ShieldModel implements IBakedModel { @Override public List<BakedQuad> getQuads(BlockState state, Direction side, Random rand) { return null; } @Override public boolean isAmbientOcclusion() { return false; } @Override public boolean isGui3d() { return false; } @Override public boolean func_230044_c_() { return false; } @Override public boolean isBuiltInRenderer() { return true; } @Override public TextureAtlasSprite getParticleTexture() { return null; } @Override public ItemOverrideList getOverrides() { return null; } I think these are the most important classes
-
I had the same problem you have to add to the block properties .notSolid() i Think this will fix the problem
-
I think you can use the method UseAction: @Override public UseAction getUseAction(ItemStack itemstack) { return UseAction.DRINK; }
-
I creat a Custom Shield with Custom Model and ItemStackTileEntityRenderer but i have the half model/texture: i cant upload my picture so look there: https://drive.google.com/file/d/1GSBd2k3mBavdYc_VhsvNlDajv7llqwBA/view?usp=sharing Can somebody help me?
-
Okay thanks i forgot to set the item
-
I have created a custom shield but now it works not perfectly so my questions are: 1. how to set a costum texture because my shield has either the normal texture or no texture This is the Render class: package net.luis.cave.render; import java.util.List; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.mojang.datafixers.util.Pair; import net.luis.cave.model.EnderiteShieldModel; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.entity.model.ShieldModel; import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.client.renderer.model.RenderMaterial; import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.tileentity.BannerTileEntityRenderer; import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; import net.minecraft.item.DyeColor; import net.minecraft.item.ItemStack; import net.minecraft.item.ShieldItem; import net.minecraft.tileentity.BannerPattern; import net.minecraft.tileentity.BannerTileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; public class EnderiteShieldRender extends ItemStackTileEntityRenderer { private final ShieldModel modelShield = new EnderiteShieldModel(); public void func_239207_a_(ItemStack p_239207_1_, ItemCameraTransforms.TransformType p_239207_2_, MatrixStack p_239207_3_, IRenderTypeBuffer p_239207_4_, int p_239207_5_, int p_239207_6_) { boolean flag = p_239207_1_.getChildTag("BlockEntityTag") != null; p_239207_3_.push(); p_239207_3_.scale(1.0F, -1.0F, -1.0F); RenderMaterial rendermaterial = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation("cave:entity/enderite_shield.png")); // Show the Vanilla Textures -> RenderMaterial rendermaterial = flag ? ModelBakery.LOCATION_SHIELD_BASE : ModelBakery.LOCATION_SHIELD_NO_PATTERN; IVertexBuilder ivertexbuilder = rendermaterial.getSprite().wrapBuffer(ItemRenderer.func_239391_c_(p_239207_4_, this.modelShield .getRenderType(rendermaterial.getAtlasLocation()), true, p_239207_1_.hasEffect())); this.modelShield.func_228294_b_().render(p_239207_3_, ivertexbuilder, p_239207_5_, p_239207_6_, 1.0F, 1.0F, 1.0F, 1.0F); if (flag) { List<Pair<BannerPattern, DyeColor>> list = BannerTileEntity.func_230138_a_(ShieldItem.getColor(p_239207_1_), BannerTileEntity.func_230139_a_(p_239207_1_)); BannerTileEntityRenderer.func_241717_a_(p_239207_3_, p_239207_4_, p_239207_5_, p_239207_6_, this.modelShield.func_228293_a_(), rendermaterial, false, list, p_239207_1_.hasEffect()); } else { this.modelShield.func_228293_a_().render(p_239207_3_, ivertexbuilder, p_239207_5_, p_239207_6_, 1.0F, 1.0F, 1.0F, 1.0F); } p_239207_3_.pop(); } @Mod.EventBusSubscriber public static class ModAtlasTextures { @SubscribeEvent public static void onTextureStitchEvent(TextureStitchEvent.Pre event) { if (event.getMap().getTextureLocation() == AtlasTexture.LOCATION_BLOCKS_TEXTURE) { event.addSprite(ModelBakery.LOCATION_SHIELD_BASE.getAtlasLocation()); } } } } and my second Question: I use the vanila item models but the blocking model dosent work so what i have to change in the model: this is the shield model: { "parent": "builtin/entity", "gui_light": "front", "textures": { "particle": "block/dark_oak_planks" }, "display": { "thirdperson_righthand": { "rotation": [ 0, 90, 0 ], "translation": [ 10, 6, -4 ], "scale": [ 1, 1, 1 ] }, "thirdperson_lefthand": { "rotation": [ 0, 90, 0 ], "translation": [ 10, 6, 12 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 0, 180, 5 ], "translation": [ -10, 2, -10 ], "scale": [ 1.25, 1.25, 1.25 ] }, "firstperson_lefthand": { "rotation": [ 0, 180, 5 ], "translation": [ 10, 0, -10 ], "scale": [ 1.25, 1.25, 1.25 ] }, "gui": { "rotation": [ 15, -25, -5 ], "translation": [ 2, 3, 0 ], "scale": [ 0.65, 0.65, 0.65 ] }, "fixed": { "rotation": [ 0, 180, 0 ], "translation": [ -2, 4, -5], "scale":[ 0.5, 0.5, 0.5] }, "ground": { "rotation": [ 0, 0, 0 ], "translation": [ 4, 4, 2], "scale":[ 0.25, 0.25, 0.25] } }, "overrides": [ { "predicate": { "blocking": 1 }, "model": "cave:item/enderite_shield_blocking" } ] } and the blocking_shield model: { "parent": "builtin/entity", "gui_light": "front", "textures": { "particle": "block/dark_oak_planks" }, "display": { "thirdperson_righthand": { "rotation": [ 45, 135, 0 ], "translation": [ 3.51, 11, -2 ], "scale": [ 1, 1, 1 ] }, "thirdperson_lefthand": { "rotation": [ 45, 135, 0 ], "translation": [ 13.51, 3, 5 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 0, 180, -5 ], "translation": [ -15, 5, -11 ], "scale": [ 1.25, 1.25, 1.25 ] }, "firstperson_lefthand": { "rotation": [ 0, 180, -5 ], "translation": [ 5, 5, -11 ], "scale": [ 1.25, 1.25, 1.25 ] }, "gui": { "rotation": [ 15, -25, -5 ], "translation": [ 2, 3, 0 ], "scale": [ 0.65, 0.65, 0.65 ] } } }
-
i fixed it i creat a new item with the same properties and now it works
-
I want to replace the minecraft end_city_treasure loot table with my own but where is the error this is my loot table: { "pools": [ { "rolls": { "min": 2, "max": 8 }, "entries": [ { "type": "item", "name": "minecraft:diamond", "weight": 8, "functions": [ { "function": "set_count", "count": { "min": 2, "max": 7 } } ] }, { "type": "item", "name": "minecraft:iron_ingot", "weight": 13, "functions": [ { "function": "set_count", "count": { "min": 4, "max": 8 } } ] }, { "type": "item", "name": "minecraft:gold_ingot", "weight": 18, "functions": [ { "function": "set_count", "count": { "min": 2, "max": 7 } } ] }, { "type": "item", "name": "minecraft:emerald", "weight": 5, "functions": [ { "function": "set_count", "count": { "min": 2, "max": 7 } } ] }, { "type": "item", "name": "minecraft:saddle", "weight": 6 }, { "type": "item", "name": "minecraft:iron_horse_armor", "weight": 4 }, { "type": "item", "name": "minecraft:golden_horse_armor", "weight": 4 }, { "type": "item", "name": "minecraft:diamond_horse_armor", "weight": 4 }, { "type": "item", "name": "minecraft:diamond_sword", "weight": 6, "functions": [ { "function": "enchant_with_levels", "treasure": true, "levels": { "min": 20, "max": 39 } } ] }, { "type": "item", "name": "minecraft:diamond_helmet", "weight": 6, "functions": [ { "function": "enchant_with_levels", "treasure": true, "levels": { "min": 20, "max": 39 } } ] }, { "type": "item", "name": "minecraft:diamond_chestplate", "weight": 6, "functions": [ { "function": "enchant_with_levels", "treasure": true, "levels": { "min": 20, "max": 39 } } ] }, { "type": "item", "name": "minecraft:diamond_leggings", "weight": 6, "functions": [ { "function": "enchant_with_levels", "treasure": true, "levels": { "min": 20, "max": 39 } } ] }, { "type": "item", "name": "minecraft:diamond_boots", "weight": 6, "functions": [ { "function": "enchant_with_levels", "treasure": true, "levels": { "min": 20, "max": 39 } } ] }, { "type": "item", "name": "minecraft:diamond_pickaxe", "weight": 6, "functions": [ { "function": "enchant_with_levels", "treasure": true, "levels": { "min": 39, "max": 50 } } ] }, { "type": "item", "name": "minecraft:diamond_axe", "weight": 6, "functions": [ { "function": "enchant_with_levels", "treasure": true, "levels": { "min": 29, "max": 45 } } ] }, { "type": "item", "name": "minecraft:", "weight": 1, "functions": [ { "function": "set_count", "count": 1, "conditions": [ { "condition": "random_chance", "chance": 0.5 } ] }, { "function": "enchant_with_levels", "treasure": true, "levels": 50 }, { "function": "set_damage", "damage": { "min": 0.7, "max": 0.9 } } ] }, { "type": "item", "name": "minecraft:", "weight": 2, "functions": [ { "function": "set_count", "count": 1, "conditions": [ { "condition": "random_chance", "chance": 0.5 } ] }, { "function": "enchant_with_levels", "treasure": true, "levels": 50 }, { "function": "set_damage", "damage": { "min": 0.7, "max": 0.9 } } ] }, { "type": "item", "name": "minecraft:", "weight": 2, "functions": [ { "function": "set_count", "count": 1, "conditions": [ { "condition": "random_chance", "chance": 0.5 } ] }, { "function": "enchant_with_levels", "treasure": true, "levels": 50 }, { "function": "set_damage", "damage": { "min": 0.7, "max": 0.9 } } ] }, { "type": "item", "name": "minecraft:", "weight": 2, "functions": [ { "function": "set_count", "count": 1, "conditions": [ { "condition": "random_chance", "chance": 0.5 } ] }, { "function": "enchant_with_levels", "treasure": true, "levels": 50 }, { "function": "set_damage", "damage": { "min": 0.7, "max": 0.9 } } ] }, { "type": "item", "name": "minecraft:", "weight": 2, "functions": [ { "function": "set_count", "count": 1, "conditions": [ { "condition": "random_chance", "chance": 0.5 } ] }, { "function": "enchant_with_levels", "treasure": true, "levels": 50 }, { "function": "set_damage", "damage": { "min": 0.7, "max": 0.9 } } ] }, { "type": "item", "name": "minecraft:", "weight": 2, "functions": [ { "function": "set_count", "count": 1, "conditions": [ { "condition": "random_chance", "chance": 0.5 } ] }, { "function": "enchant_with_levels", "treasure": true, "levels": 50 }, { "function": "set_damage", "damage": { "min": 0.7, "max": 0.9 } } ] }, { "type": "item", "name": "minecraft:enchanted_book", "weight": 1, "functions": [ { "function": "enchant_randomly", "enchantments": [ "cave:elytra_falling" ] } ] } ] } ] } and this si the error im get now: [m[1;31m[18:50:04] [Render thread/ERROR] [minecraft/LootTableManager]: Couldn't parse loot table minecraft:chests/end_city_treasure com.google.gson.JsonSyntaxException: Expected name to be an item, was unknown string 'minecraft:' at net.minecraft.util.JSONUtils.lambda$getItem$0(JSONUtils.java:111) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at java.util.Optional.orElseThrow(Optional.java:401) ~[?:?] {} at net.minecraft.util.JSONUtils.getItem(JSONUtils.java:110) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.util.JSONUtils.getItem(JSONUtils.java:120) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.ItemLootEntry$Serializer.func_212829_b_(ItemLootEntry.java:50) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.ItemLootEntry$Serializer.func_212829_b_(ItemLootEntry.java:38) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.StandaloneLootEntry$Serializer.func_230421_b_(StandaloneLootEntry.java:145) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.StandaloneLootEntry$Serializer.func_230421_b_(StandaloneLootEntry.java:125) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootEntry$Serializer.func_230423_a_(LootEntry.java:73) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootEntry$Serializer.func_230423_a_(LootEntry.java:62) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootTypesManager$Serializer.deserialize(LootTypesManager.java:74) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[gson-2.8.0.jar:?] {} at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) ~[gson-2.8.0.jar:?] {} at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) ~[gson-2.8.0.jar:?] {} at com.google.gson.Gson.fromJson(Gson.java:887) ~[gson-2.8.0.jar:?] {} at com.google.gson.Gson.fromJson(Gson.java:952) ~[gson-2.8.0.jar:?] {} at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[gson-2.8.0.jar:?] {} at net.minecraft.util.JSONUtils.deserializeClass(JSONUtils.java:313) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.util.JSONUtils.deserializeClass(JSONUtils.java:321) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootPool$Serializer.deserialize(LootPool.java:183) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootPool$Serializer.deserialize(LootPool.java:180) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[gson-2.8.0.jar:?] {} at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) ~[gson-2.8.0.jar:?] {} at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) ~[gson-2.8.0.jar:?] {} at com.google.gson.Gson.fromJson(Gson.java:887) ~[gson-2.8.0.jar:?] {} at com.google.gson.Gson.fromJson(Gson.java:952) ~[gson-2.8.0.jar:?] {} at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[gson-2.8.0.jar:?] {} at net.minecraft.util.JSONUtils.deserializeClass(JSONUtils.java:313) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.util.JSONUtils.deserializeClass(JSONUtils.java:328) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootTable$Serializer.deserialize(LootTable.java:248) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootTable$Serializer.deserialize(LootTable.java:245) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[gson-2.8.0.jar:?] {} at com.google.gson.Gson.fromJson(Gson.java:887) ~[gson-2.8.0.jar:?] {} at com.google.gson.Gson.fromJson(Gson.java:952) ~[gson-2.8.0.jar:?] {} at com.google.gson.Gson.fromJson(Gson.java:925) ~[gson-2.8.0.jar:?] {} at net.minecraftforge.common.ForgeHooks.loadLootTable(ForgeHooks.java:815) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootTableManager.lambda$apply$0(LootTableManager.java:40) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at java.util.HashMap.forEach(HashMap.java:1425) ~[?:?] {} at net.minecraft.loot.LootTableManager.apply(LootTableManager.java:38) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.loot.LootTableManager.apply(LootTableManager.java:16) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.client.resources.ReloadListener.lambda$reload$1(ReloadListener.java:14) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) ~[?:?] {} at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?] {} at net.minecraft.resources.AsyncReloader.lambda$new$3(AsyncReloader.java:66) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.Minecraft.func_238189_a_(Minecraft.java:1865) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.func_238195_a_(Minecraft.java:1718) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.func_238192_a_(Minecraft.java:1695) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screen.CreateWorldScreen.createWorld(CreateWorldScreen.java:257) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screen.CreateWorldScreen.lambda$func_231160_c_$9(CreateWorldScreen.java:199) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.widget.button.Button.func_230930_b_(Button.java:26) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.widget.button.AbstractButton.func_230982_a_(AbstractButton.java:18) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.widget.Widget.func_231044_a_(Widget.java:136) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.INestedGuiEventHandler.func_231044_a_(INestedGuiEventHandler.java:31) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:92) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screen.Screen.func_231153_a_(Screen.java:421) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHelper.mouseButtonCallback(MouseHelper.java:90) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHelper.lambda$registerCallbacks$4(MouseHelper.java:185) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:86) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.MouseHelper.lambda$registerCallbacks$5(MouseHelper.java:184) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] {} at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] {} at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10] {} at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:93) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MainWindow.flipFrame(MainWindow.java:304) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1008) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:587) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.3.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.3.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {} what does it mean unknow string "minecraft:" must i registry a loot table from minecraft
-
yes i know i can eat the food in creativ and in survival even when the foodbar is empty and when i add this .setAlwaysEdible() then i cant eat the food in creativ mod
-
yes i know but i cant eat the food without a full foodbar
-
I creat a costum soup called fungus soup i can eat the soup i the creativ mod but i can't eat the soup in survival this is the code of the item/soup package net.luis.cave.items; import net.luis.cave.Cave; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Food; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.item.UseAction; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraft.world.World; public class FungusSoup extends Item { public FungusSoup() { super(new Item.Properties() .group(Cave.FOOD) .food(new Food.Builder() .hunger(10) .saturation(8.2f) .effect(new EffectInstance(Effects.RESISTANCE, 1200, 4), 1) .effect(new EffectInstance(Effects.MINING_FATIGUE, 1200, 4), 0.5f) .build())); } @Override public UseAction getUseAction(ItemStack stack) { return UseAction.EAT; } @Override public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity entityLiving) { ItemStack itemstack = super.onItemUseFinish(stack, worldIn, entityLiving); return entityLiving instanceof PlayerEntity && ((PlayerEntity)entityLiving).abilities.isCreativeMode ? itemstack : new ItemStack(Items.BOWL); } }
-
Yes why i code some god mods and programs All of them works fine
-
I want to creat Underground Biomes and i use for this custom Air Blocks when the Block generated he will check some conditions and the there will place costum blocks. It worked fine then i add a new condition and now i get this error: (down) the reason why i use this way is i want to create a gamerule which controls the generation of the cave biomes this should also be able to be switched on after generating the world so that cave biomes can be generated later. (when the world is already load) net.minecraft.crash.ReportedException: Exception ticking world at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:890) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:822) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:87) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:665) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:231) ~[?:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:832) [?:?] {} Caused by: java.lang.IllegalArgumentException: Cannot set property BooleanProperty{name=north, clazz=class java.lang.Boolean, values=[true, false]} as it does not exist in Block{cave:moss_air} at net.minecraft.state.StateHolder.with(StateHolder.java:106) ~[?:?] {re:classloading} at net.minecraft.block.VineBlock.func_196544_a(VineBlock.java:237) ~[?:?] {re:classloading} at net.minecraft.block.VineBlock.randomTick(VineBlock.java:221) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState.randomTick(AbstractBlock.java:709) ~[?:?] {re:classloading} at net.minecraft.world.server.ServerWorld.tickEnvironment(ServerWorld.java:504) ~[?:?] {re:classloading} at net.minecraft.world.server.ServerChunkProvider.lambda$tickChunks$5(ServerChunkProvider.java:368) ~[?:?] {re:classloading,pl:accesstransformer:B} at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {} at net.minecraft.world.server.ServerChunkProvider.tickChunks(ServerChunkProvider.java:352) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerChunkProvider.tick(ServerChunkProvider.java:327) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:329) ~[?:?] {re:classloading} at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:886) ~[?:?] {re:classloading,pl:accesstransformer:B} ... 5 more does someone know another way to enable this or is there an error in the code and this is the code of my air class: package net.luis.cave.blocks.caves.moss; import java.util.Random; import net.luis.cave.init.CaveBlocks; import net.minecraft.block.AirBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.material.Material; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.Biomes; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.registries.ForgeRegistries; public class MossAir extends AirBlock { public MossAir() { super(Block.Properties.create(Material.AIR) .noDrops() .tickRandomly()); } // checkPos[] 0 = pos, 1 = pos.up, 2 = pos.down, 3 = pos.north, 4 = pos.east, 5 = pos.south, 6 = pos.west public static void BlockChecker(World world, BlockPos pos, BlockState state, BlockState replace, boolean[] checkPos) { if (checkPos[0] == true) { if (world.getBlockState(pos).getBlock() == replace.getBlock()) { world.setBlockState(pos, state); } } if (checkPos[1] == true) { if (world.getBlockState(pos.up()).getBlock() == replace.getBlock()) { world.setBlockState(pos.up(), state); } } if (checkPos[2] == true) { if (world.getBlockState(pos.down()).getBlock() == replace.getBlock()) { world.setBlockState(pos.down(), state); } } if (checkPos[3] == true) { if (world.getBlockState(pos.north()).getBlock() == replace.getBlock()) { world.setBlockState(pos.north(), state); } } if (checkPos[4] == true) { if (world.getBlockState(pos.east()).getBlock() == replace.getBlock()) { world.setBlockState(pos.east(), state); } } if (checkPos[5] == true) { if (world.getBlockState(pos.south()).getBlock() == replace.getBlock()) { world.setBlockState(pos.south(), state); } } if (checkPos[6] == true) { if (world.getBlockState(pos.west()).getBlock() == replace.getBlock()) { world.setBlockState(pos.west(), state); } } } // bolean[] 0 = Moss Block, 1 = Vine, 2 = Tree, 3 = Clay, 4 = Spore Bloosom // int[] 0 = Moss Block, 1 = Vine, 2 = Tree, 3 = Clay, 4 = Spore Bloosom // double[] 0 = Vine, 1 = Tree private static void genMossCaveBiome(World world, BlockPos pos, boolean[] genMossElements, int[] countMossElements, double[] chanceMossElements) { Random random = new Random(); int[] RanomChance = new int[5]; for (int i = 0; i < 5; i++) { //Check Gen Element true 0 = Moss Block, 1 = Vine, 2 = Tree, 3 = Clay, 4 = Spore Bloosom if (genMossElements[i] == true) { RanomChance[i] = random.nextInt(countMossElements[i]); } //Gen Elements switch (i) { case 0: if (genMossElements[0] == true) { switch (RanomChance[0]) { case 0: BlockChecker(world, pos, CaveBlocks.MOSS_BLOCK.get().getDefaultState(), Blocks.STONE.getDefaultState(), new boolean[] {false, true, true, true, true, true, true}); break; default: break;} }break; case 1: if (genMossElements[1] == true) { switch (RanomChance[1]) { case 0: if (Math.random() >= chanceMossElements[0]) { if (world.getBlockState(pos.up()).getBlock() == Blocks.STONE | world.getBlockState(pos.up()).getBlock() == CaveBlocks.MOSS_BLOCK.get()) { BlockChecker(world, pos, CaveBlocks.MOSS_VINE.get().getDefaultState(), CaveBlocks.MOSS_AIR.get().getDefaultState(), new boolean[] {true, false, false, false, false, false, false}); break; } } default: break;} }break; case 2: if (genMossElements[2] == true) { switch (RanomChance[2]) { case 0: if (Math.random() >= chanceMossElements[1]) { if (world.getBlockState(pos.down()).getBlock() == Blocks.STONE | world.getBlockState(pos.down()).getBlock() == CaveBlocks.MOSS_BLOCK.get()) { BlockChecker(world, pos, CaveBlocks.AZELEA_TREE.get().getDefaultState(), CaveBlocks.MOSS_AIR.get().getDefaultState(), new boolean[] {true, false, false, false, false, false, false}); break; } } default: break;} }break; case 3: if (genMossElements[3] == true) { switch (RanomChance[3]) { case 0: BlockChecker(world, pos, Blocks.CLAY.getDefaultState(), Blocks.STONE.getDefaultState(), new boolean[] {false, false, true, true, true, true, true}); break; default: break;} }break; case 4: if (genMossElements[4] == true) { switch (RanomChance[4]) { case 0: if (world.getBlockState(pos.up()).getBlock() == Blocks.STONE) { BlockChecker(world, pos, CaveBlocks.SPORE_BLOSSOM.get().getDefaultState(), CaveBlocks.MOSS_AIR.get().getDefaultState(), new boolean[] {true, false, false, false, false, false, false}); break; } default: break;} }break; default: break;} } if (world.getBlockState(pos).getBlock() == CaveBlocks.MOSS_AIR.get()) { world.setBlockState(pos, Blocks.CAVE_AIR.getDefaultState(), 3); } } @Override public void tick(BlockState state, ServerWorld world, BlockPos pos, Random rand) { int tick = rand.nextInt(50); switch (tick) { case 0: if (ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.PLAINS.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.SUNFLOWER_PLAINS.getRegistryName()) { genMossCaveBiome(world, pos, new boolean[] {true, true, true, false, false}, new int[] {2, 10, 25, 0, 0}, new double[] {0.4, 0.5}); } else if (ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.JUNGLE.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.JUNGLE_EDGE.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.JUNGLE_HILLS.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.BAMBOO_JUNGLE.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.BAMBOO_JUNGLE_HILLS.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.MODIFIED_JUNGLE.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.MODIFIED_JUNGLE_EDGE.getRegistryName()) { genMossCaveBiome(world, pos, new boolean[] {true, true, true, false, true}, new int[] {2, 10, 20, 0, 10}, new double[] {0.5, 0.6}); } else if (ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.SWAMP.getRegistryName() | ForgeRegistries.BIOMES.getKey(world.getBiome(pos)) == Biomes.SWAMP_HILLS.getRegistryName()) { genMossCaveBiome(world, pos, new boolean[] {true, true, false, true, false}, new int[] {4, 10, 0, 6, 0}, new double[] {0.6, 0.9}); }break; default: break; } } }
-
i just looked into the vanilla glass block class: package net.minecraft.block; public class GlassBlock extends AbstractGlassBlock { public GlassBlock(AbstractBlock.Properties properties) { super(properties); } } and the Abstract Glass Block class: package net.minecraft.block; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; public abstract class AbstractGlassBlock extends BreakableBlock { protected AbstractGlassBlock(AbstractBlock.Properties p_i49999_1_) { super(p_i49999_1_); } public VoxelShape func_230322_a_(BlockState p_230322_1_, IBlockReader p_230322_2_, BlockPos p_230322_3_, ISelectionContext p_230322_4_) { return VoxelShapes.empty(); } @OnlyIn(Dist.CLIENT) public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) { return 1.0F; } public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { return true; } } there are no properties
-
Yes, this is the function but what comes in the brackets i can't set a true or a false inside
-
which of the func_XXXXXX_X_ is .notOpaque()