MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / onItemUseFinish

Method onItemUseFinish

src/main/java/net/minecraft/item/ItemFood.java:58–66  ·  view source on GitHub ↗

Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using the Item before the action is complete.

(ItemStack stack, World worldIn, EntityPlayer playerIn)

Source from the content-addressed store, hash-verified

56 * the Item before the action is complete.
57 */
58 public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
59 {
60 --stack.stackSize;
61 playerIn.getFoodStats().addStats(this, stack);
62 worldIn.playSoundAtEntity(playerIn, "random.burp", 0.5F, worldIn.rand.nextFloat() * 0.1F + 0.9F);
63 this.onFoodEaten(stack, worldIn, playerIn);
64 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
65 return stack;
66 }
67
68 protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
69 {

Callers

nothing calls this directly

Calls 6

onFoodEatenMethod · 0.95
getIdFromItemMethod · 0.95
addStatsMethod · 0.80
getFoodStatsMethod · 0.80
playSoundAtEntityMethod · 0.80
triggerAchievementMethod · 0.80

Tested by

no test coverage detected