Could Someone Explain To Me How To Make A Monster Friendly Mod

Discussion in 'Resources' started by travman11, Jun 21, 2011.

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

    travman11

    I have just started to create plugins and mods and for my first plugin i want to create a combination of an invisibility mod and a mod that makes the monsters ignore you. Could someone get me started on the monster friendly part.

    -Travis
     
  2. Offline

    alta189

    just cancel the EntityTarget Event
     
  3. Offline

    travman11

    thank you, can you tell me how to do that with a command, because when i try it just does nothing
     
  4. Offline

    alta189

    Im on my phone right now, but I can later when I get back to a computer
     
  5. Offline

    travman11

    tnx
     
  6. Offline

    WinSock

    Typed this out without an IDE so there might be little mistakes.
    Code:
    Set<Player> hidden = new HashMap<Player>();
    
    @Override
    public void onEntityTarget(EntityTargetEvent event) {
    	if (event.isCancelled()) {
    		return;
    	}
    	if (event.getEntity() instanceof Player) {
    		Player p = (Player)event.getEntity();
    		if (hidden.contains(p)) {
    			event.setCanceled(true);
    		}
    	}
    }
    
     
Thread Status:
Not open for further replies.

Share This Page