-
Posts
1160 -
Joined
-
Days Won
7
Everything posted by poopoodice
-
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
-
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?
-
[SoLvEd] Hiding player's hand and item in first-person view 1.12.2
poopoodice replied to poopoodice's topic in Modder Support
Thanks ; ) @SubscribeEvent public void RenderPlayer(RenderHandEvent event) { event.setCanceled(true); } -
yeah I just found the answer here If statement can solve this problem.
-
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?
-
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?
-
@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?
-
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.
-
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?
-
So I don't use RenderGameOverlayEvent anymore?
-
Well RenderGameOverlayEvent sounds more efficient and more properly.... WHat should I do without extending Gui?
-
Does the class still need to extend Gui or RenderGameOverlayEvent is all good?
-
Am I able to combine events like this? public void onKeyPressed(MouseEvent event, RenderGameOverlayEvent renderevent)
-
Do you mean this Forge Documentation https://mcforge.readthedocs.io/en/latest/utilities/recipes/#groups
-
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)
-
How do I toggle it? Apparently, while loop will not work. And do you mean drawSplashScreen(textureManagerInstance)
-
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.
-
In my situation to avoid the attack immune cooldown: raytraceresult.entityHit.setHurtResistanceTime = 0 ; ) link to stackoverflow
-
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
-
Oh wow, thanks.
-
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?
-
Nvm, thats not that important anymore. Another question, is there any way to prevent the player from getting slowed during using the item?
-
Oh haha my bad. But what can I do with this method? I tried to override it but I couldnt
-
How do you call Item#canContinueUsing?