Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Luis_ST

Members
  • Joined

  • Last visited

Everything posted by Luis_ST

  1. I alredy do this : private void doClientStuff(FMLClientSetupEvent event) { RenderTypeLookup.setRenderLayer(CaveBlocks.TINTED_GLASS.get(), RenderType.getTranslucent()); }
  2. i get this code for the glass class but it dosent work package net.luis.cave.blocks; import net.minecraft.block.AbstractBlock; import net.minecraft.block.AbstractGlassBlock; import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.material.PushReaction; 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; public class TintedGlass extends AbstractGlassBlock { public TintedGlass() { super(AbstractBlock.Properties.create(Material.GLASS) .zeroHardnessAndResistance() .sound(SoundType.GLASS) .harvestLevel(0)); } @Override public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { return true; } @Override public boolean isTransparent(BlockState state) { return true; } @Override public PushReaction getPushReaction(BlockState state) { return PushReaction.DESTROY; } @Override public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) { return 1.0f; } @Override public VoxelShape func_230322_a_(BlockState p_230322_1_, IBlockReader p_230322_2_, BlockPos p_230322_3_, ISelectionContext p_230322_4_) { return VoxelShapes.empty(); } }
  3. I want to creat the Tinted Glass Block for the new Minecraft Snapshot but i can look through the block into the "world"/void This is the code: package net.luis.cave.blocks; import net.minecraft.block.AbstractBlock; import net.minecraft.block.AbstractGlassBlock; import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.material.PushReaction; import net.minecraftforge.common.ToolType; public class TintedGlass extends AbstractGlassBlock { public TintedGlass() { super(AbstractBlock.Properties.create(Material.GLASS) .zeroHardnessAndResistance() .sound(SoundType.GLASS) .harvestLevel(0) .harvestTool(ToolType.PICKAXE)); } @Override public boolean isTransparent(BlockState state) { return true; } @Override public PushReaction getPushReaction(BlockState state) { return PushReaction.DESTROY; } }
  4. I got this from a friend, but there are func_ and field_ and I don't know the actual names of the functions is there a way to get the current names package net.luis.cave.render; import net.minecraftforge.api.distmarker.*; import net.minecraft.util.*; import com.mojang.blaze3d.matrix.*; import net.minecraft.util.math.vector.*; import net.luis.cave.models.EnderiteShieldModel; import net.minecraft.client.renderer.*; import net.minecraft.client.renderer.texture.*; import net.minecraft.client.renderer.model.*; import net.minecraft.client.renderer.tileentity.*; import java.util.*; import com.mojang.blaze3d.vertex.*; import com.mojang.datafixers.util.*; import net.minecraft.tileentity.*; import net.minecraft.item.*; import org.apache.logging.log4j.*; public class EnderiteShieldRender extends ItemStackTileEntityRenderer { private final EnderiteShieldModel shieldModel; public EnderiteShieldRender() { this.shieldModel = new EnderiteShieldModel(); } public void func_239207_a_(final ItemStack stack, final ItemCameraTransforms.TransformType transformType, final MatrixStack matrices, final IRenderTypeBuffer bufferIn, final int light, final int overlay) { matrices.func_227860_a_(); matrices.func_227863_a_(Vector3f.field_229179_b_.func_229187_a_(180.0f)); final RenderMaterial spriteIdentifier = new RenderMaterial(AtlasTexture.field_110575_b, new ResourceLocation("cave:entity/enderite_shield")); final IVertexBuilder vertexConsumer3 = spriteIdentifier.getTextureLocation().func_229230_a_(ItemRenderer.func_239391_c_(bufferIn, this.shieldModel.func_228282_a_(ModelBakery.field_229317_h_.func_229310_a_()), true, stack.func_77962_s())); this.shieldModel.func_228294_b_().func_228309_a_(matrices, vertexConsumer3, light, overlay, 1.0f, 1.0f, 1.0f, 1.0f); final List<Pair<BannerPattern, DyeColor>> list = (List<Pair<BannerPattern, DyeColor>>)BannerTileEntity.func_230138_a_(ShieldItem.getColor(stack), BannerTileEntity.func_230139_a_(stack)); BannerTileEntityRenderer.func_241717_a_(matrices, bufferIn, light, overlay, this.shieldModel.func_228293_a_(), spriteIdentifier, false, (List)list, stack.func_77962_s()); matrices.func_227865_b_(); } }
  5. the shield should be like the minecraft shield and is the model class corect package net.luis.cave.models; import net.minecraft.client.renderer.entity.model.*; import net.minecraft.block.*; import net.minecraft.util.*; import java.util.*; import net.minecraft.client.renderer.texture.*; import net.minecraft.client.renderer.model.*; 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 isBuiltInRenderer() { return false; } @Override public TextureAtlasSprite getParticleTexture() { return null; } @Override public ItemOverrideList getOverrides() { return null; } @Override public boolean func_230044_c_() { return false; } }
  6. i add a shield to my mod it works but i haven't a model and a texture 1. where can I set the model for the shield 2. in which folder do I have to put the texture this is my shield class: package net.luis.cave.items; import net.luis.cave.Cave; import net.minecraft.entity.LivingEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ShieldItem; public class EnderiteShield extends ShieldItem { public EnderiteShield(Properties properties) { super(new Item.Properties().group(Cave.WEAPONS) .maxDamage(865)); } @Override public boolean isShield(ItemStack stack, LivingEntity entity) { return true; } } and this is the register class public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Cave.Mod_Id); public static final RegistryObject<ShieldItem> ENDERITE_SHIELD = ITEMS.register("enderite_shield", () -> new EnderiteShield(new Item.Properties().group(Cave.WEAPONS)));
  7. it works but i have to set the multiplier higher because otherwise it has no effect
  8. I have creat an Enchantment for Pickaxe called Experiece when a pickaxe has the enchantment the block wich the player destroy should drop more xp but it don't work can somebody help me her is the code: if (event.getExpToDrop() > 0) { int xp = event.getExpToDrop(); if (EnchantmentHelper.getEnchantmentLevel(CaveEnchantment.EXPERIENCE.get(), player.getHeldItemMainhand()) == 1) { event.setExpToDrop(xp*2); } else if (EnchantmentHelper.getEnchantmentLevel(CaveEnchantment.EXPERIENCE.get(), player.getHeldItemMainhand()) == 2) { event.setExpToDrop(xp*3); } else if (EnchantmentHelper.getEnchantmentLevel(CaveEnchantment.EXPERIENCE.get(), player.getHeldItemMainhand()) == 3) { event.setExpToDrop(xp*4); } }
  9. okay thanks I have to test something but it works
  10. I want to creat a Block with the cross model but my block locks like this: (picture)
  11. Okay thanks for helping
  12. Yes i know but where is negativ number
  13. this is the code where i think weher is the error package net.luis.cave.world.gen; import net.luis.cave.Cave; import net.luis.cave.init.CaveBlocks; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.pattern.BlockMatcher; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.placement.ConfiguredPlacement; import net.minecraft.world.gen.placement.CountRangeConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.registries.ForgeRegistries; @Mod.EventBusSubscriber(modid = Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.MOD) public class OreGen { @SubscribeEvent public static void generateOres(FMLLoadCompleteEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { if (biome.getCategory() == Biome.Category.THEEND) { genOre(biome, 1, 12, 256, 10, OreFeatureConfig.FillerBlockType.create("ENDSTONE", "end_stone", new BlockMatcher(Blocks.END_STONE)), CaveBlocks.ENDERITE_ORE.get().getDefaultState(), 3); } else if (biome.getCategory() == Biome.Category.NETHER) { } else { genOre(biome, 15, 8, 50, 5, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.JADE_ORE.get().getDefaultState(), 6); genOre(biome, 7, 1, 25, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.LIMONITE_ORE.get().getDefaultState(), 10); genOre(biome, 2, 1, 65, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.ROSITE_ORE.get().getDefaultState(), 1); genOre(biome, 5, 4, 9, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.SAPHIRE_ORE.get().getDefaultState(), 2); } } } private static void genOre(Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) { CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max); OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size); ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config)); } }
  14. i had creat an mod in 1.16.1 and when i creat a new world i get the following stactrace: java.util.concurrent.CompletionException: net.minecraft.crash.ReportedException: Feature placement at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) ~[?:?] {} at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) ~[?:?] {} at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1155) ~[?:?] {} at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?] {} at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$func_219069_a$1(ChunkTaskPriorityQueueSorter.java:44) ~[?:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:95) ~[?:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:139) ~[?:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:107) ~[?:?] {re:classloading} at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1429) ~[?:?] {} 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) ~[?:?] {} Caused by: net.minecraft.crash.ReportedException: Feature placement at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$18(ChunkManager.java:558) ~[?:?] {re:classloading} at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-3.0.25.jar:?] {re:classloading} at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$20(ChunkManager.java:545) ~[?:?] {re:classloading} at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?] {} ... 11 more Caused by: java.lang.IllegalArgumentException: bound must be positive at java.util.Random.nextInt(Random.java:388) ~[?:?] {} at net.minecraft.world.gen.placement.CountRange.lambda$getPositions$0(CountRange.java:18) ~[?:?] {re:classloading} at java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180) ~[?:?] {} at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104) ~[?:?] {} at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:699) ~[?:?] {} at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?] {} at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?] {} at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?] {} at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {} at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) ~[?:?] {} at net.minecraft.world.gen.placement.Placement.func_236963_a_(Placement.java:80) ~[?:?] {re:classloading} at net.minecraft.world.gen.placement.ConfiguredPlacement.func_236953_a_(ConfiguredPlacement.java:27) ~[?:?] {re:classloading} at net.minecraft.world.gen.feature.DecoratedFeature.func_230362_a_(DecoratedFeature.java:17) ~[?:?] {re:classloading} at net.minecraft.world.gen.feature.DecoratedFeature.func_230362_a_(DecoratedFeature.java:11) ~[?:?] {re:classloading} at net.minecraft.world.gen.feature.ConfiguredFeature.func_236265_a_(ConfiguredFeature.java:38) ~[?:?] {re:classloading} at net.minecraft.world.biome.Biome.func_235061_a_(Biome.java:409) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.gen.ChunkGenerator.func_230351_a_(ChunkGenerator.java:186) ~[?:?] {re:classloading} at net.minecraft.world.chunk.ChunkStatus.lambda$static$9(ChunkStatus.java:77) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.chunk.ChunkStatus.doGenerationWork(ChunkStatus.java:198) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$18(ChunkManager.java:547) ~[?:?] {re:classloading} at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-3.0.25.jar:?] {re:classloading} at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$20(ChunkManager.java:545) ~[?:?] {re:classloading} at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?] {} ... 11 more
  15. how do i use the BiomeLoadingEvent (for ore gen)?
  16. I fixed it there are no more problems Thanks for helping
  17. 1. What is meant by slots? can you give me an code example? 2. When I remove "EquipmentSlotType[]" slots in the constructor Eclipse shows an error: The constructor Enchantment(Enchantment.Rarity, EnchantmentType) is undefined 3. I set it to public
  18. no I forgot it thanks for helping
  19. okay it already set the mod id to minecraft because when i use my mod id (cave) i creat a new item but i want to replace a vanilla item(suger)
  20. This is the code of the item (sugar): package net.luis.cave.items.vanilla; import net.minecraft.item.Food; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; public class Sugar extends Item { public Sugar() { super(new Item.Properties() .group(ItemGroup.FOOD) .food(new Food.Builder() .hunger(2) .saturation(1.0f) .effect(new EffectInstance(Effects.SPEED, 300, 3), 1) .setAlwaysEdible() .build())); setRegistryName("minecraft", "sugar"); } } and this is the code of the Registry: package net.luis.cave.init; import net.luis.cave.Cave; import net.luis.cave.items.BaseItem; import net.luis.cave.items.RubyApple; import net.luis.cave.items.vanilla.Sugar; import net.minecraft.item.Item; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class CaveItems { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Cave.Mod_Id); public static final DeferredRegister<Item> VANILLA_ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "minecraft"); //Item public static final RegistryObject<Item> RUBY = ITEMS.register("ruby", BaseItem::new); public static final RegistryObject<Item> ENDERITE_SCRAP = ITEMS.register("enderite_scrap", BaseItem::new); public static final RegistryObject<Item> ENDERITE_INGOT = ITEMS.register("enderite_ingot", BaseItem::new); public static final RegistryObject<RubyApple> RUBY_APPLE = ITEMS.register("ruby_apple", RubyApple::new); public static final RegistryObject<Item> SUGAR = VANILLA_ITEMS.register("sugar", Sugar::new); }
  21. yes: package net.luis.cave.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentType; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.AxeItem; import net.minecraft.item.HoeItem; import net.minecraft.item.ItemStack; import net.minecraft.item.PickaxeItem; import net.minecraft.item.ShovelItem; public class DoubleDrops extends Enchantment { protected DoubleDrops(Rarity rarityIn, EnchantmentType typeIn, EquipmentSlotType[] slots) { super(Enchantment.Rarity.VERY_RARE, EnchantmentType.DIGGER, slots); } @Override public int getMinLevel() { return 1; } @Override public int getMaxLevel() { return 1; } @Override public boolean isTreasureEnchantment() { return false; } @Override public boolean isCurse() { return false; } @Override public boolean isAllowedOnBooks() { return true; } @Override public boolean canApplyAtEnchantingTable(ItemStack stack) { if (stack.getItem() instanceof PickaxeItem ) return true; if (stack.getItem() instanceof AxeItem ) return true; if (stack.getItem() instanceof ShovelItem ) return true; if (stack.getItem() instanceof HoeItem ) return true; return false; } } The Register class: package net.luis.cave.init; import net.luis.cave.Cave; import net.luis.cave.enchantment.DoubleDrops; import net.luis.cave.items.BaseItem; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.Item; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class CaveEnchantment { public static final DeferredRegister<Enchantment> ENCHANTMENT = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, Cave.Mod_Id); public static final RegistryObject<Enchantment> DOUBLE_DROPS = ENCHANTMENT.register("double_drops", DoubleDrops::new); } and the Eclipse Error:
  22. Yes I add this to my main class but not for Items (for Enchantments) and Eclipse say there is an Error at .register("name", class:new)
  23. I want to register an Enchantment public static final DeferredRegister<Enchantment> ENCHANTMENT = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, Cave.Mod_Id); public static final RegistryObject<Enchantment> DOUBLE_DROP = ENCHANTMENT.register("double_drops", DoubleDrops::new); But this way dosent work
  24. public static final DeferredRegister<Item> VANILLA_ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "minecraft"); public static final RegistryObject<Sugar> SUGAR = VANILLA_ITEMS.register("sugar", Sugar::new); It doesent work with the minecraft id
  25. okay i creat the item class : package net.luis.cave.items.vanilla; import net.minecraft.item.Food; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; public class Sugar extends Item { public Sugar() { super(new Item.Properties() .group(ItemGroup.FOOD) .food(new Food.Builder() .hunger(2) .saturation(1.0f) .effect(new EffectInstance(Effects.SPEED, 300, 3), 1) .setAlwaysEdible() .build())); } } and I register the item with the same vanilla name but it dosen't work and I don't know where is the error : public static final RegistryObject<Sugar> SUGAR = ITEMS.register("sugar", Sugar::new);

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.