added player_picks_up_item and better docs on events.

This commit is contained in:
gnembon committed 2020-09-23 03:26:39 -03:00
1 parent e8b2060fb3
commit 9ca7892859
10 files changed
+415 -113

No files matched your search

@@ -416,7 +416,21 @@ public class CarpetEventServer
), player::getCommandSource);
}
};
// todo PlayerInventory.insertStack... for definite item inventory pickup, when result protocol has be set
public static final Event PLAYER_PICKS_UP_ITEM = new Event("player_picks_up_item", 2, false)
{
@Override
public void onItemAction(ServerPlayerEntity player, Hand enumhand, ItemStack itemstack) {
handler.call( () ->
{
//ItemStack itemstack = player.getStackInHand(enumhand);
return Arrays.asList(
((c, t) -> new EntityValue(player)),
((c, t) -> ListValue.fromItemStack(itemstack))
);
}, player::getCommandSource);
}
};
public static final Event PLAYER_ATTACKS_ENTITY = new Event("player_attacks_entity", 2, false)
{
@Override