From 67a468a0062985c2b29862593265adc697ea3460 Mon Sep 17 00:00:00 2001 From: Jolihan566 Date: Tue, 7 Apr 2026 18:17:56 +1000 Subject: [PATCH 1/3] added chatter npc behaviour, script and associated lang files --- .../assets/cobblemon/lang/en_us.json | 12 ++++++ .../cobblemon/behaviours/npc/chatter_npc.json | 39 +++++++++++++++++++ .../molang/npc/chatter-npc-interaction.molang | 1 + 3 files changed, 52 insertions(+) create mode 100644 common/src/main/resources/data/cobblemon/behaviours/npc/chatter_npc.json create mode 100644 common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang diff --git a/common/src/main/resources/assets/cobblemon/lang/en_us.json b/common/src/main/resources/assets/cobblemon/lang/en_us.json index 7da98ac3ef..49f7de8188 100644 --- a/common/src/main/resources/assets/cobblemon/lang/en_us.json +++ b/common/src/main/resources/assets/cobblemon/lang/en_us.json @@ -3918,6 +3918,18 @@ "cobblemon.entity.variable.dialogue_selection.name": "Dialogue", "cobblemon.entity.variable.dialogue_selection.desc": "The resource identifier of the dialogue to open on interaction, such as cobblemon:your_dialogue", + "cobblemon.behaviour.chatter_npc.name": "Chatter NPC", + "cobblemon.behaviour.chatter_npc.desc": "Allows the npc to talk with the player using the in-game chat when interacted with, optional animation support.", + + "cobblemon.entity.variable.chat_message.name": "Chat Message", + "cobblemon.entity.variable.chat_message.desc": "Content for the message the NPC says when interacted with. Supports traditional minecraft colour and formatting.", + + "cobblemon.entity.variable.animation_name.name": "Animation Name", + "cobblemon.entity.variable.animation_name.desc": "The name of the animation to play when the NPC is interacted with.", + + "cobblemon.entity.variable.play_animation.name": "Play Animation On Interaction", + "cobblemon.entity.variable.play_animation.desc": "Whether to play an animation when the NPC is interacted with.", + "npc.sacchi.name": "Professor Sacchi", "cobblemon.move.pound": "Pound", diff --git a/common/src/main/resources/data/cobblemon/behaviours/npc/chatter_npc.json b/common/src/main/resources/data/cobblemon/behaviours/npc/chatter_npc.json new file mode 100644 index 0000000000..2189f8d1fc --- /dev/null +++ b/common/src/main/resources/data/cobblemon/behaviours/npc/chatter_npc.json @@ -0,0 +1,39 @@ +{ + "name": "cobblemon.behaviour.chatter_npc.name", + "description": "cobblemon.behaviour.chatter_npc.desc", + "entityType": "cobblemon:npc", + "undo": [ + "q.entity.unset_interaction();" + ], + "configurations": [ + { + "type": "script", + "variables": [ + { + "variableName": "chat_message", + "displayName": "cobblemon.entity.variable.chat_message.name", + "description": "cobblemon.entity.variable.chat_message.desc", + "type": "TEXT", + "defaultValue": "Hello!" + }, + { + "variableName": "animation_name", + "displayName": "cobblemon.entity.variable.animation_name.name", + "description": "cobblemon.entity.variable.animation_name.desc", + "type": "TEXT", + "defaultValue": "wave" + }, + { + "variableName": "play_animation", + "displayName": "cobblemon.entity.variable.play_animation.name", + "description": "cobblemon.entity.variable.play_animation.desc", + "type": "BOOLEAN", + "defaultValue": "false" + } + ], + "script": [ + "q.entity.set_script_interaction('cobblemon:chatter-npc-interaction')" + ] + } + ] +} diff --git a/common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang b/common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang new file mode 100644 index 0000000000..5344f97f3c --- /dev/null +++ b/common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang @@ -0,0 +1 @@ +q.player.tell(q.npc.name + ': ' + q.npc.config.chat_message);q.npc.config.play_animation ? q.npc.play_animation(q.npc.config.animation_name, q.player.uuid); \ No newline at end of file From d917e81804904609dcf06c510b344ff446f97f72 Mon Sep 17 00:00:00 2001 From: Jolihan566 Date: Tue, 7 Apr 2026 18:23:03 +1000 Subject: [PATCH 2/3] fix variable name --- common/src/main/resources/assets/cobblemon/lang/en_us.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/resources/assets/cobblemon/lang/en_us.json b/common/src/main/resources/assets/cobblemon/lang/en_us.json index 49f7de8188..f5cd8312e6 100644 --- a/common/src/main/resources/assets/cobblemon/lang/en_us.json +++ b/common/src/main/resources/assets/cobblemon/lang/en_us.json @@ -3927,7 +3927,7 @@ "cobblemon.entity.variable.animation_name.name": "Animation Name", "cobblemon.entity.variable.animation_name.desc": "The name of the animation to play when the NPC is interacted with.", - "cobblemon.entity.variable.play_animation.name": "Play Animation On Interaction", + "cobblemon.entity.variable.play_animation.name": "Play Animation", "cobblemon.entity.variable.play_animation.desc": "Whether to play an animation when the NPC is interacted with.", "npc.sacchi.name": "Professor Sacchi", From ae65b2c2b1af5a3479296f588b9f322ffcfbced9 Mon Sep 17 00:00:00 2001 From: Jolihan566 Date: Tue, 7 Apr 2026 20:53:48 +1000 Subject: [PATCH 3/3] fixed --- common/src/main/resources/assets/cobblemon/lang/en_us.json | 2 +- .../data/cobblemon/molang/npc/chatter-npc-interaction.molang | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/resources/assets/cobblemon/lang/en_us.json b/common/src/main/resources/assets/cobblemon/lang/en_us.json index f5cd8312e6..00a8a9c5f3 100644 --- a/common/src/main/resources/assets/cobblemon/lang/en_us.json +++ b/common/src/main/resources/assets/cobblemon/lang/en_us.json @@ -3919,7 +3919,7 @@ "cobblemon.entity.variable.dialogue_selection.desc": "The resource identifier of the dialogue to open on interaction, such as cobblemon:your_dialogue", "cobblemon.behaviour.chatter_npc.name": "Chatter NPC", - "cobblemon.behaviour.chatter_npc.desc": "Allows the npc to talk with the player using the in-game chat when interacted with, optional animation support.", + "cobblemon.behaviour.chatter_npc.desc": "Allows the NPC to talk with the player using the in-game chat when interacted with, optional animation support.", "cobblemon.entity.variable.chat_message.name": "Chat Message", "cobblemon.entity.variable.chat_message.desc": "Content for the message the NPC says when interacted with. Supports traditional minecraft colour and formatting.", diff --git a/common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang b/common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang index 5344f97f3c..2bc075cf14 100644 --- a/common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang +++ b/common/src/main/resources/data/cobblemon/molang/npc/chatter-npc-interaction.molang @@ -1 +1,2 @@ -q.player.tell(q.npc.name + ': ' + q.npc.config.chat_message);q.npc.config.play_animation ? q.npc.play_animation(q.npc.config.animation_name, q.player.uuid); \ No newline at end of file +q.player.tell(q.npc.name + ': ' + q.npc.config.chat_message); +q.npc.config.play_animation ? q.npc.play_animation(q.npc.config.animation_name, q.player.uuid); \ No newline at end of file