◆Cobblemon Wiki

MoLang

Molang NPC Functions

entity 함수도 사용할 수 있습니다. 타입은 ObjectValue<NPCEntity>입니다.

NameDescriptionUsage
class(): StringNPC의 ID를 문자열로 반환합니다.q.npc.class()
name(): StringNPC의 이름을 반환합니다.q.npc.name()
level(): DoubleNPC의 레벨을 반환합니다.q.npc.level()
has_aspect(aspect: String): Double1.0을 반환합니다: the NPC contains the aspect, otherwise returns 0.0>/code>.q.npc.has_aspect('champion')
face(isLeftSide: Boolean?): ObjectValue<ReferenceDialogueFaceProvider>[ReferenceDialogueFaceProvider]의 ObjectValue를 반환합니다. isLeftSide의 기본값은 true입니다.q.npc.face()
in_battle(): DoubleNPC가 배틀 중이면 1.0을 반환하고, 그렇지 않으면 0.0을 반환합니다.q.npc.in_battle()
battles(): ArrayStruct<CHECK TYPE>이 NPC가 현재 참여 중인 모든 배틀을 반환합니다.q.npc.battles()
stop_battles()Stops all ongoing battles for this NPC.q.npc.stop_battles()
is_doing_activity(identifiers: String...): DoubleNPC가 매개변수에 나열된 활동 중 하나를 수행 중이면 1.0, 그렇지 않으면 0.0을 반환합니다.q.npc.is_doing_activity('rest', 'idle')
run_script_on_client(script: String)서버에서 실행하면 NPC와 같은 월드에 있는 모든 플레이어에게 클라이언트에서 script를 실행하라는 패킷을 보냅니다.q.npc.run_script_on_client('cobblemon:npc_battle_cooling_down')
run_script(identifier: String): MoValueidentifier의 스크립트를 실행합니다. 스크립트 결과를 반환하며, 실패하면 0.0을 반환합니다.q.npc.run_script('cobblemon:npc_battle_cooling_down')
run_action_effect(actionIdentifier: String): DoubleRuns an action effect. 1.0을 반환합니다: effect is found, 그렇지 않으면 0.0을 반환합니다.q.npc.run_action_effect("cobblemon:generic_damage")
put_pokemon_in_healer(position: ArrayStruct<Int>): DoubleThe NPC attempts to put pokemon in a healing machine at position. 1.0을 반환합니다: it succeeded, 그렇지 않으면 0.0을 반환합니다.q.npc.put_pokemon_in_healer(t.pos)
look_at_position(x: Double, y: Double, z: Double)Makes the NPC look at the position of x, y, and z.q.npc.look_at_position(0, 0, 0)
environment(): MoLangEnvironmentNPC의 환경을 반환합니다.q.npc.environment()
party(): MoValueNPC가 파티를 가지고 있으면 ObjectValue<PartyStore>를 반환하고, 그렇지 않으면 0.0을 반환합니다.q.npc.party()
has_party(): Double1.0을 반환합니다: NPC has a 파티, 그렇지 않으면 0.0을 반환합니다q.npc.has_party()
is_npc(): Double1.0을 반환합니다.q.npc.is_npc()
can_battle(): Double1.0을 반환합니다: NPC has a 파티 and that 파티 has health or if the 파티 has isStatic set to false. 그렇지 않으면 0.0을 반환합니다q.npc.can_battle()