Jump to content

Lyeoj

Members
  • Posts

    21
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Lyeoj's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. So, I've been adding natural spawning code for a bunch of mobs in my mod, and it has been working for the most part. The exception, however is in my mobs that should spawn in water. So I tried adding this line of code to make a water mob spawn: EntityRegistry.addSpawn(EntityGiantSquid.class, 100, 1, 1, EnumCreatureType.WATER_CREATURE, BiomeDictionary.getBiomes(Type.OCEAN).toArray(new Biome[0])); I will note that this entity is not an extension of EntityWaterMob, but I have given it all the functionality of one, and I don't think that should matter because Guardians aren't extensions of it either. So I did a bit of research and I found a past thread on here with this exact same issue, but that thread never got a definite resolution. If someone could figure out what is going on here then that would be appreciated. <Alternative solution> So instead of using the above method to spawn my water mobs, there is another way that I'm trying, but it has a few issues as well. If anyone knows a way to fix this method then that would work just as well. Instead of spawning the mob using the normal spawning mechanics, I have tried to use the EventHandler with the LivingSpawnEvent to replace an occasional squid with my new mob like so: @SubscribeEvent public static void onLivingSpawn(LivingSpawnEvent event) { EntityLivingBase entity = event.getEntityLiving(); if(entity instanceof EntitySquid) { if(entity.world.getBiome(new BlockPos(entity)) == Biomes.OCEAN && entity.world.getDifficulty() != EnumDifficulty.PEACEFUL && !entity.world.isRemote) { if(entity.getRNG().nextInt(100) == 1) { EntityGiantSquid squid = new EntityGiantSquid(entity.world); squid.copyLocationAndAnglesFrom(entity); entity.world.spawnEntity(squid); System.out.println("Spawning giant squid"); entity.setDead(); } } } } So this method kinda works, but there is also some unpredictable behavior. Every time a giant squid replaces a regular one, there is a message printed to the console. Well when I move around in the ocean, I see waaay more giant squids than debug messages. There was one instance where I saw more giant squids than regular ones, but there should be only one giant squid per 100 squid spawned on average. Think I might be using this event improperly or just using the wrong one.
  2. Alright, so I have some custom potions that I want to be brewed using some custom items in the vanilla brewing stand. So I've figured out how to make custom brewing recipes using BrewingRecipeRegistry.addRecipe, but when I try this: BrewingRecipeRegistry.addRecipe(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.AWKWARD), new ItemStack(AMItems.SHOCK_STONE), PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), AMPotionTypes.ZAPPED)); the recipe will be brewed but it also will brew no matter what kind of potion is in the brewing stand when the ingredient is present. So I did a bit of research and found a past forum post here that mentioned that the recipes ignore NBT so a custom recipe implementation would need to be created. That sounded like it wouldn't be fun to do, and since the post was from 1.9.4, I was wondering if there was a better way to do this since then. So I then went and found almost what I was looking for: PotionHelper.addMix(PotionTypes.AWKWARD, AMItems.ITEM_SILVER_SHELL, AMPotionTypes.AMFATIGUE); This works great for the custom potions I have that use a PotionType, but for various reasons, I have created a bunch of custom potions that are just custom items instead of PotionTypes. I still want them to be brewed using vanilla potions but the end result will be an item that isn't derived from a PotionType. Here's an example of what I want to do: BrewingRecipeRegistry.addRecipe(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.AWKWARD), new ItemStack(AMItems.ITEM_HUNGRY_SLIMEBALL_BIG), new ItemStack(AMItems.ITEM_NUTRIENTS)); But of course, this puts me back in the situation where I was before where it won't matter what kind of potion is used in the brewing. So I'm just wondering if there is some nice way I can add this recipe, or will I just have to implement custom recipes?
  3. Well I did some looking through the code and found the reason for one of my issues. So the HUD effect not showing up is due to a check in the GuiIngame class, as the call to the Forge renderHUDEffect is within a conditional block that checks if the potion shows particles. I haven't found the place where the potion's liquid color is set for the potion item, but I assume that it will also check if the potion shows particles when setting the liquid color as well. Regardless of the reason for the liquid color, I think I won't be able to just turn off the particles in the constructor and still get the desired behavior for my potion effects. The only thing I can think of to do now is make a bunch of brand new items to mimic the vanilla potions, although it will be annoying since I want to give them splash and lingering variants as well. If anyone has an idea on a better way to do this, it would be appreciated.
  4. So I thought that constructor was just what I was looking for, but then I tried using it to make a custom PotionType, and setting showParticlesIn to false turns the liquid color to black. This PotionType shows particles and has a colored liquid: public static final PotionType FROZEN = new PotionType(new PotionEffect[] {new PotionEffect(AMPotion.FROZEN, 600, 0, false, true)}).setRegistryName("frozen"); And this one doesn't show particles but has a black liquid: public static final PotionType FROZEN = new PotionType(new PotionEffect[] {new PotionEffect(AMPotion.FROZEN, 600, 0, false, false)}).setRegistryName("frozen"); Additionally, setting the particles to false messes with another aspect of my potion effect. So this particular effect has an overlay drawn on the screen that is called using an overridden renderHUDEffect from the Potion class and it is no longer visible using the new PotionEffect constructor with showParticlesIn set to false. This seems odd.
  5. Alright, so I have a bunch of cool potion effects that I have made, but I don't like the potion particles showing up when they are active. The easiest way I could find to make the potions not display particles was to set the liquid color to pure black (0). However, I have now decided that I want to register a bunch of my potion effects as PotionTypes so I can make them into drinkable or splash potions relatively easily. For these potions, I want them to have a liquid color that isn't just pure black, but changing the color would make them display particles again. So I want to know if there is an easy way to turn off the potion particles while still having a colored potion liquid.
  6. After a bit of trial and error, it looks like I have fixed the problem. Although all the tutorial code included it, I removed the !world.isRemote check from my book item since I figured the proxies already were handling the side checks. Upon removing it, I now can see my mouse when opening the book!
  7. Sure thing, here's the book GUI, mostly copied: The book item: And finally the method in the client proxy to draw the GUI: public void drawMonsterBook() { Minecraft.getMinecraft().displayGuiScreen(new GuiMonsterBook()); }
  8. Alright, so I want to make a custom book item to serve as a manual for my mod. So I looked up a tutorial and got a simple book functioning simply by copying most of the code. Despite being for an older version of Minecraft, I only had to make a few small changes to get the code to work for 1.12. However, there is one minor problem that is bugging me quite a bit. When I open the book, the mouse cursor can be moved around but isn't visible. This can be fixed by moving the cursor outside the window and then back in, but it's still quite annoying. For reference, the tutorial I copied can be found here: http://jabelarminecraft.blogspot.com/p/minecraft-modding-block-with-simple-gui.html The only changes I really made were the paths to the textures, and a few variable names were changed to work with 1.12. I also cross-referenced the vanilla GuiScreenBook class and my book seems to be consistent with it. Also, the tutorial is for drawing the book Gui when right clicking on a block, but I just changed that to the onRightClick method of my book item.
  9. Hey, that fixed it! Thanks a bunch! I had initially copied the .json file from a tutorial which had that "/" there, but it had slightly different package layouts and was also a few versions outdated. I tried a bunch of different combinations for the pathname such as including "/assets" and the file extension, and even removed the leading forward slash for a few combinations. I do feel a bit silly that I hadn't tried this simplest combination, but thanks again for the help!
  10. Hello, So I haven't done much modding since 1.7.10 but am starting to get back into it and figure out how 1.12 works and I am attempting to add a custom sound. So I think I've figured out the new registry stuff and have registered a soundEvent. Just in case, here's what my soundEvent looks like: public static final SoundEvent SNIPER_SHOOT = new SoundEvent(new ResourceLocation(ApexMobs.MODID, "sniperskeleton.shoot")).setRegistryName("snipershoot"); and the register entry: @SubscribeEvent public static void registerSoundEvents(RegistryEvent.Register<SoundEvent> event) { event.getRegistry().register(AMSoundEvents.SNIPER_SHOOT); } Next up, here's my sounds.json file, this is the part most unfamiliar to me: { "sniperskeleton.shoot": { "category": "master", "sounds": [ { "name": "apexmobs:/sniper/sniperbow","stream":false } ] } } When I attempt to play the sound through an item in the game, I get a console error: [main/WARN]: Unable to play empty soundEvent: apexmobs:sniperskeleton.shoot The part where I think something has most likely gone wrong is the .json file. I am always confused as to what parts of the pathname need to be included and what parts don't. For context, my sound file is "sniperbow.ogg" located in the package "assets.apexmobs.sounds.sniper". Any help is appreciated, thanks in advance.
  11. Alright then, I have changed absolutely nothing since yesterday, but upon attempting another build today, it worked just fine with no problems. I don't even...
  12. So I was trying to build a new version of my mod, which I had been able to do without problems plenty of times before, and I received this error. C:\Users\Lyeoj\Desktop\MC Modding>gradlew build FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Lyeoj\Desktop\MC Modding\build.gradle' line: 25 * What went wrong: A problem occurred evaluating root project 'MC Modding'. > No such version exists! * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 5.469 secs This is my gradle.build file, even though the only thing I had changed in it since the last time I made a new build was the mod version: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.7.10-Beta-1.2.5" group= "lyeoj.deadlyfeesh.mod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Deadly Feesh" minecraft { version = "1.7.10-10.13.4.1490-1.7.10" runDir = "eclipse" } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } I know that my forge is out of date, but even upon trying to update forge, gradle would give the exact same error. I also downloaded a fresh copy of the forge src and made sure my gradle.build file was the same as its. I even tried to run gradlew setupDecompWorkspace with the fresh forge src and it still failed with the exact same error.
  13. Thanks! Was looking through the Forge events but forgot about the client ones.
  14. Ok, so I want to make some custom visual effect appear on the player's screen, such as a fog similar to the nightvision or blindness potions. I managed to trace this effect to the EntityRenderer class, which seems to control things like fog or shader effects. The only problem is that there is almost no way to externally control it, since all of the potion effects that change the screen are built into the class. How can I make an effect appear on the screen? Is there a way to hook into the class, or do I need to make my own renderer, or something else? (To specify what exactly I want to do, I just want to make a colored fog appear on the screen when I have a custom potion active)
  15. Making the color very light wouldn't make it transparent at all, you need to add alpha channel to tell the game that a certain texture should be transparent. I have added alpha to my textures already, my problem is getting the Renderer to be able to read the alpha channel, which it doesn't do by default. As for changing the light level of the mob, I don't even.
×
×
  • Create New...

Important Information

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