Closed BluXDragon closed 11 years ago
Looking into it. Edit: Seams to be because the slot isn't set, looking for a way to do that now.
WWOL
No, I don't think so. I've been doing this workaround for a while now, I only just came up with a good example.
@WWOL Couldn't you just use player.getItemInHand() when you call the hook?
Probably the best way actually, I was just adding a slot argument.
WWOL
player.getItemStackInHand(), yes. ItemInHand just gets the ID
@BluXDragon That's what I meant :P
I feel I should point out that I said "on hooks that have it", not just onItemUse. So this includes BLOCK_PLACE, BLOCK_RIGHTCLICK and ENTITY_RIGHTCLICK. Maybe others I missed.
The best I can explain this is via examples. Take onItemUse for example;
https://github.com/FallenMoonNetwork/CanaryMod/blob/crow/src/PluginListener.java#L629
There we can see the variable "itemInHand", which in this case is the item used.
Here is the most recent code that has failed with this item;
The code did absolutely nothing. But I have been using a fix that makes it function as intented;
See what I did there? Simply obtaining the item via getItemStackInHand results in the removal code working just fine, when it should have been already.