Jump to content

GenElectrovise

Members
  • Posts

    132
  • Joined

  • Last visited

Posts posted by GenElectrovise

  1. 19 hours ago, ken2020 said:

    Ok I did this:

    {
        "replace": false,
        "values": [
            "minecraft:oak_door",
            "minecraft:spruce_door",
            "minecraft:birch_door",
            "minecraft:jungle_door",
            "minecraft:acacia_door",
            "minecraft:dark_oak_door",
            "minecraft:crimson_door",
            "minecraft:warped_door",
            "kenmod:oak_cabin_door"
        ]
    }

    
    {
    	"replace": false,
    	"values": [
    		"minecraft:oak_door",
    		"minecraft:spruce_door",
    		"minecraft:birch_door",
    		"minecraft:jungle_door",
    		"minecraft:acacia_door",
    		"minecraft:dark_oak_door",
    		"minecraft:crimson_door",
    		"minecraft:warped_door",
    		"kenmod:oak_cabin_door"
    	]
    }

    But they still don't open the door.

    Where did you put this?

  2. Look at how entities in general are moved. The player is just an entity.

    Entities have velocity variables in them, which you can use to move them.

    Look through some entity AI goals, and in entity navigators to see these in actions.

    The Minecraft class has a reference to the client player, however you may need to send a packet to the server (or something similar) in order for the server to get the memo.

  3. I am trying to add my OvergroundShrineFeature to different Biomes. For reference, I have been using the RuinedPortalStructure and its various dependants (i.e. RuinedPortalFeature and its configurations) for reference.

     

    I am able to register the Structure, and I am able to register its StructureFeatures.

     

    When I use a /locate magiksmostevile:overground_shrine command in game (which it suggests to autocomplete), I get the message "The structure could not be found", as if it were simply very far away, however as I move around, I receive a lot of errors saying that there is either a error reading or writing NBT data. I tracked the error back to writing the References tag (something is null but I can't tell what), but it doesn't always fail there. I can't view some of the variables in debug mode on my IDE, so I can't see exactly what is being written when an exception is thrown...

     

    To me, this suggests that I have taken something from the vanilla code that I should not have done, and that there is a better, more "Forge-y", way to handle this.

    How should I be managing structure generation?

     

    Thanks!

     

    Edit: I should add that my Structure.Start class is never called, nor is any other part of the building process: I know because I put breakpoints on them all and nothing is triggered after the structure is added to biomes. Perhaps these NBT errors occur when the game tries to load my structure from NBT, it fails, and terminates the building?

     

    ====

     

    Active GitHub branch: https://github.com/GenElectrovise/MagiksMostEvile/tree/feature/1.16.4/reinstate_shrines

    World-Gen package: https://github.com/GenElectrovise/MagiksMostEvile/tree/feature/1.16.4/reinstate_shrines/src/main/java/genelectrovise/magiksmostevile/common/world/gen

    DeferredRegistry: https://github.com/GenElectrovise/MagiksMostEvile/blob/feature/1.16.4/reinstate_shrines/src/main/java/genelectrovise/magiksmostevile/common/core/registry/EvileDeferredRegistry.java

     

    ====

     

    Register Structure:

    public static final DeferredRegister<Structure<?>> STRUCTURES =
        DeferredRegister.create(ForgeRegistries.STRUCTURE_FEATURES, MagiksMostEvile.MODID);
    
    public static final RegistryObject<Structure<OvergroundShrineFeatureConfig>> OVERGROUND_SHRINE =
        STRUCTURES.register("overground_shrine", () -> new OvergroundShrineStructure());

     

    Register StructureFeatures:

    // Called in FMLCommonSetupEvent
    
    // Register a different one for each EnumFeatureLocation so that it is generated differently in each case
    
    // Default
    OVERGROUND_SHRINE_DEFAULT = StructureAspectRegistrationManager.registerStructureFeature(
        MagiksMostEvile.MODID + ":overground_shrine/default",
        EvileDeferredRegistry.OVERGROUND_SHRINE.get()
            .withConfiguration(new OvergroundShrineFeatureConfig(EnumFeatureLocation.DEFAULT)));

     

    Error message (loading NBT only):

    [28Dec2020 13:15:51.534] [Server thread/ERROR] [net.minecraft.world.server.ChunkManager/]: Couldn't load chunk [-22, 9]
    java.util.concurrent.CompletionException: net.minecraft.crash.ReportedException: Loading NBT data
    	at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:375) ~[?:1.8.0_241]
    	at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1947) ~[?:1.8.0_241]
    	at net.minecraft.world.chunk.storage.IOWorker.func_227090_a_(IOWorker.java:64) ~[forge:?]
    	at net.minecraft.world.chunk.storage.ChunkLoader.readChunk(ChunkLoader.java:57) ~[forge:?]
    	at net.minecraft.world.server.ChunkManager.loadChunkData(ChunkManager.java:831) ~[forge:?]
    	at net.minecraft.world.server.ChunkManager.lambda$chunkLoad$14(ChunkManager.java:493) ~[forge:?]
    	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604) ~[?:1.8.0_241]
    	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge:?]
    	at net.minecraft.world.server.ServerChunkProvider$ChunkExecutor.run(ServerChunkProvider.java:512) ~[forge:?]
    	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge:?]
    	at net.minecraft.world.server.ServerChunkProvider$ChunkExecutor.driveOne(ServerChunkProvider.java:520) ~[forge:?]
    	at net.minecraft.world.server.ServerChunkProvider.driveOneTask(ServerChunkProvider.java:270) ~[forge:?]
    	at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:746) ~[forge:?]
    	at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:735) ~[forge:?]
    	at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[forge:?]
    	at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:720) ~[forge:?]
    	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:667) ~[forge:?]
    	at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?]
    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_241]
    Caused by: net.minecraft.crash.ReportedException: Loading NBT data
    	at net.minecraft.nbt.CompoundNBT.loadNBT(CompoundNBT.java:526) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.access$200(CompoundNBT.java:31) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:53) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:40) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.loadNBT(CompoundNBT.java:520) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.access$200(CompoundNBT.java:31) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:53) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:40) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.loadNBT(CompoundNBT.java:520) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.access$200(CompoundNBT.java:31) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:53) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:40) ~[forge:?]
    	at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:129) ~[forge:?]
    	at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:99) ~[forge:?]
    	at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:92) ~[forge:?]
    	at net.minecraft.world.chunk.storage.RegionFileCache.readChunk(RegionFileCache.java:51) ~[forge:?]
    	at net.minecraft.world.chunk.storage.IOWorker.lambda$func_227090_a_$2(IOWorker.java:54) ~[forge:?]
    	at net.minecraft.world.chunk.storage.IOWorker.lambda$null$8(IOWorker.java:99) ~[forge:?]
    	at net.minecraft.util.concurrent.ITaskQueue$RunnableWithPriority.run(ITaskQueue.java:61) ~[forge:?]
    	at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:88) ~[forge:?]
    	at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:132) ~[forge:?]
    	at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:100) ~[forge:?]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_241]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_241]
    	... 1 more
    Caused by: java.io.EOFException
    	at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:340) ~[?:1.8.0_241]
    	at java.io.DataInputStream.readUTF(DataInputStream.java:589) ~[?:1.8.0_241]
    	at java.io.DataInputStream.readUTF(DataInputStream.java:564) ~[?:1.8.0_241]
    	at net.minecraft.nbt.CompoundNBT.readKey(CompoundNBT.java:515) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.access$100(CompoundNBT.java:31) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:50) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:40) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.loadNBT(CompoundNBT.java:520) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.access$200(CompoundNBT.java:31) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:53) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:40) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.loadNBT(CompoundNBT.java:520) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.access$200(CompoundNBT.java:31) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:53) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:40) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.loadNBT(CompoundNBT.java:520) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT.access$200(CompoundNBT.java:31) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:53) ~[forge:?]
    	at net.minecraft.nbt.CompoundNBT$1.readNBT(CompoundNBT.java:40) ~[forge:?]
    	at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:129) ~[forge:?]
    	at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:99) ~[forge:?]
    	at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:92) ~[forge:?]
    	at net.minecraft.world.chunk.storage.RegionFileCache.readChunk(RegionFileCache.java:51) ~[forge:?]
    	at net.minecraft.world.chunk.storage.IOWorker.lambda$func_227090_a_$2(IOWorker.java:54) ~[forge:?]
    	at net.minecraft.world.chunk.storage.IOWorker.lambda$null$8(IOWorker.java:99) ~[forge:?]
    	at net.minecraft.util.concurrent.ITaskQueue$RunnableWithPriority.run(ITaskQueue.java:61) ~[forge:?]
    	at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:88) ~[forge:?]
    	at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:132) ~[forge:?]
    	at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:100) ~[forge:?]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_241]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_241]
    	... 1 more

     

     

  4. On 12/27/2020 at 3:08 AM, kiou.23 said:

    BiomeGenerationSettingsBuilder#withFeature() returns a new Builder with the passed in feature, it doesn't add the feature to the biomes generation. what you want to call is BiomeGenerationSettingsBuilder#getFeatures().add()

    you'll pass the generation stage you want your features to be generated in (Decoration.UNDERGROUND_ORES), and you pass a supplier of your feature to the add() method

    Hmmm... strange. It seems to be working for me right now? By my researching withFeature(feature) both returns the builder, and adds the feature. I'll try changing that and see how that works.

  5. I've resolved the error:
    It was resulting from a NullPointerException while I was adding my features to biomes, which was concealed behind a resulting exception which was traced back to the mouseClickEventHandler which was triggered when I loaded the world.

    I was adding my features to a static ConfiguredFeature<?,?> [ ], before they were actually loaded, with the expectation that the array references would be updated as well, but I guess concurrency decided that wouldn't happen. Now the final call of my event handler populates the arrays and everything works fine.

     

    My new code is:

    OreFeaures.java

      
    
      public static ConfiguredFeature<?, ?>[] OVERWORLD_ORES;
      public static ConfiguredFeature<?, ?>[] NETHER_ORES;
      public static ConfiguredFeature<?, ?>[] END_ORES;
    
    @SubscribeEvent //Subbed to MOD
      public static void createConfiguredOreFeatures(FMLCommonSetupEvent event) {
        MagiksMostEvile.LOGGER.debug("Creating MME configured ore features");
    
        // Amethyst Ore Overworld
        AMETHYST_ORE_OVERWORLD = Registry.register( //
            WorldGenRegistries.CONFIGURED_FEATURE, //
            "amethyst_ore_overworld_generation", //
            Feature.ORE.withConfiguration( //
                new OreFeatureConfig( //
                    new TagMatchRuleTest(ModdedTags.AMETHYST_ORE_SPAWNABLE), //
                    EvileDeferredRegistry.AMETHYST_ORE_OVERWORLD.get().getDefaultState(), //
                    7)) //
                .withPlacement(Placement.DEPTH_AVERAGE.configure( //
                    new DepthAverageConfig(32, 32))) //
                .range(16)); //
    
        applyToLists();
      }
    
    private static void applyToLists() {
        OVERWORLD_ORES = new ConfiguredFeature<?, ?>[] {AMETHYST_ORE_OVERWORLD, LEAD_ORE_OVERWORLD};
        NETHER_ORES = new ConfiguredFeature<?, ?>[] {AMETHYST_ORE_NETHER, LEAD_ORE_NETHER};
        END_ORES = new ConfiguredFeature<?, ?>[] {AMETHYST_ORE_END, LEAD_ORE_END};
      }

     

    OreFeatureAdditionManager.java

      /**
       * Apply {@value #overworldOres()}, {@value #netherOres} and {@value #endOres} to {@link Biome}s
       * of their various {@link Biome.Category}.
       * 
       * @param event
       */
      @SubscribeEvent(priority = EventPriority.HIGH) //Subbed to FORGE
      public static void registerOres(final BiomeLoadingEvent event) {
        MagiksMostEvile.LOGGER.debug("Adding MME ores to biome: " + event.getName());
    
        BiomeGenerationSettingsBuilder generation = event.getGeneration();
    
        switch (event.getCategory()) {
          case NETHER:
            for (ConfiguredFeature<?, ?> simpleConfiguredOreFeature : OreFeatures.NETHER_ORES) {
              registerTo(generation, simpleConfiguredOreFeature);
            }
            break;
    
          case THEEND:
            for (ConfiguredFeature<?, ?> simpleConfiguredOreFeature : OreFeatures.END_ORES) {
              registerTo(generation, simpleConfiguredOreFeature);
            }
            break;
    
          default:
            for (ConfiguredFeature<?, ?> simpleConfiguredOreFeature : OreFeatures.OVERWORLD_ORES) {
              registerTo(generation, simpleConfiguredOreFeature);
            }
            break;
        }
    
      }
    
      /**
       * Convenience method to tidy up {@link #registerOres(BiomeLoadingEvent)} by abstracting away
       * {@link BiomeGenerationSettingsBuilder} calls.
       * 
       * @param builder
       * @param feature
       */
      private static void registerTo(BiomeGenerationSettingsBuilder builder,
          ConfiguredFeature<?, ?> feature) {
        
        builder.withFeature(GenerationStage.Decoration.UNDERGROUND_ORES, feature);
      }

     

  6. I haven't tried this but given that there are no other responses, I would start in a few places:

     

    ForgeRegistries.DIMENSIONS provides registration for dimensions through DeferredRegister.

    Search for the classes World and DimensionType - how does vanilla do it?

     

    Code to change dimension (i.e. through a portal) is:

    /**
       * Convenience method to change the dimension of the given entity.
       * 
       * @param entityIn
       * @param worldIn
       */
      private void changeDimension(Entity entityIn, World worldIn, RegistryKey<World> registryKey) {
    
        // Get the world of that key
        ServerWorld serverworld = ((ServerWorld) worldIn).getServer().getWorld(registryKey);
    
        // Change
        if (serverworld == null) {
          return;
        }
    
        entityIn.changeDimension(serverworld, new NoPortalTeleporter(serverworld));
      }

    ... so World is evidently important.

     

    I'd also look into that RegistryKey business.

     

    Afraid I don't have a lot of other advice :(

  7. Thanks @Beethoven92:

     

    I tried only using @Mod.EventBusSubscriber(modid = MagiksMostEvile.MODID, bus = Bus.FORGE), and combining the two methods into one call:

    /**
       * Called on {@link Bus.Forge}. Trigger ore registration.
       * 
       * @param event
       */
      @SubscribeEvent(priority = EventPriority.HIGH)
      public static void addOresToBiomes(final BiomeLoadingEvent event) {
        MagiksMostEvile.LOGGER.debug("Adding MME ores: Biome=" + event.getName());
        createOreLists();
    
    
        registerOres(event);
      }
    
      /**
       * Form the lists of ores to register
       * 
       * @param event
       */
      public static void createOreLists() {
        MagiksMostEvile.LOGGER.debug("Creating ore lists for MME feature addition!");
        overworldOres();
        netherOres();
        endOres();
      }

    (Result: Auto-subscribing genelectrovise.magiksmostevile.common.world.gen.ore.OreFeatureRegistry to FORGE)

     

    Two things:

    1) This doesn't seem like the right way to handle this, though? Registering the features should not be done every time a biome is loaded - that seems wrong to me.

    2) Whenever I try to join a world with that code active, I get this very odd error:

     

    
    [12:11:46] [Server thread/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Handshake complete!
    [12:11:46] [Netty Local Client IO #0/INFO] [ne.mi.fm.ne.NetworkHooks/]: Connected to a modded server.
    [12:11:46] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.advancements.PlayerAdvancements@55ab5742
    [12:11:46] [Server thread/INFO] [minecraft/PlayerList]: Dev[local:E:26a17569] logged in with entity id 257 at (-20.12474734205128, 72.0, 90.2353098908319)
    [12:11:46] [Server thread/INFO] [minecraft/MinecraftServer]: Dev joined the game
    [12:11:46] [Server thread/INFO] [minecraft/ServerPlayNetHandler]: Dev lost connection: Internal Exception: java.lang.ClassCastException: net.minecraft.network.login.ServerLoginNetHandler cannot be cast to net.minecraft.client.network.play.IClientPlayNetHandler
    [12:11:46] [Server thread/INFO] [minecraft/MinecraftServer]: Dev left the game
    [12:11:46] [Server thread/INFO] [minecraft/ServerPlayNetHandler]: Stopping singleplayer server as player logged out
    [12:11:46] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server

     

    Could this be a result of (1)? Maybe some strange de-sync issue?

  8. I am adding natural Amethyst Ore generation to the world.

     

    I am receiving the loading error:

    [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to register automatic subscribers. ModID: magiksmostevile, class genelectrovise.magiksmostevile.common.core.MagiksMostEvile
    java.lang.IllegalArgumentException: Method public static void genelectrovise.magiksmostevile.common.world.gen.ore.OreFeatureRegistry.addOresToBiomes(net.minecraftforge.event.world.BiomeLoadingEvent) has @SubscribeEvent annotation, but takes an argument that is not a subtype of the base type interface net.minecraftforge.fml.event.lifecycle.IModBusEvent: class net.minecraftforge.event.world.BiomeLoadingEvent

    ... which is fairly obvious from looking through the heirarchy.

     

    All of these posts say to use BiomeLoadingEvent to register features:

    https://forums.minecraftforge.net/topic/92868-1163-biomeloadingevent/

    https://forums.minecraftforge.net/topic/94945-1164how-to-generate-ores/

    https://forums.minecraftforge.net/topic/90560-1162-how-to-add-custom-ore-to-world-generation/

    https://forums.minecraftforge.net/topic/91702-1163-add-custom-generation/

     

    ... but FML doesn't like me doing this.

     

    Should I be using another Event? Am I using this one correcly?

     

    My subscribed methods:

    /**
       * Form the lists of ores to register
       * 
       * @param event
       */
      @SubscribeEvent
      public static void createOreLists(final FMLCommonSetupEvent event) {
        overworldOres();
        netherOres();
        endOres();
      }
    
      /**
       * Trigger ore registration.
       * 
       * @param event
       */
      @SubscribeEvent(priority = EventPriority.HIGH)
      public static void addOresToBiomes(final BiomeLoadingEvent event) {
        registerOres(event);
      }
    
      private static void overworldOres() {
        overworldOres
            .add(new SimpleConfiguredOreFeature.Builder().withSimpleOreFeature(new SimpleOreFeature())
                .withSimpleOreFeatureConfiguration(
                    new SimpleOreFeatureConfiguration(Blocks.STONE.getDefaultState(),
                        EvileDeferredRegistry.AMETHYST_ORE_OVERWORLD.get().getDefaultState(), 10, true))
                .build());
      }

     

    Where I subscribe them:

      public MagiksMostEvile() {
        LOGGER.info("Magiks Most Evile is being loaded by FML");
    
        EVENT_BUS = FMLJavaModLoadingContext.get().getModEventBus();
    
        registerCommonEvents();
    
        EvileDeferredRegistry.init(FMLJavaModLoadingContext.get().getModEventBus());
      }
    
    
      public static void registerCommonEvents() {
        LOGGER.debug("Registering MME common events");
        EVENT_BUS.register(OreFeatureRegistry.class);
      }

     

    The active branch of my GitHub repository:

    https://github.com/GenElectrovise/MagiksMostEvile/tree/feature/1.16.4/update_to_1.16.4/src/main/java/genelectrovise/magiksmostevile/common/world/gen

     

    Thanks!

  9. Problem solved:

    I thought that the dependencies section of mods.toml was optional, though it seems that I did actually need this:

    [[dependencies.magiksmostevile]] #optional
        modId="forge" 
        mandatory=true
        versionRange="[31,)" #mandatory
        # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
        ordering="NONE"
        # Side this dependency is applied on - BOTH, CLIENT or SERVER
        side="BOTH"
    # Here's another dependency
    [[dependencies.magiksmostevile]]
        modId="minecraft"
        mandatory=true
        versionRange="[1.16.4]"
        ordering="NONE"
        side="BOTH"

     

    Loads fine now - might have been something to do with some aspect FML being loaded after Magiks Most Evile? Don't especially know, but this is the solution.

     

    Now... Onwards and upwards to updating entities!

  10. Hello! 

    I'm updating my 1.15.2 mod (https://github.com/GenElectrovise/MagiksMostEvile/tree/1.15.2) to 1.16.4 (https://github.com/GenElectrovise/MagiksMostEvile/tree/1.16.4).

     

    I am receiving the error "The Mods File MagiksMostEvile/bin/main has mods that were not found".

    I suspect that it is an error with my mods.toml file, build.gradle, or my main Mod class though I cannot see the issue.

    The active development branch for this issue is https://github.com/GenElectrovise/MagiksMostEvile/tree/feature/1.16.4/update_to_1.16.4.

    I attach the latest log file with the error.

     

    Many thanks.

    latest.log

  11. ArrowItem, ArrowEntity and BowItem will be a lot of help here.

    I believe there is also a Projectile class? (Also look at ShootableItem, I think it's called)

    That would be a good place to start -- when you boil it down, all you want to do is:

     

    1) Make an item...

    2) Which spawns a new entity when you right click...

    3) Which then travels until it hits something...

    4) And if it hits an Entity, damage it.

     

    Of course there's more you'd want to do, such as making it arc, charging up the bow, consuming ammo, etc..., but those are the basic steps. If you're familiar with onItemRightClick and making entities, you're already most of the way to something functional :) 

    • Thanks 1
  12. 10 hours ago, Draco18s said:

    Are you even paying attention to what the OP wants?

    They want to craft a spawner block with a certain entity in it, which is something I have little experience of, so I gave the only bit of experience I had with dealing with spawner block tile entities.It isn't ideal, but I figured that the example would have at least some value with diesieben's suggestions.

  13. Here is my base spawn egg class, which will set a Monster Spawner to the entity of the spawn egg.

    I don't know on the subject otherwise, but I hope the Monster-Spawner-Setting code will help...

    https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/item/spawn_egg/EvileSpawnEgg.java#L79

    (You'll be most interested in the stuff from line 89)

  14. What version are you using?

     

    For 1.15.2:

    5 minutes ago, me1 said:

    a craft with a special entity int it

    A crafting recipe for a spawn egg? Or a spawner block with a mob in it?

     

    If it's a custom item, make a normal crafting recipe for it.

     

    If it's a Minecraft spawn egg (from MC's SpawnEggItem) to spawn a custom entity, the Minecraft spawn egg system is not good for modding. You're better off making a custom item to spawn the entity, then following my last suggestion.

×
×
  • Create New...

Important Information

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