Jump to content

[1.10.2] [Solved] Generated spawners issue


ZTagre

Recommended Posts

I have a quick question concerning mob spawners I am generating in "dungeon"-type structures within my mod.

 

   I have created a skeleton spawner in a mod-generated dungeon, and then when I run the code, for some reason the skeletons my mod generates don't ever seem to have supplied random armor, or randomly enchanted bows? I only get "standard" skeletons, with normal, un-enchanted bows.

 

   Do I need to tell my mod's skeleton spawner(s) to do the random armor / enchanted bow generation? I thought this would simply occur automatically, simply due to the way Minecraft handles any such spawners (ie.sometimes  a spawned skeleton would be given an automatic, randomly generated set of gear, NOT the same as the previously generated skeleton).

 

   And, moreover, if in fact I do need to set this up myself (using an / several NBT tag(s), I would imagine?), what do I need to do to produce this random gear effect?

 

   I'm just a little bit confused as to how this works, I guess (sorry if it seems a bit of a noob question :-}

 

   Any help greatly appreciated!

 

   ZTagre.

Edited by ZTagre
Solved / issue closed
Link to comment
Share on other sites

Thanks for the reply, diesieben07!

 

  My code? Okay, but you just might be reading more into my "problem" than I intended!

 

   In my mod, once I have finished generating a dungeon, I have a "list" of locations x,y,z that I wish to place chests, spawners, etc. Suppose that I have the following coord. picked out for just such a generated skeleton spawner:

 

                 int x, y, z;
                String mobName;
                
                // Using the following as a template, you can generate
                // all "on-the-fly" mob spawners with this method!
                // You simply set the x, y and z coords. to the desired
                // world coords. for the spawner, and then call utility
                // method StructureUtils.setSpawnerInWorld(...) with
                // the world, x, y, z, and mob_name params.! - ARG.
                
                x = -179;
                y = 17;
                z = 209;
                mobName = "Skeleton";
                StructureUtils.setSpawnerInWorld(world, x, y, z, mobName);

 

   Now, whether or not the code below is considered good "practice" for placing a spawner into my world or not, this is what I use:

 

    public static void setSpawnerInWorld(World world, int x, int y, int z, String entity_name)
    // **************************************************************
    // A method developed because of the need to generate spawners of
    // specific mobs within our test worlds during Mod development,
    // we found it useful enough to add it to our utility library!
    //
    // More or less "self-explanatory", the method will generate a
    // mob spawner of the mob whose "name string" is passed as the
    // single String param., at the given coords. in the world
    // specified by the "world" param.
    //
    // Some possible mob "name strings":
    //  Blaze
    //  Skeleton
    //  Zombie
    //  Spider
    //  Ozelot
    //  Wolf
    // (just look up the rest - they're easy to find online or in
    // the vanilla MC source...) - ARG.
    // **************************************************************
    {

           BlockHelper.setBlock(world, x, y + 1, z, Blocks.MOB_SPAWNER);
            
           BlockPos pos0 = new BlockPos(x, y + 1, z);
           TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(pos0);
                                    
           if (spawner != null)
               spawner.getSpawnerBaseLogic().setEntityName(entity_name);
        
    }

 

 

   Please do note that I have used this code VERBATIM to produce skeleton, zombie, and enderman spawners into my maps that all behave exactly as they should! The skeletons actually occasionally generating armor and sometimes enchanted items as well!

 

   But, this time, I am trying to place a spawner into a slightly different surroundings - a tower (of sorts).

 

   The top of the tower is actually at normal ground level (y = 64, I believe), and the tower "body" actually extends DOWN into the ground (a sort of 20-block deep "pit", if you will...). So you would actually be underground when you "discover" this tower that contains both treasure and generated mods. Skeletons are one of the "key" mobs within this structure.
 

   However, like I said in my posted question - this time, for some strange reason, my skeleton spawner will NOT, EVER generate anything but vanilla skeletons, with no armor, and no enchanted items! I just don't understand what has happened here! This exact same code, when it places a skeleton spawner in a different environment, works perfectly well!

 

   So, yeah, I'm just a bit confused here! Same world, same game difficulty! In some cases, "normal" random skeleton generation by the placed spawner, and, in THIS CASE, only "vanilla" skeletons!

 

   I have even manipulated the size of the rooms at the top of the tower, as well as the position of the placed spawner (from inside the stone ground (inset) to suspended above the ground (hanging from the ceiling). The light level (for all rights and purposes) is exactly the same. Nothing changes!

 

   Anything?

 

   ZTagre.

Link to comment
Share on other sites

Wow - so this is a wee bit of a mystery, then eh? I know I'm pretty confused, and so I was hoping that someone just might have had the same experience / problem!

 

   So, we'll break out the old debugger, and take a gander at what's going on, then!

 

   Thanks for giving your time, diesieben07! I as always am much appreciative, and I'll keep you and others up to date on what I find out...

 

   ZTagre.

Link to comment
Share on other sites

Update:

 

   What I'm going to relate here might just seem a bit crazy, but let me just tell you what I found out!

 

   In early development, as I was creating my dungeon (call it my "development" version), I placed it fairly close to my base (which is also just a stone's throw away from my initial spawn point in this world...(sound familiar?).

 

   This dungeon was then used to test all subsequent development. So this was also used to test my mob spawner placement within this dungeon. And, as I have already stated, everything appeared to work "normally" (nothing out of the ordinary). My generated skeleton spawner(s) always functioned as expected (within Minecraft "norms"...).

 

   But, lately, I have begun to generate dungeons that are at a relatively FAR DISTANCE from my base, so that I could make said dungeons both larger, and more realistic. However, this distance also makes it very hard to get back and forth from my base during testing, so I routinely utilize a mod that has both WAYPOINTS and TELEPORTATION. And now, here's the "rub"...

 

   If I place the spawner within the dungeon, and then then quit and save AT MY BASE LOCATION, and then subsequently re-load the saved game, to get back to that dungeon I use teleportation (via this mod I mentioned previously). When I do this, the skeleton spawner behaves badly (as per the problem I have brought up here in this posting...).

 

   BUT, if I quit and save while in the relative location of the dungeon, and do not require teleportation to the dungeon site upon re-load of the game, then the spawner behaves exactly as it should!!!

 

   So, to reiterate: When I quit and save in a location outside the relative location of the dungeon / spawner in question, and then subsequently use a teleporation mod to get back to the dungeon site, the spawner does not behave correctly!  But saving and re-loading while in the general vicinity of the dungeon has the placed spawner(s) working as per design!

 

   While I don't yet understand fully just what is actually causing the problem yet, I know that it is NOT (at least, not entirely) the spawner's fault!

 

   I seems to have something to do with my "overuse" of this teleportation system and the mod that supplies it!

 

   So, for now, this case is closed!

 

   Thanks again, diesieben07!

 

   ZTagre.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI)   I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
  • Topics

×
×
  • Create New...

Important Information

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