Having trouble to get scripts loaded

Trying to make my first module and I have troubles getting anything loaded in Foundry. Here is what I have done so far: 1. Made the module using the Foundry admin UI view. 2. Added that module to one of my worlds. 3. Created a script to scripts/ folder of the module (I edit these files directly in the module folder). 4. Added the script to the module.json
{
"id": "test",
"title": "Test",
"version": "0.0.1",
"compatibility": {
"minimum": "11",
"verified": "11"
},
"scripts": [
"scripts/test.js"
],
}`
{
"id": "test",
"title": "Test",
"version": "0.0.1",
"compatibility": {
"minimum": "11",
"verified": "11"
},
"scripts": [
"scripts/test.js"
],
}`
However, whatever I add to the test.js file does not get loaded when I reload Foundry.
console.log("Hello World! This code runs immediately when the file is loaded.");

Hooks.on('init', () => {
console.log("init");
});

Hooks.on('ready', () => {
console.log("ready");
});
console.log("Hello World! This code runs immediately when the file is loaded.");

Hooks.on('init', () => {
console.log("init");
});

Hooks.on('ready', () => {
console.log("ready");
});
What could be the issue and how do I get started with module development?
Solution:
You dont want to log out, you want to shut off the world entirely.
V
Vauxs97d ago
Exit the world and go back into it. module.json does not get updated on refresh.
N
Nash97d ago
@Vauxs Thanks! Is that then the fastest way to do development? Do I always need to exit the world to test my changes?
LTL
Leo The League Lion97d ago
@Nash gave :vote: LeaguePoints™ to @Vauxs (#227 • 3)
N
Nash97d ago
Although it still does not seem to work. Even when logging out and back in, I do not see those console logs :(
Solution
V
Vauxs97d ago
You dont want to log out, you want to shut off the world entirely.
V
Vauxs97d ago
module.json is the only file that requires a full world reload, and you shouldn't have to modify it often.
N
Nash97d ago
Ah yes, now I got it. It works! Thanks!
Z
Zhell97d ago
You have a comma in your manifest where you shouldn't.
Want results from more Discord servers?
Add your server
More Posts
Help Needed! Dynamic Table for Reputation TrackingHello, everyone. I am still encountering an issue with my Reputation Tracking system. In the actor Newbie questions on testing.Hi all, ive put together a simple module for PF2E that allows a user to favorite a spell, feat, itemTrouble with Synthetic Actors (unlinked tokens)When I create a token from an actor and try to update something like its hp, I get the following errAvoid Sheet Re-render When Editing Actor's Item**TL;DR** How do I avoid a re-render of a character sheet with actor.items displayed, that happens wHow to Create & Save Custom Field Values from a Dropdown on Actor sheet?I am building a custom system for a Hogwarts setting using the Wands & Wizards 5e supplement. I am cFinding target when making an attackI’m developing a game system, and can’t figure it out, when there is combat active and a player is tTrying to register a new systemHey everyone, I am new to Foundry system development. I am working with the boilerplate system and hMinimise Document using PrototypeQuick question, I've got no idea what I'm doing so please excuse my ineptitude. Say I have a documenNew to System Development but have done minor module developmentI am trying to see if there is a complete working model of a system that I could use a base to undercalculating range/distanceI am trying to calculate the distance between two tokens to make sure they are in range of one anothPartial RerollI am looking for a way to partially "reroll" a roll. Quick example: Player rolls 2d6 (a 2 and a 5) atiered status effectsIf I have a status effect that can come from an ability, for example, burning comes from an ability Importing an npm package into a foundry systemimport minimist from 'minimist'; That line alone when included in my module's hook file is resultin(Paid) System Dev AssistanceHello, I am developing a new game and would like to build my own game system in foundry vtt. I'm nothow to handle items and effects?I've been working on a system for a game that needs a concept that seems like it might be a good fitAdvice on the general programming model a system should followI'm brand new to foundry dev and I want to make sure I am gaining the correct understanding of the eAdvice for compendium data in a custom systemHello, i'm new here! I was wondering if I could get a little direction for storing data about my gaDialog Box Auto-Closing Upon Opening 2nd TimeI've been appending custom functionality to the simple worldbuilding system. At this time, I'm tryinActor collisionImplementing the homebrew knockback feature. It's almost working but how do I test if two actor tokeActor attributes update on player's sideI can't fathom how to make changes to actor attributes on player's side. According to documentation