Posted November 3, 201311 yr Hello, I would like to know where in the code of the minecraft is that when you use an item so I can override to use in a custom item, I was looking on the treatment of user input of the game http://greyminecraftcoder.blogspot.com.au/2013/10/user-input.html, however is not quite exactly what I want to do (I do not want to detect when the user clicks the right mouse button but when it activates an item, because that must be considered configuration command 'use item' can be changed to another type of input type a key keyboard). Appreciate everyone's attention for any clarification.
November 3, 201311 yr Hi Although the Minecraft.clickMouse(button) says "left and right buttons", exactly the same code is called for keyboard keys which have been mapped to the attack or use actions. In fact, if the right mouse button is clicked, it is converted to a "keyboard press" as the very first thing. For "eating" an item (or blocking a sword or similar) you might be interested in PlayerControllerMP.sendUseItem and Item.useItemRightClick For right clicks on blocks ForgeEventFactory.onPlayerInteract(RIGHT_CLICK_BLOCK) or Item.onItemFirstUse or Item.tryPlaceItemIntoWorld For right clicks on air ForgeEventFactory.onPlayerInteract(RIGHT_CLICK_AIR) You can see all these options and how they are called from Minecraft.clickMouse. -TGG
November 5, 201311 yr Author I was confusing a class that believed it was represented that the items in the game, such net.minecraft.entity.item.Entityitem, had not noticed that there is a class net.minecraft.item.Item. Noting she noticed the existence of the method Item.onItemUse (), I believe that is exactly what I was looking for, I will perform some tests to find out if I can use it for what I plan. ty for replys = b
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.