Skip to content

API Options

Eisi05 edited this page Mar 8, 2026 · 2 revisions

NpcAPI uses NpcOption<T, S> to configure behavior/appearance.

Setting options

import de.eisi05.npc.api.objects.NpcOption;
import org.bukkit.ChatColor;

npc.setOption(NpcOption.GLOWING, ChatColor.RED);

// make NPC automatically look at nearby players (distance in blocks)
npc.setOption(NpcOption.LOOK_AT_PLAYER, 6.0);

Applying option changes

If NpcConfig#autoUpdate(true)

Option packets are sent to current viewers automatically when you call setOption(...).

If NpcConfig#autoUpdate(false) (default)

Call one of:

npc.reload();
// or, if the NPC is not shown yet:
npc.showNpcToAllPlayers();

Version compatibility

Some options only work on newer server versions.

Internally, each option can declare a minimum version (NpcOption#since(Versions)). If an option is not compatible, it won’t generate packets.

Useful options (non-exhaustive)

  • NpcOption.SKIN / NpcOption.USE_PLAYER_SKIN
  • NpcOption.SHOW_TAB_LIST
  • NpcOption.GLOWING
  • NpcOption.POSE
  • NpcOption.SCALE
  • NpcOption.EQUIPMENT
  • NpcOption.LATENCY
  • NpcOption.HIDE_NAMETAG
  • NpcOption.SKIN_PARTS
  • NpcOption.ENTITY
  • NpcOption.VISIBILITY
  • NpcOption.COLLISION

Clone this wiki locally