Skip 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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Meaning I'd have to store a list of valid dimension IDs. Grumble grumble. Rather than being able to look at empirical world properties. Hell biome.
  2. Yes. The mob should be able to change dimensions if forced (via teleportation effects, such as nether portals) but should not spawn there.
  3. You forgot the diagonals. # ## Will have a different connected texture on the lower left block than the same block with this configuration: ## ##
  4. I think that using the biomeList (the list of all the biomes that are available, including modded ones), you could check to see what ID's are used, and then (somehow as there is no method that I can find that returns the name of the biome) get the name of the biome. Then, using that getName() method or whatever you are using to get it, print out the ID of the biome, and the name of the corresponding ID. After obtaining that information, you could then read through and find the biomes you needed.... Something like that. Less of an issue than restriction dimension.
  5. Start by looking at net.minecraft.command.CommandBase
  6. net.minecraft.world.WorldSavedData It basically only needs two functions: @Override public void readFromNBT(NBTTagCompound nbttagcompound) { } @Override public void writeToNBT(NBTTagCompound nbttagcompound) { }
  7. You also need something like 47 individual texture files, based on what I've seen from a "connected textures for texture pack creators" thing.
  8. Its for specifying the construction of a specific village building. If you don't have one, then you don't need it. Otherwise you're going to need several classes. Mind, I haven't done this myself, I'm simply looking at the decompiled source for another mod. But this should get you started: public class VillageCreationHandler implements VillagerRegistry.IVillageCreationHandler
  9. You need to implement the.... IWorldSaveData interface, if I remember correctly. I can't pull up the one project I used it in at the moment, so I can't be more helpful than that.
  10. public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { this.glow(par1World, par2, par3, par4); super.onEntityWalking(par1World, par2, par3, par4, par5Entity); } *Cough*
  11. Not easily. Essentially you need to figure out how to specify a different icon based on surrounding blocks. The existing class functions don't allow for that.
  12. VillagerRegistry.instance().registerVillagerType(villagerID, "/mods/MyMod/textures/villager/myvillager.png"); //adding the villager VillagerRegistry.instance().registerVillageTradeHandler(villagerID, this.villager); //adding his trades VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler()); //villager house (e.g. Mystcraft's archivist always get his house, TC3's villager gets his tower, etc.)
  13. Using a tile entity? Ew, that's an awful way to do it. //EventHandler.java @ForgeSubscribe public void EntityUpdate(LivingEvent event){ if (entity instanceof EntityPlayer && entity.getHealth < 5) { //DO Your stuff } } //base mod.java MinecraftForge.EVENT_BUS.register(new EventHandler());
  14. The ID +/- 256 "trick" is a result of original vanilla's code, that block IDs were 0-255, and items were 0-255 (internally shifted by 256). That translated into Forge supplying a getBlockID function separate from a getItemID function (the latter auto-incrementing the ID by 256). And now we're stuck with it.
  15. In your base mod EntityRegistry.registerModEntity(PipeXPOrb.class, "PipeXPOrb", 1, this, 350, 5, false);
  16. I tried but I cannot find such command. public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { } Do you, or do you not, have a World as one of your parameters?
  17. Short answer: Yes Long answer: You need at least three classes to do it. The item or block itself Packet Handler implements IPacketHandler Gui Renderer implements ITickHandler These two lines in your base Init function: overlayGui = new MyGUIrenderer(); TickRegistry.registerTickHandler(overlayGui, Side.CLIENT); And this will get you drawing something like the pumpkin head. Actually, 95% of this is the pumpkin head. u = 32; float minU = (float)u/512; //my texture was 512x512 float minV = 0; float maxU = (float)(u+32)/512; float maxV = 0.0625F; ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); int k = scaledresolution.getScaledWidth(); int l = scaledresolution.getScaledHeight(); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_ALPHA_TEST); this.mc.renderEngine.bindTexture("/mods/MyMod/textures/gui/gui.png"); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, (double)l, -90.0D, minU, maxV); tessellator.addVertexWithUV((double)k, (double)l, -90.0D, maxU, maxV); tessellator.addVertexWithUV((double)k, 0.0D, -90.0D, maxU, minV); tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, minU, minV); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  18. world.createExplosion(x,y,z, radius) You will almost certainly have access to the world at the point in your block that you're trying to get this to happen.
  19. Couldn't this be achieved by checking if the player is in the dimension needed? (or do you need the dimension ID still?) If this is possible, then you could spawn it in a dimension specific biome. (I assume that the dimension biomes do not spawn in the overworld, and only in the dimension?) The problem arises when trying to determine what dimension number that is. Followed by what object is doing the checking assuming I knew? The mob itself? And your assumption is wrong. Mystcraft says "what biomes would you like?" and gives you a list. All vanilla biomes are valid (and so are all mod biomes). I can, in fact, make a world that checkerboards between Sky and Hell. I believe that cannot be achieved with vanilla code... Other than calling addSpawn for all biomes...which means I need an event listener to listen for mod biomes...
  20. I'm working with the Mystcraft API. Part of that API is a world generator interface, it's effectively the same as a vanilla IWorldGenerator, but Mystcraft controls when it is used (and there are often multiple per dimension). Each one of these files is the implementation of a single effect. An effect can range from "add these blocks to the world" to "cause potion effects on mobs at random." I want to spawn custom mobs as part of one of these effects. Mystcraft does not currently do any kind of mob spawn control. So I am currently doing AABB checks over a wide area (easily 65x65x128) every 80 or so ticks, and counting how many mobs of a given type are found, and if below a certain threshold, spawn more. I would much rather hand control over to Minecraft's spawning system, but I have no way of knowing when to invalidate the spawning rules. I only know when the player is in the dimension them dimension is loaded. I do not have access to the load or unload events (at least, not in any more detail than the Forge events) nor do I have access to the list of effects a given dimension has (specifically: XCompWiz doesn't want symbols to be aware of each other: observable properties are fine ("what is the average terrain height?" "what is the sea level?") but not the specific symbols used to get there ("Flat terrain" "nether terrain" etc.). So a number of things can be inferred from looking at these aggregate properties, but outside of the IWorldGenerator class, I have no way of knowing if an active dimension has the property I desire (nor does the spawn registry limit dimensions! Imagine multiplayer where I could enable/disable the spawning based on the property I don't have access to: one player goes to the valid dimension and the player in the overworld sees my mobs spawn at night! This is not desirable!). So, I need to spawn my mobs... 1) Any time, day or night 2) Specific, but unknown, dimension ID or IDs 3) No biome restrictions
  21. Which instructions did you follow? The ones on the Minecraft wiki, or the ones that came with the Minecraft Forge source download?
  22. Look at the arrow entity class.
  23. MORE ADVANCED TRICKIER QUESTION ASK: What if I want to limit these mob spawns to additional dimensions and only additional dimensions (i.e. not vanilla) and not during the night (i.e. I don't care about light level)? Conditions: 1) Arbitrary light level: daytime spawning should be valid--night may never actually occur, day may never actually occur, but mobs should still spawn. 2) Specific dimensions of unknown dimension ID: which dimensions are not known at mod registration time because the dimensions don't exist yet. 3) If the player leaves a valid dimension and enters a non-valid dimension, mob spawning should be disabled (and vice versa).1 4) Biome is irrelevant (some modifiers yes--such as mob A not spawning where it is cold, mob B not spawning where it is hot, etc.2--but not "oh mob B only spawns in Jungles" like ocelots). Example: Spawn the mob when "Jungles in Dimension with Non-Vanilla Property Y." Not "Jungles" nor "Dimension N." 1Through another mod's API I have a class that has two functions--onChunkPopulate and tick--that get called for each chunk in a valid dimension (the first one being chunk creation the second being chunk update) and access to a few events for when the player changes dimension via this mod's methods,3 though I am unsure if I can determine from the world object if it is a valid spawning dimension or not: I do not appear to have access to the custom WorldSavedData class that would hold those properties. At the moment I am using this class to manually spawn mobs by checking each chunk as it ticks for existing mobs and distance from the nearest player, although this is imperfect. 2Due to additional biome mods, like Biomes o' Plenty, I want my mob to spawn even in those biomes. I know there's a BiomeEvent...event and I could catch and store the additional IDs based on various parameters that I chose, but that's not the issue. It's figuring out when and where to register the spawning and then invalidate it! 3And there are other mods that permit dimensional travel that I do not (necessarily) have access to! IC2's teleporter, vanilla nether portal, end portal, twilight forest portal...
  24. Awesome, thanks! And yeah, there's a function in the entity class that says how many can spawn per chunk. Couldn't figure out how it was used (because I was lacking the EntityRegistry part) but I did at least alter the numbers to what I'd like.
  25. You can't. There's a reason why they're called Axis Aligned bounding boxes.

Important Information

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

Account

Navigation

Search

Search

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.