Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Fusseel

Members
  • Posts

    14
  • Joined

  • Last visited

Fusseel's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks a lot for your response. I'll definitely be taking a look at your library sometime soon.
  2. Hi, I'm trying to work with the PlaySoundAtEntityEvent to catch a certain sound being made. Then I want to get the entity that made this sound. This is what the piece of code looks like: @SubscribeEvent public void playSound(PlaySoundAtEntityEvent evt) { if (evt.getEntity() instanceof EntityPig && evt.getSound() == SoundEvents.ENTITY_PIG_AMBIENT) { evt.getEntity().getEntityId(); } } The problem is that it never finds anything. I've even gone as far to check for if (evt.getEntity() != null) but even this never yields any result. Only if (evt.getEntity() == null) actually triggers, but I don't understand why this is the case. I'd very much appreciate a solution to getting the entity that makes a certain sound.
  3. Thanks a lot for pointing that out! It's just a lot of new territory I'm trying to get at with this.
  4. Thanks a lot guys for the very quick responses as usual! Turns out I actually had it working before using LivingEvent.LivingUpdateEvent, but I just didn't notice since the effect I was looking for didn't occur. Isn't setActiveHand supposed to eventually slow down the player by a lot and disable sprinting? That's what I'm going for and what I thought would be happening, but it's not. My current implementation looks this: @SubscribeEvent public void rightClickItem(PlayerInteractEvent.RightClickItem event) { if (event.getItemStack().getItem() instanceof ItemSword) { this.mc.player.setActiveHand(EnumHand.MAIN_HAND); } } From my understanding due to isHandActive being true now (and it really is, I checked) this code in EntityPlayerSP (line 992-) would be executed now: if (this.isHandActive() && !this.isRiding()) { this.movementInput.moveStrafe *= 0.2F; this.movementInput.moveForward *= 0.2F; this.sprintToggleTimer = 0; } So either it isn't or it's not slowing the player down like I thought it would... Any idea what's wrong?
  5. I'm trying to manually set EntityPlayerSP.activeHand using EntityPlayerSP.setActiveHand(). Which would be the correct Forge event to do this through? I can't solve this via getItemUseAction() or something similar since I want to implement a new right click action for an existing vanilla item and not a new one from my mod. I already tried LivingEvent.LivingUpdateEvent, but that one didn't seem to work for my purpose. So which event would be correct?
  6. Wow, that's actually it. Thank you so much! Calling RenderGameOverlayEvent.Pre won't be necessary at all then since heldItemTooltips can only be disabled using a vanilla setting.
  7. Thanks a lot for your quick reply, but that doesn't really help. I've actually started from the vanilla code. But it's a bit different when working with RenderGameOverlayEvent.Pre since the GlStateManager settings are different. enableBlend() and tryBlendFuncSeparate() are already set the way they should be and pushMatrix or pushMatrix don't have any effect at this point. So it has to be something else.
  8. The goal of my mod is to replace heldItemTooltips with the ones from Console Edition which show enchantments and certain nbt tags in addition to the name of the current object. My replacement is supposed to fade away after a short time like the vanilla heldItemTooltips do. I'm having a problem with text that is supposed to be transparent. There is also a shadow behind it which currently leads to an interesting effect, but not my desired result: The text is only transparent where the coloured text and its shadow overlap. I'm using RenderGameOverlayEvent.Pre to render the text. Nothing is changed with GlStateManager before rendering, I'm guessing that my problem is caused by that and that I need to configure some GlStateManager settings, but I'm not finding the correct one. But maybe it's something completely else. My code for this project can be found in this file on Github. I hope that someone is able to point me to the problem since I've really tried a lot and so far nothing is making everything fade away like it is supposed to. Thank you guys in advance! __________________________________________________________________________________________________________________ EDIT a very long time later for anyone who stumbles across this post trying to fix a similar issue in their own mod like I do all the time on this forum: The issue was simply the text being rendered every time RenderGameOverlayEvent.Pre is called. I just forgot to check for event.getType() == RenderGameOverlayEvent.ElementType.ALL Because in the end running on Pre for ALL is actually a lot better for this purpose than using the Text event recommended below.
  9. Thanks for the response, I wasn't aware of this possibility, but it sounds really neat. Where could I find some documentation on this? I've already taken a quick look around, but I haven't seen something like this anywhere.
  10. Minecraft checks the file size of "1.4.6.jar" before launching and if it doesn't match a value determined in "1.4.6.json" it replaces the jar with a fresh one. The file size of your jar obviously won't match as you added the forge files. Simply removing the download section for the "1.4.6.jar" file in "1.4.6.json" usually works fine in this case.
  11. Hi, As the title states I want to replace all horse textures but not with a resource pack. This is because there will be multiple horse textures available in the mod and the user can toggle in the config file which texture set shall be used. By using a resource pack only the single texture set within the pack would be used all of the time with no possibility of somehow changing/overwriting it with a config option. I've already taken a look at "RenderHorse.java", but the textures aren't set in this file as usual, but within "EntityHorse.java" where the custom markings get applied before rendering. So how can I change/overwrite the texture paths within "EntityHorse.java"? Or is there something Forge lets me do to replace these textures with an event or something? I'd really love some help from you guys as I'm not able to come up with a solution. Cheers!
  12. Thank you! I was already working with RenderingRegistry.registerEntityRenderingHandler, turns out I just missed out on the @EventHandler annotation.
  13. Hello everyone, I want to replace the model of the normal guardian mob. So in theory I want to override "ModelGuardian.java" with my own file. I already have a replacement model inside "ModelGuardianOverride.java". But now I just can't figure out how to initialize my replacement model within forge to be used instead of the default one. An alternative approach would probably be to override individual functions from "ModelGuardian.java", but honestly I have no clue at all how they'd be initialized either. Help would really be appreciated. Btw, I'm not actually changing the entire model, I'm just disabling all animations. If there is a way to disable all animations in general or maybe a separat mod to disable them I'd prefer that solution. And please don't tell me I shouldn't alter anything about vanilla, this 'mod' is never meant to go public and only serves a very specific purpose.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.