[solved]player.hidePlayer(Player) can still be seen by a modified client?

Discussion in 'Plugin Development' started by CorrieKay, May 8, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Father Of Time

  2. Offline

    CorrieKay

  3. Offline

    Father Of Time

    Yep, we have more inventory control now than ever... To be honest I've not found a limitation yet, and I use the inventory events very often. So with today's api you could do the following for instance:

    check to see what item a player is picking up (not placing, picking up via inventory events) and if the item they are picking up is an undesired item for handing out (diamond blocks, etc) and they are in creative mode cancel the pickup; this would render them incapable of picking up items from the creative mode menu and dumping them on the ground for players.

    I do this in a bank vault system I made; it has admin tools to allow my staff to look into peoples vaults for administration purposes, but does not allow them to pick up/steal players items.

    I am just rambling, but yes the inventory events are pretty awesome these days.
     
  4. Offline

    ZachBora

    I do this to get the newly item being held

    public void onItemHeldChange(PlayerItemHeldEvent event) {

    Player p = event.getPlayer();
    ItemStack is = p.getInventory().getItem(event.getNewSlot());
     
  5. Offline

    CorrieKay

    very interesting, i need to look at inventory events a little more :3
     
  6. Offline

    Komak57

    Watch out CorrieKay, that function will not watch for shift-click shortcuts.

    Seems like this topic has amassed some of the more intelligent coders, I like you guys ^.^
     
  7. Offline

    CorrieKay

    im glad, too!

    Im not quite sure what you mean. the shift click shortcut would still be caught by inventory click event, would it not?
     
  8. It would yes. .isShiftClick() would return true in that case.
     
Thread Status:
Not open for further replies.

Share This Page