Spectator

5.4k Downloads

Informations

About

Spectator is a plugin, allows you to spectate other people in the first person view. You may also see their gamemode, hungerbar, healtbar and inventory of the player, you're spectating. Spectator also got an API for plugin developers which easily allows you to let people spectate other people.

Commands & Permissions

The two commands & permissions are:

/spectateon <player> <time> | spectate.on

/spectateoff | spectate.off

API

Here's a little guide how to use the included API for plugin developers:

1. Add Spectator.jar into your build path

2. Initialise the Specator plugin

3. Start coding! ;)

There are 3 methods included:

specateOn(Player p, Player t, int time) | p is the Player who will spectate target t. Time is the time, how long he'll spectate him.

spectateOff(Player p) | This will just turn off the spectatormode of player p

updatePlayer(Player t) | This will update the spectated player (target) for all spectators. Use this in the PlayerMoveEvent!

Here's a little example:

	@EventHandler
	public void onDeath(PlayerDeathEvent event) {
	
		Player p = event.getEntity();
		Player t = p.getKiller();
		
		Spectator.spectateOn(p, t, 20);
	}
	
	@EventHandler
	public void onMove(PlayerMoveEvent event) {
		
		Player t = event.getPlayer();
		
		Spectator.updatePlayer(t);
	}