Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. Sorry I didn't read your question properly, I thought you were talking about creating a torch that can be placed on the ground. Do you mean something like this? https://www.curseforge.com/minecraft/mc-mods/jabelars-moving-light-sources
  2. Isn't torch basically a block that can't be placed on the surfaces that aren't solid and detects neighborhood changes, with lightlevel and 6 facings?
  3. Thanks ; ) @SubscribeEvent public void RenderPlayer(RenderHandEvent event) { event.setCanceled(true); }
  4. As title. Is there any event that can be used to hide the player's hand and item in a specific condition I gave?
  5. yeah I just found the answer here If statement can solve this problem.
  6. Okay, I ran the code and it seems like it has been rendered multiple times every frame just like what you mentioned. How do I declare the element type?
  7. Which variable should I assign RenderGameOverlayEvent.ElementType.ALL; to? Btw, is there a way to let the picture I drew not block the vanilla stuff? Is it referring to the element type as well?
  8. @SubscribeEvent public void onRenderOverlay(RenderGameOverlayEvent.Post renderevent) { Minecraft mc = Minecraft.getMinecraft(); if (this.clicked) { mc.getTextureManager().bindTexture(TEST); Gui.drawScaledCustomSizeModalRect(x, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight); } return; } Is this correct? (I added .Post to the end of RenderGameOverlayEvent. If nothing's wrong, what does the u and v stands for in Gui.drawScaledCustomSizeModalRect?
  9. https://github.com/ed-webb/cobra/blob/master/src/main/resources/data/cobra/recipes/chalk_dust.json Why not use shapeless crafting here? and "data": 0 isn't necessary.
  10. public class AimHandler { private static final ResourceLocation TEST = new ResourceLocation(Reference.MOD_ID + ":textures/gui/test.png"); private boolean clicked = false; @SubscribeEvent public void onKeyPressed(MouseEvent event) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.player; ItemStack itemstack = player.getHeldItemMainhand(); if(player != null && Minecraft.getMinecraft().inGameHasFocus && event.isButtonstate() && itemstack.getItem() instanceof ItemBase && event.getButton() == 0) { this.clicked = !this.clicked; } return; } @SubscribeEvent public void onRenderOverlay(RenderGameOverlayEvent renderevent) { Minecraft mc = Minecraft.getMinecraft(); if (this.clicked) { mc.getTextureManager().bindTexture(TEST); Gui.drawScaledCustomSizeModalRect(x, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight); } return; } } Is this the correct way to do it?
  11. So I don't use RenderGameOverlayEvent anymore?
  12. Well RenderGameOverlayEvent sounds more efficient and more properly.... WHat should I do without extending Gui?
  13. Does the class still need to extend Gui or RenderGameOverlayEvent is all good?
  14. Am I able to combine events like this? public void onKeyPressed(MouseEvent event, RenderGameOverlayEvent renderevent)
  15. Do you mean this Forge Documentation https://mcforge.readthedocs.io/en/latest/utilities/recipes/#groups
  16. If you are talking about the arrow's damage to entity and your custom arrow extends entityarrow I think you just simply set the damage in the constructor. If not you use attackEntityFrom(damagesource, damage)
  17. How do I toggle it? Apparently, while loop will not work. And do you mean drawSplashScreen(textureManagerInstance)
  18. As title, I want to draw an overlay texture on to player's screen when left clicked similar to the pumpkin blur. Here us the code: public class OverlayHandler extends Gui { private static final ResourceLocation TEST = new ResourceLocation(Reference.MOD_ID + ":textures/gui/test.png"); private boolean clicked = false; @SubscribeEvent public void onKeyPressed(MouseEvent event) { if(!Minecraft.getMinecraft().inGameHasFocus) return; if(!event.isButtonstate()) return; Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.player; if(player != null) { ItemStack itemstack = player.getHeldItemMainhand(); if(itemstack.getItem() instanceof ItemBase) { int down = event.getButton(); if(down == 0 && !this.clicked) { this.clicked = true; mc.getTextureManager().bindTexture(TEST); this.drawTexturedModalRect(0, 0, 0, 0, 256, 256); } else if(down == 0 && this.clicked) { this.clicked = false; } } } } } I have checked the click was called but nothing has changed to the screen.
  19. In my situation to avoid the attack immune cooldown: raytraceresult.entityHit.setHurtResistanceTime = 0 ; ) link to stackoverflow
  20. The damage receive cooldown between every single attack is half a second unless the amount of damage dealt in the duration is larger than the damage dealt before in that half of the second, the entity will take the damage from the source that dealt the most damage, and ignore other damages. (From Minecraft Wiki) Link => https://minecraft.gamepedia.com/Damage#Immunity
  21. Oh wow, thanks.
  22. That's totally fine, I found nothing in the item class as well. Just one last question, is damaging an entity twice or more in a tick possible in minecraft? Or it only count as once?
  23. Nvm, thats not that important anymore. Another question, is there any way to prevent the player from getting slowed during using the item?
  24. Oh haha my bad. But what can I do with this method? I tried to override it but I couldnt
  25. How do you call Item#canContinueUsing?
×
×
  • Create New...

Important Information

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