MCPcopy Create free account
hub / github.com/CitizensDev/CitizensAPI / getOrAddTrait

Method getOrAddTrait

src/main/java/net/citizensnpcs/api/npc/NPC.java:196–196  ·  view source on GitHub ↗

Gets a trait from the given class. If the NPC does not currently have the trait then it will be created and attached using #addTrait(Class) . @param trait Trait to get @return Trait with the given name

(Class<T> trait)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 5

processMethod · 0.95
inventoryCloseEventMethod · 0.65
setItemMethod · 0.65
setMethod · 0.65
replaceMethod · 0.65

Implementers 1

AbstractNPCsrc/main/java/net/citizensnpcs/api/npc

Calls

no outgoing calls

Tested by

no test coverage detected