Open main menu
Home
Random
Log in
Settings
About Forge Community Wiki
Disclaimers
Forge Community Wiki
Search
Changes
← Older edit
Newer edit →
Events/BlockEvent
(view source)
Revision as of 14:07, 20 April 2021
5 bytes removed
,
14:07, 20 April 2021
m
no edit summary
Line 18:
Line 18:
event.setExpToDrop(10); // change the amount of experience we'll be dropping
event.setExpToDrop(10); // change the amount of experience we'll be dropping
PlayerEntity player = event.getPlayer();
PlayerEntity player = event.getPlayer();
−
if (player.getUseItem().getItem().is(
Tags.
Items.SHEARS)) // check if the player is holding shears
+
if (player.getUseItem().getItem().is(Items.SHEARS)) // check if the player is holding shears
{
{
ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Items.BONE)); // give a bone to the player!
ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Items.BONE)); // give a bone to the player!
EERussianguy
16
edits