Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Giga_5's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. I have also been told that implementing a biome through JSON can (and should) be done in some cases. How would you register a JSON biome?
  2. I am still very new to biomes and world generation as a whole, but i thought i'd give it a shot anyways. My game refuses to acknowledge the biome, what did I do wrong? Biome class: import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.world.biome.*; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.carver.ConfiguredCarvers; import net.minecraft.world.gen.feature.Features; import net.minecraft.world.gen.feature.structure.StructureFeatures; import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; public class wastelandBiome { public static Biome wastelandBiomeGen() { BiomeGenerationSettings gen = new BiomeGenerationSettings.Builder() .surfaceBuilder(SurfaceBuilder.DEFAULT.configured(SurfaceBuilder.CONFIG_DESERT)) .addCarver(GenerationStage.Carving.AIR, ConfiguredCarvers.CAVE) .addFeature(GenerationStage.Decoration.LAKES, Features.LAKE_WATER) .addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Features.ORE_COAL) .addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Features.ORE_IRON) .addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Features.ORE_GOLD) .addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Features.ORE_REDSTONE) .addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Features.ORE_DIAMOND) .addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Features.ORE_LAPIS) .addStructureStart(StructureFeatures.MINESHAFT) .addStructureStart(StructureFeatures.STRONGHOLD) .addFeature(GenerationStage.Decoration.LAKES, Features.LAKE_LAVA) .build(); BiomeAmbience ambience = new BiomeAmbience.Builder() .waterColor(0x2e284f) .grassColorOverride(0x665c50) .waterFogColor(0x00d0c17) .fogColor(0x606769) .skyColor(0x3d4142) .build(); MobSpawnInfo mobStuff = new MobSpawnInfo.Builder() .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.SPIDER, 100, 4, 8)) .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.ZOMBIE, 100, 4, 8)) .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.ZOMBIE_VILLAGER, 5, 1, 1)) .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.SKELETON, 100, 4, 8)) .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.CREEPER, 100, 4, 4)) .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.SLIME, 100, 4, 4)) .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.ENDERMAN, 10, 1, 4)) .addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.WITCH, 5, 1, 1)) .build(); return new Biome.Builder() .generationSettings(gen) .specialEffects(ambience) .mobSpawnSettings(mobStuff) .biomeCategory(Biome.Category.PLAINS) .temperatureAdjustment(Biome.TemperatureModifier.NONE) .depth(0.12f) .scale(0.01f) .precipitation(Biome.RainType.RAIN) .temperature(0.5f) .downfall(0.4f) .build(); } } Biome initializer: import mod.giga5.deepmod.holder; import net.minecraft.util.RegistryKey; import net.minecraft.world.biome.Biome; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeManager; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.registries.ForgeRegistries; import java.util.Objects; @Mod.EventBusSubscriber(modid = "deepmod", bus = Mod.EventBusSubscriber.Bus.MOD) public class biomeInit { @SubscribeEvent public static void setupBiomes(FMLCommonSetupEvent event) { event.enqueueWork(() -> setupBiome(holder.WASTELAND_BIOME, BiomeManager.BiomeType.DESERT, 100000, BiomeDictionary.Type.OVERWORLD, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS) ); } private static void setupBiome(Biome biome, BiomeManager.BiomeType type, int weight, BiomeDictionary.Type... types) { RegistryKey<Biome> key = RegistryKey.create( ForgeRegistries.Keys.BIOMES, Objects.requireNonNull(ForgeRegistries.BIOMES.getKey(biome)) ); BiomeDictionary.addTypes(key, types); BiomeManager.addBiome(type, new BiomeManager.BiomeEntry(key, weight)); } } Registerer: import mod.giga5.deepmod.biomes.wastelandBiome; import mod.giga5.deepmod.main; import net.minecraft.world.biome.Biome; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; @Mod.EventBusSubscriber(modid = "deepmod", bus = Mod.EventBusSubscriber.Bus.MOD) public class deferredregister { public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, main.MODID); public static final RegistryObject<Biome> WASTELAND_BIOME = BIOMES.register("wasteland_biome", wastelandBiome::wastelandBiomeGen); public static void register() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); BIOMES.register(modEventBus); } } I am not usually familiar with DeferredRegister, as I usually just use the RegistryEvents. However I was told biomes can be screwed up if done with the standard RegistryEvents, so I went with deferred. thanks!
  3. Hello! I'm new to oregen, and trying to dip my toes in the water so to speak. My oregen currently doesnt work, and none of my ore spawns in the world. I have tried both CountRange and DepthAverage for the configuration, neither have worked. here is my class to set oregen: public class GenerateCStone { public static void generateCStone() { for(Biome biome : ForgeRegistries.BIOMES) { ConfiguredPlacement<DepthAverageConfig> genPlacementConfig = Placement.COUNT_DEPTH_AVERAGE.configure(new DepthAverageConfig(200, 40, 60)); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE .withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Storage.CSTONE.getDefaultState(), 7)) .withPlacement(genPlacementConfig)); } } } and here's the registerer to register the generator to the game: @Mod.EventBusSubscriber(modid = Main.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class UtilRegister { @SubscribeEvent void setup(FMLCommonSetupEvent e) { DeferredWorkQueue.runLater(GenerateCStone::generateCStone); } } Any help would be appreciated!
  4. is this a mappings related issue?
  5. 20200723-1.16.1, the latest one according to the forge discord bot
  6. I am making a custom armor material for my armor but it seems to break no matter what i do. If I enter func_230304f() as a class method, it complains about the lack of getKnockbackResistence(), and vice versa. The error message is also confusing, saying ABTier is not abstract and does not override abstract method getKnockbackResistance() in IArmorMaterial To my knowledge, IArmorMaterial has no method called getKnockbackResistence(). If I include both, It throws a ClassFormatError for duplicate methods on startup. What should I do? Here is the code for my armor item tier: public enum ABTier implements IArmorMaterial { BOMBSHIRT("bombshirt", 80, new int[] {2, 2, 2, 2}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F, 0.5F, null); private static final int[] MAX_DAMAGE_ARRAY = new int[]{9, 10, 12, 13}; private final String name; private final int maxDamageFactor; private final int[] damageReductionAmountArray; private final int enchantability; private final SoundEvent soundEvent; private final float toughness; private final float knockbackResistance; private final Lazy<Ingredient> repairMaterialLazy; private ABTier(String nameIn, int maxDamageFactorIn, int[] damageReductionAmountArrayIn, int enchantabilityIn, SoundEvent soundEventIn, float toughnessIn, float knockbackResistanceIn, Supplier<Ingredient> repairMaterialSupplier) { this.name = Main.MODID + ":" + nameIn; this.maxDamageFactor = maxDamageFactorIn; this.damageReductionAmountArray = damageReductionAmountArrayIn; this.enchantability = enchantabilityIn; this.soundEvent = soundEventIn; this.toughness = toughnessIn; this.knockbackResistance = knockbackResistanceIn; this.repairMaterialLazy = Lazy.concurrentOf(repairMaterialSupplier); } @Override public int getDurability(EquipmentSlotType slotIn) { return this.maxDamageFactor; } @Override public int getDamageReductionAmount(EquipmentSlotType slotIn) { return this.damageReductionAmountArray[slotIn.getIndex()]; } @Override public int getEnchantability() { return this.enchantability; } @Override public SoundEvent getSoundEvent() { return this.soundEvent; } @Override public Ingredient getRepairMaterial() { return this.repairMaterialLazy.get(); } @OnlyIn(Dist.CLIENT) public String getName() { return this.name; } @Override public float getToughness() { return this.toughness; } public float func_230304_f_() { return this.knockbackResistance; } public float getKnockbackResistance() { return this.knockbackResistance; } }
  7. Are there any ways to change a player’s vision, similar to how nightvision/nausea/blindness changes vision? Or are they hard coded? I wanted to create a “sun scorched” effect that increases exposure on a player’s screen, making it extremely bright. Would this be possible?
  8. Hello! Novice modder here. I am creating an item that spawns a creeper at the player's location upon player death. It works fine, however I am trying to make it so that the KPS ItemStack is shrank (shrunk?) by 1 each time the player dies, as if the items are being "consumed" by spawning a creeper. How would I go about doing this? Here is my current code: public class KPSEvent { @SubscribeEvent public void onDie(LivingDeathEvent e) { LivingEntity k = e.getEntityLiving(); ItemStack sl = new ItemStack(Holder.KPS); CreeperEntity c = new CreeperEntity(EntityType.CREEPER, k.getEntityWorld()); if(e.getEntity() instanceof PlayerEntity) { if(((PlayerEntity) e.getEntity()).inventory.hasItemStack(sl)) { ((PlayerEntity) e.getEntity()).inventory.deleteStack(sl); c.setPosition(k.getPosX(), k.getPosY()+1, k.getPosZ()); k.getEntityWorld().addEntity(c); } } } }
  9. Hello! Sorry if this is a duplicate post, but I couldn't seem to find any other sources. How do you get a player's spawn point? I want to create a food item that will teleport the player to their spawnpoint upon eating it, however I have hit a roadblock when it comes to actually retrieving a player's spawnpoint. Any help would be appreciated!
  10. Ahh it worked! thank you for the help. I plan on adding different "types" of enderdust soon to teleport different lengths, I just havent done the NBT stuff yet
  11. Hello! RayTracing is still a very new concept to me so this code may be very bad. I am making a mod that adds an enchantment that is supposed to teleport the player where the are looking when holding a certain item, enderdust. Currently it works, however the teleportation is very janky. I get teleported backards, side to side, into blocks, and almost never directly where I am looking. Any help would be appreciated. Code for the teleportation event: public class TeleBootEvent { @SubscribeEvent public void teleBoot(PlayerInteractEvent.RightClickItem event) { PlayerEntity player = event.getPlayer(); Vector3d eyePos = player.getEyePosition(1.0F); BlockRayTraceResult result = player.getEntityWorld().rayTraceBlocks(new RayTraceContext(eyePos, player.getLookVec(), RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.NONE, player)); double x = result.getPos().getX(); double y = result.getPos().getY(); double z = result.getPos().getZ(); ItemStack armor = player.getItemStackFromSlot(EquipmentSlotType.FEET); ItemStack enderdust = new ItemStack(ObjectHolderStorage.ENDERDUST); if (EnchantmentHelper.getEnchantmentLevel(ObjectHolderStorage.TELEBLINK, armor) > 0) { if (result.getType() == RayTraceResult.Type.BLOCK) { if (player.getHeldItemMainhand().isItemEqual(enderdust)) { player.setPosition(x, y + 0.5, z); } } } } }
  12. World#rayTraceBlocks doesn't seem to still be a thing in 1.16.
  13. Hello! This may be a noobish question, but i'm trying to get a better understanding of forge functions. How does one properly implement a raytrace? Say, for instance, I wanted to get the coordinates of a block a player is looking at, outside of the normal "reach" range. How would I go about doing this? Any help would be appriciated
  14. do I do this just by registering the bow-based item with the namespace "minecraft:bow"?
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.