### Run NeoForge test server Source: https://github.com/alessiogr/notquests/blob/main/CONTRIBUTING.md Starts a NeoForge 26.3 test server with the plugin loaded. ```bash ./gradlew :neoforge:runServer ``` -------------------------------- ### Install pinned toolchain with mise Source: https://github.com/alessiogr/notquests/blob/main/CONTRIBUTING.md Installs the pinned toolchain (Java 25 Temurin and Gradle 9.7.1) using mise. Requires mise to be installed. ```bash mise install ``` -------------------------------- ### Run Paper test server Source: https://github.com/alessiogr/notquests/blob/main/CONTRIBUTING.md Starts a Paper 26.3 test server with the plugin loaded. ```bash ./gradlew :paper:runServer ``` -------------------------------- ### Generate wrapper and build project Source: https://github.com/alessiogr/notquests/blob/main/CONTRIBUTING.md Generates the Gradle wrapper (one-time) and then builds the project. The wrapper jar is not committed, so use the mise-provided gradle initially. ```bash gradle wrapper # one-time: creates gradle/wrapper/gradle-wrapper.jar ./gradlew clean build # or: gradle clean build ``` -------------------------------- ### List all actions Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Lists all available actions. ```text qa actions ``` -------------------------------- ### Set JAVA_HOME to mise Java Source: https://github.com/alessiogr/notquests/blob/main/CONTRIBUTING.md Sets JAVA_HOME to the Java version provisioned by mise so Gradle launches with the pinned Java 25 toolchain. ```bash export JAVA_HOME="$(mise where java)" ``` -------------------------------- ### Run the E2E command sweep locally Source: https://github.com/alessiogr/notquests/blob/main/e2e/README.md Run the E2E command sweep locally: first the Paper sweep, then the NeoForge sweep with the same command list, and finally compare the generated platform metadata. Exit code 0 means pass; full server logs are written to /tmp/nq-e2e-paper-server.log and /tmp/nq-e2e-neoforge-server.log. ```bash ./e2e/run-sweep.sh # boots :paper:runServer, drives the console, then analyzes the log ./e2e/run-neoforge-sweep.sh # boots :neoforge:runServer with the exact same command list ./src/core/e2e/compare-platform-metadata.py ``` -------------------------------- ### Clone and enter NotQuests repository Source: https://github.com/alessiogr/notquests/blob/main/CONTRIBUTING.md Clones the NotQuests repository and changes into the project directory. ```bash git clone https://github.com/AlessioGr/NotQuests.git cd NotQuests ``` -------------------------------- ### List all conditions Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Lists all available conditions. ```text qa conditions ``` -------------------------------- ### Plugin jar output path Source: https://github.com/alessiogr/notquests/blob/main/CONTRIBUTING.md Path to the final plugin jar after building. ```text src/paper/build/libs/notquests-7.0.0-26.3-paper.jar ``` -------------------------------- ### Create Tags Source: https://github.com/alessiogr/notquests/blob/main/e2e/commands.txt Commands to create tags of various data types. ```bash qa tags create INTEGER testint qa tags create BOOLEAN testbool qa tags create STRING teststring qa tags create FLOAT testfloat qa tags create DOUBLE testdouble ``` -------------------------------- ### Set Quest Description, Display Name, and Category Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Sets basic quest metadata such as description, display name, and category. Replace TestQuest with your quest's name. ```shell qa edit TestQuest description set This is a smoke-test quest description qa edit TestQuest displayName set Smoke Test Quest qa edit TestQuest category set TestCategory ``` -------------------------------- ### Manage Categories Source: https://github.com/alessiogr/notquests/blob/main/e2e/commands.txt Commands to create and edit quest categories. ```bash qa categories create TestCategory qa categories edit TestCategory displayName set Test Category With Spaces ``` -------------------------------- ### List all quests Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Lists all quests. ```text qa list ``` -------------------------------- ### Add Actions Source: https://github.com/alessiogr/notquests/blob/main/e2e/commands.txt Commands to add various quest actions, including messaging, inventory management, and world interactions. ```bash qa actions add ActMsg SendMessage Hello there adventurer qa actions add ActBroadcast BroadcastMessage A server-wide announcement qa actions add ActTitle ShowTitle Quest Complete qa actions add ActTimedTitle ShowTitle timed 250ms 2s 500ms Quest Complete|Nice work qa actions add ActActionBar ShowActionBar Objective updated qa actions add ActConsole ConsoleCommand say hello from the console qa actions add ActPlayerCmd PlayerCommand me waves qa actions add ActChat Chat Hello from the player qa actions add ActGiveQuest GiveQuest TestQuest qa actions add ActCompleteQuest CompleteQuest TestQuest qa actions add ActFailQuest FailQuest TestQuest qa actions add ActTriggerCmd TriggerCommand mytrigger qa actions add ActGiveItem GiveItem stone,dirt 5 qa actions add ActGiveItemBoat GiveItem acacia_boat 2 --delay 500ms qa actions add ActSpawnMob SpawnMob zombie 3 Location world 100 64 100 qa actions add ActPlaySound PlaySound entity.experience_orb.pickup qa actions add ActParticle SpawnParticle happy_villager 8 PlayerLocation qa actions add ActTeleport Teleport world 100 70 100 qa actions add ActBeam Beam mybeam spawn world 100 70 100 # UNSURE qa actions add ActGiveQP GiveQuestPoints 10 # UNSURE qa actions add ActGrantPerm GrantPermission notquests.e2e.test # UNSURE qa actions add ActOpenGui OpenGui questsoverview # PLAYER-ONLY qa actions add ActCloseInv CloseInventory # PLAYER-ONLY qa actions add ActStartConv StartConversation testconversation # UNSURE qa actions add ActGiveMoney GiveMoney 100 # NEEDS-ECONOMY ``` -------------------------------- ### Add variable-based actions via qa actions add Source: https://github.com/alessiogr/notquests/blob/main/e2e/commands.txt Commands to add variable-based actions using tag/list/itemstack variables. The ActList, ActItemStackList, and ActChain entries are marked as UNSURE. ```text qa actions add ActNumber TagInteger testint set 5 ``` ```text qa actions add ActString TagString teststring set hello ``` ```text qa actions add ActBoolean TagBoolean testbool set true ``` ```text qa actions add ActList ActiveQuests set TestQuest # UNSURE ``` ```text qa actions add ActItemStackList Inventory set stone 1 # UNSURE ``` ```text qa actions add ActChain Action ActMsg # UNSURE ``` -------------------------------- ### Good: Self-contained command registration Source: https://github.com/alessiogr/notquests/blob/main/AGENTS.md Shows the recommended style: a command feature is self-contained in the registration, using small reusable helpers like objectiveId and player. This keeps behavior readable from the command registration itself. ```java command.literal("location", NQDescription.of("Manages this objective's guiding marker.")) .literal("set", NQDescription.of("Sets the marker location.")) .literal("here", NQDescription.of("Uses your current in-game block position.")) .handler(ctx -> List.of(runner.setObjectiveLocation( quest(ctx), objectiveId(ctx), player(ctx).worldName(), player(ctx).blockX(), player(ctx).blockY(), player(ctx).blockZ()))); ``` -------------------------------- ### QA read-only checks and list commands Source: https://github.com/alessiogr/notquests/blob/main/e2e/commands.txt Read-only QA commands for inspecting variables, conditions, objectives, and available actions/conditions. Use these to verify variable values, test conditions, list objectives, and export the command schema. ```text qa variables check TagInteger testint ``` ```text qa variables check RandomNumberBetweenRange 1 10 ``` ```text qa variables check Block world 100 64 100 ``` ```text qa variables check FoodLevel ``` ```text qa variables check Saturation ``` ```text qa variables check DistanceToLocation world 100 64 100 ``` ```text qa variables check NearbyEntityCount any 25 ``` ```text qa variables check Weather ``` ```text qa conditions check WorldTime 0 12000 ``` ```text qa edit TestQuest objectives list ``` ```text qa debug exportCommandSchema ``` ```text qa list ``` ```text qa actions ``` ```text qa conditions ``` -------------------------------- ### Add literal-typed conditions via qa conditions add Source: https://github.com/alessiogr/notquests/blob/main/e2e/commands.txt Commands to add literal-typed conditions. Several entries are marked UNSURE, and CondMoney requires an economy plugin. ```text qa conditions add CondTime WorldTime 0 12000 ``` ```text qa conditions add CondQP QuestPoints more 5 ``` ```text qa conditions add CondPerm Permission notquests.e2e.test # UNSURE ``` ```text qa conditions add CondCompletedQuest CompletedQuest TestQuest # UNSURE ``` ```text qa conditions add CondActiveQuest ActiveQuest TestQuest # UNSURE ``` ```text qa conditions add CondDate Date after 2024-01-01 # UNSURE ``` ```text qa conditions add CondMoney Money 100 # NEEDS-ECONOMY ``` ```text qa conditions add CondCond Condition CondTime # UNSURE ``` -------------------------------- ### Add variable-based conditions via qa conditions add Source: https://github.com/alessiogr/notquests/blob/main/e2e/commands.txt Commands to add variable-based conditions via tags. CondList and CondItemList entries are marked as UNSURE. ```text qa conditions add CondNumber TagInteger testint moreThan 3 ``` ```text qa conditions add CondStr TagString teststring equals hello ``` ```text qa conditions add CondBool TagBoolean testbool equals true ``` ```text qa conditions add CondList ActiveQuests contains TestQuest # UNSURE ``` ```text qa conditions add CondItemList Inventory contains stone 1 # UNSURE ``` -------------------------------- ### Add quest rewards SendMessage, GiveItem, ShowActionBar, TagInteger Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Adds quest rewards: sends a message, gives one diamond, shows an action bar message, and adds 10 to the 'testint' tag. ```text qa edit TestQuest rewards add SendMessage You finished the quest ``` ```text qa edit TestQuest rewards add GiveItem diamond 1 ``` ```text qa edit TestQuest rewards add ShowActionBar Reward delivered ``` ```text qa edit TestQuest rewards add TagInteger testint add 10 ``` -------------------------------- ### Export command schema Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Exports the command schema for debugging purposes. ```text qa debug exportCommandSchema ``` -------------------------------- ### Bad: Split command with enum and switch Source: https://github.com/alessiogr/notquests/blob/main/AGENTS.md Shows an anti-pattern where a command is split across an enum, a central switch, and a handler method, making behavior hard to read. Avoid this style. ```java enum AdminEditOperation { SET_OBJECTIVE_LOCATION_HERE } command.literal("location").literal("set").literal("here") .handler(ctx -> handlers.run(operation)); return switch (operation) { case SET_OBJECTIVE_LOCATION_HERE -> setObjectiveLocationHere(ctx); }; ``` -------------------------------- ### Check quest variables Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Read-only checks for quest variables. Each command verifies a variable type with optional arguments. ```text qa variables check TagInteger testint qa variables check RandomNumberBetweenRange 1 10 qa variables check Block world 100 64 100 qa variables check FoodLevel qa variables check Saturation qa variables check DistanceToLocation world 100 64 100 qa variables check NearbyEntityCount any 25 qa variables check Weather ``` -------------------------------- ### Add Objectives for Multiple Quest Types Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Adds a comprehensive set of objectives to the quest TestQuest. Each line follows the pattern `qa edit objectives add ...`. Lines marked UNSURE indicate uncertain syntax, and PLAYER-ONLY indicates objectives that require a player entity (likely cannot be used in console commands). ```shell qa edit TestQuest objectives add BreakBlocks grass_block,dirt,stone 5 qa edit TestQuest objectives add BreakBlocks diamond_ore 5 qa edit TestQuest objectives add PlaceBlocks stone,cobblestone 5 qa edit TestQuest objectives add Harvest wheat,carrot,potato,beetroot,melon,pumpkin,sugar_cane,cactus 5 qa edit TestQuest objectives add PickupItems acacia_boat,oak_boat 5 qa edit TestQuest objectives add ConsumeItems apple,bread 5 qa edit TestQuest objectives add CraftItems torch,stick 5 qa edit TestQuest objectives add SmeltItems iron_ingot,gold_ingot 5 qa edit TestQuest objectives add BrewItems potion 5 qa edit TestQuest objectives add SmithItems netherite_sword 1 qa edit TestQuest objectives add TradeWithVillager emerald 1 qa edit TestQuest objectives add FishItems cod,salmon 5 qa edit TestQuest objectives add Enchant sharpness diamond_sword,iron_sword 5 qa edit TestQuest objectives add KillMobs zombie 5 qa edit TestQuest objectives add BreedMobs cow 5 qa edit TestQuest objectives add FeedMobs cow 5 qa edit TestQuest objectives add TameMobs wolf 1 qa edit TestQuest objectives add Die 1 qa edit TestQuest objectives add Die 1 --cause fall qa edit TestQuest objectives add Jump 10 qa edit TestQuest objectives add Sneak 10 qa edit TestQuest objectives add ShearSheep 5 qa edit TestQuest objectives add MilkCow 5 qa edit TestQuest objectives add OpenBuriedTreasure 1 qa edit TestQuest objectives add RunCommand 1 /spawn qa edit TestQuest objectives add ShootArrow 3 world 100 64 100 5 qa edit TestQuest objectives add ReachLocation world 100 64 100 5 Test Target qa edit TestQuest objectives add TriggerCommand mytrigger 1 qa edit TestQuest objectives add OtherQuest TestQuest 1 qa edit TestQuest objectives add Condition CondTime qa edit TestQuest objectives add NumberVariable TagInteger testint equals 5 qa edit TestQuest objectives add DeliverItems stone,dirt 5 -1 # UNSURE qa edit TestQuest objectives add Interact 1 world 100 64 100 # UNSURE qa edit TestQuest objectives add Interact 1 looking # PLAYER-ONLY qa edit TestQuest objectives add Objective TestHolder # UNSURE qa edit TestQuest objectives add TalkToNPC -1 # PLAYER-ONLY ``` -------------------------------- ### List quest objectives Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Lists the objectives of an existing quest. ```text qa edit TestQuest objectives list ``` -------------------------------- ### Clone and edit a quest Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Clones an existing quest and edits the copy. Use the cloned quest's name in subsequent commands. The final command deletes the cloned quest. ```text qa clone TestQuest ClonedQuest qa edit ClonedQuest description set A separate copy qa edit ClonedQuest objectives list qa delete ClonedQuest ``` -------------------------------- ### Check quest condition Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Read-only check for a quest condition. Verifies the WorldTime condition with a time range. ```text qa conditions check WorldTime 0 12000 ``` -------------------------------- ### Add quest requirements WorldTime and TagInteger Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Adds quest requirements: a WorldTime requirement (time between 0 and 12000) and a TagInteger requirement that the tag 'testint' must be at least 1. ```text qa edit TestQuest requirements add WorldTime 0 12000 ``` ```text qa edit TestQuest requirements add TagInteger testint moreOrEqualThan 1 ``` -------------------------------- ### Objective location marker commands Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Commands to set, check, enable, disable, and clear the location marker for objective 1 of TestQuest. The final command re-sets the location after clearing it. ```text qa edit TestQuest objectives edit 1 location set world 100 64 100 ``` ```text qa edit TestQuest objectives edit 1 location status ``` ```text qa edit TestQuest objectives edit 1 location enable ``` ```text qa edit TestQuest objectives edit 1 location disable ``` ```text qa edit TestQuest objectives edit 1 location clear ``` ```text qa edit TestQuest objectives edit 1 location status ``` ```text qa edit TestQuest objectives edit 1 location set world 100 64 100 ``` -------------------------------- ### Add triggers for ActMsg events Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Adds triggers that reference the existing ActMsg action for various events: BEGIN, COMPLETE, FAIL, DEATH, DISCONNECT, WORLDENTER, WORLDLEAVE, and NPCDEATH. The last two are marked as UNSURE. ```text qa edit TestQuest triggers add ActMsg BEGIN ``` ```text qa edit TestQuest triggers add ActMsg COMPLETE ``` ```text qa edit TestQuest triggers add ActMsg FAIL ``` ```text qa edit TestQuest triggers add ActMsg DEATH 1 ``` ```text qa edit TestQuest triggers add ActMsg DISCONNECT 1 ``` ```text qa edit TestQuest triggers add ActMsg WORLDENTER world 1 ``` ```text qa edit TestQuest triggers add ActMsg WORLDLEAVE world 1 # UNSURE ``` ```text qa edit TestQuest triggers add ActMsg NPCDEATH 0 1 # UNSURE ``` -------------------------------- ### Add objective-scoped condition CompletedObjective Source: https://github.com/alessiogr/notquests/blob/main/src/core/e2e/commands.txt Adds an objective-scoped condition that requires completing objective 2. The comment marks it as objective-scoped. ```text qa edit TestQuest objectives edit 1 conditions add CompletedObjective 2 # OBJECTIVE-SCOPED ```