Jump to content

NoFuchsGavin

Members
  • Posts

    17
  • Joined

  • Last visited

  • Days Won

    1

NoFuchsGavin last won the day on August 29 2020

NoFuchsGavin had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

NoFuchsGavin's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. a.) Yeah maybe it would help posting log-Files, even if it's not giving more information: b.) How do you think it's a Cauldron problem? Just because someone posted a link of a similar problem. I've installed Forge on a "Fedora 26" Server hosted by Hetzner and got the same problem. Maybe you can answer us what this message is exactly telling us. Additionaly you may got the answer.
  2. Can you explain further. This is not very helpful if you are not providing any example, how it is done right.
  3. https://stackoverflow.com/documentation/minecraft/9956/modding-with-forge/30642/adding-custom-sounds-to-your-mod
  4. Hi together, as you can read in the title I want to replace rendering an item when clicking the "key.attack", when there is no block which can be mined (air). So I want the item to stop doing an arm swing when attacking and replace the animation with a custom animation
  5. Maybe you guys are interested in: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1432708-custom-arm-animation-stopping-swing So you will not stop the animation, but override the default one with a new one :-)
  6. This does not work on this type of event because it is not implemented. I do have subscriped the following method in my item class: @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true) public void onEvent(PlayerInteractEvent.LeftClickEmpty event) { //This is always called when the player attacks if (getItemIsHoldinHand().equals(ItemHoldInHand.NONE)) { //Do nothing if it is not hold return; } //Check if the attack can be handled if (this instanceof AttackItem) { //interface with the onAttack method ((AttackItem) this).attackClicked(event.getEntityPlayer(), event.getWorld(), event.getEntityLiving(),event.getEntity()); try{ event.setCanceled(true); }catch(IllegalArgumentException illegalArgument){ LOGGER.log(Level.INFO, "Could not cancel event will try to set other parameters"); event.setResult(Event.Result.DENY); event.setPhase(EventPriority.LOWEST); } } Overriding following method in your CustomItem @Override public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) { return true; //Handled to do not a swing } Will just stop doing a swing, when clicking a Block (mining it) but will do a swing when in LeftClick.Empty.... I will try more
  7. @Override public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) { return true; //Handled to do not a swing } But on the Event: PlayerInteractEvent.LeftClickEmpty event still remains an animation where the hand is going down and up.
  8. I do have the follwing error when starting my Mod Client: So I checked my: sounds.json and it looks like { "p99_shot": { "category" : "player", "sounds": [{ "name": "p99/shot", "stream": false } ] }, "p99_reload": { "category" : "player", "sounds": [{ "name": "p99/reload", "stream": false } ] }, "bullet_flyby": { "category" : "player", "sounds": [ { "name": "bullet/flyby01", "stream": false }, { "name": "bullet/flyby02", "stream": false }, { "name": "bullet/flyby03", "stream": false }, { "name": "bullet/flyby04", "stream": false }, { "name": "bullet/flyby05", "stream": false }, { "name": "bullet/flyby06", "stream": false }, { "name": "bullet/flyby07", "stream": false }, { "name": "bullet/flyby08", "stream": false }, { "name": "bullet/flyby09", "stream": false } ] } } My files are all there, in the directory: C:\Modding\mod1\src\main\resources\assets\survivethis\sounds\p99\ C:\Modding\mod1\src\main\resources\assets\survivethis\sounds\bullet\ containing all the files of type "*.ogg" What did I miss?
  9. What is about remapping keys for attack. Attack on "H" so this will not be on the LeftClick anymore.
  10. @Abastro I think this will not work as I expect. I thought it's possible to override the attack that I can use an item like I wanna to. Pistol -> shoot. So I need to override the default logic for the attack: Do not hit the block infront of the player Do no animation for hitting ....
  11. @Abastro So instead of using isPressed on the attack keybinding, isKeyDown() will work?
  12. He means the installer (attached screenshot) What exactly are you trying to do? 1. Install MDK to create your own MOD 2. Install Forge to play with MODs?
  13. All of you faced this problem. And now me, too. I wrote some code to catch Keyboard events. like: @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public void onEvent(InputEvent.KeyInputEvent event) { if (itemIsHoldinHand.equals(ItemHoldInHand.NONE)) { //Do nothing if it is not hold return; } String keyBindingDescKey = "key.attack"; // make local copy of key binding array KeyBinding[] keyBindings = Minecraft.getMinecraft().gameSettings.keyBindings; for (KeyBinding binding : keyBindings) { if (keyBindingDescKey.equals(binding.getDescriptionKey()) && /*IMPORTANT to do this on second check because its counter based and will reset other key actions when it hits*/ binding.isPressed()) { return; } } } This code works well as the attack key is bound to a keyboard key like: R, A, ... But at default the attack key is bound to KeyCode: -100 (Left mouse button) But thats not the main problem, I knew that there is another event for catching mousecation like: @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public void onEvent(InputEvent.MouseInputEvent event) { if (itemIsHoldinHand.equals(ItemHoldInHand.NONE)) { //Do nothing if it is not hold return; } ... String keyBindingDescKey = "key.attack"; // make local copy of key binding array KeyBinding[] keyBindings = Minecraft.getMinecraft().gameSettings.keyBindings; for (KeyBinding binding : keyBindings) { if (keyBindingDescKey.equals(binding.getDescriptionKey()) && /*This same pattern never hits....*/ binding.isPressed()) { return; } } } But doing the same thing as before results in nothing. Even trying to do: @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public void onEvent(InputEvent.MouseInputEvent event) { if (itemIsHoldinHand.equals(ItemHoldInHand.NONE)) { //Do nothing if it is not hold return; } boolean isPressed = Minecraft.getMinecraft().gameSettings.keyBindAttack.isPressed(); if(isPressed){ System.out.println("Hell yeah"); } } Is getting me no result. So I am asking you guys . Is there any pattern, how to or possibility to access the left mouse click (user friendly) PS: I did add it to the EVENT_BUS MinecraftForge.EVENT_BUS.register(ModItems.ItemGun);
  14. It not documented anywhere I just imported the wrong.
  15. I do have the problem I want to access the messages from the en_us.lang File I am using 1.11.2 - 13.20.0.2296 I am trying something like: if(!Init.isInitialized()) { Language currentLanguage = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage(); ResourceLocation loc = new ResourceLocation(MODID, String.format("%s.%s", currentLanguage.getLanguageCode(), "lang")); InputStream resourceInputStream = Minecraft.getMinecraft().getResourceManager().getResource(loc).getInputStream(); Init.init(); //Init.fileInit(resourceInputStream); This is not possible because it has private access } //This is what I want to do to replace the tooltip with a description I defined for the item description = I18n.translate(this.getUnlocalizedName() + SurviveThis.DESC_SUFFIX); I am stuck. Google does not help me ....
×
×
  • Create New...

Important Information

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