Jump to content

Fi0x

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Fi0x

  1. How should I access the entity type instead?
  2. I am generating custom structures and want to set a random spawner type inside them. That worked fine, until I set the entity to spawn to one of my own entities. Working code: logic.setEntityId(new ResourceLocation("Zombie")); (logic is the MobSpawnerLogic) New code: logic.setEntityId(new ResourceLocation(Reference.MOD_ID, "Giant")); The problem is that the spawner block is showing up in the game and the mob rotating inside is the right one, but it won't spawn anything. I used a structure block to get the nbt data from the spawner that was generated and attached it to this post. nbt_data_via_structure_block.nbt
  3. Ok thank you I'll try to find out how I can get it to work.
  4. I have already implemented custom structure generation, but right now the only things I'm generating are single houses that have a fixed template like the igloo does. I need help implementing a dungeon that gets generated out of multiple room templates that are put together in random order.
  5. I'm trying to generate a dungeon with seperate rooms that get generated randomly like the woodland mansion does. Sadly I have no idea where to start programming the stuff in and what things I need for it. I would be very thankful if someone could hint me to a tutorial or give me some advice about how to approach this problem. The only post related to this I found was this one: But since the woodland mansion was implemented after this post and from what I heard the it gets generated with templates, unlike the other minecraft structures, I'm curious if it's possible to use some code from the Woodland mansion for my dungeon.
  6. I need to draw a mana-bar on the players Hud. The mana is saved on the player with capabilities. My current code: public class GuiManaRenderOverlay extends Gui { private final ResourceLocation MANA_BAR = new ResourceLocation(Reference.MOD_ID, "textures/gui/manabar.png"); private final int TEXT_WIDTH = 20; private final int TEXT_HEIGHT = 104; private int positionX = 0; private int positionY = 0; @SubscribeEvent public void renderManaOverlay(RenderGameOverlayEvent.Text event) { Minecraft mc = Minecraft.getMinecraft(); PlayerMana playerMana = mc.player.getCapability(PlayerProperties.PLAYER_MANA, null); int currentHeight = (int) playerMana.getManaPercentage(); mc.renderEngine.bindTexture(MANA_BAR); drawTexturedModalRect(positionX, positionY+10, 0, 0, TEXT_WIDTH, TEXT_HEIGHT); drawTexturedModalRect(positionX, positionY+10+TEXT_HEIGHT-currentHeight-2, TEXT_WIDTH, 2, TEXT_WIDTH, currentHeight); mc.fontRenderer.drawString("" + (int) playerMana.getMaxMana(), positionX+1, positionY+1, 15658734); mc.fontRenderer.drawString("" + (int) playerMana.getMana(), positionX+1, positionY+TEXT_HEIGHT + 11, 15658734); } } The problem is, that the player I refer to, is not the one that has the actual mana value I use with my other Items. Is there a way to get the other playerEntity?
  7. Some of the mods don't have a 1.14 or 1.15 version released. But has the RenderGameOverlayEvent changed at all? Because if not, it should be possible to help me with my problem, regardless of the version.
  8. I need a mod for a modpack that only exists on 1.12.2
  9. I personally like version 1.12.2 pretty much, so I prefer to work on that one. Updating to a newer version is no option for me since I need a 1.12.2 mod.
  10. Hi, I'm having trouble with my mana bar not rendering correctly. It should show the current amount of mana a player has, but instead it only shows the mana of something else. When the mana value of the player changes, the mana bar is not affected. Somehow the actual player and the player I refer to are not the same. Does anyone know how I can link them together or refer to the correct one? This is the part where I draw the Overlay and get the amount of mana: @SubscribeEvent public void renderManaOverlay(RenderGameOverlayEvent.Text event) { Minecraft mc = Minecraft.getMinecraft(); PlayerMana playerMana = mc.player.getCapability(PlayerProperties.PLAYER_MANA, null); int currentHeight = (int) playerMana.getManaPercentage(); mc.renderEngine.bindTexture(MANA_BAR); drawTexturedModalRect(positionX, positionY+10, 0, 0, TEXT_WIDTH, TEXT_HEIGHT); drawTexturedModalRect(positionX, positionY+10+TEXT_HEIGHT-currentHeight-2, TEXT_WIDTH, 2, TEXT_WIDTH, currentHeight); mc.fontRenderer.drawString("" + (int) playerMana.getMaxMana(), positionX+1, positionY+1, 15658734); mc.fontRenderer.drawString("" + (int) playerMana.getMana(), positionX+1, positionY+TEXT_HEIGHT + 11, 15658734); } Thanks for your help!
×
×
  • Create New...

Important Information

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