Basic Methods

Return to Content Manager Page.

Basic Content Manager Methods:

onChangeTime()

This method is executed after every in-game second. Be careful what you add here, as any heavy code could easily impact the game performance.
No return value is expected.

setupMapEvents()

This method is executed while loading a new map. It’s used to generate objects (events) in the map.
No return value is expected.

setupNewGame()

This method is executed while starting a new game.
No return value is expected.

checkCutscenes(mapId)

This method is executed while transfering a player. It’s used to detect if a cutscene should be triggered in the new map.
The mapId argument holds the ID of the map that the player is being transfered to.
You can use $gameMap.mapId() to get the ID of the map that the player is being transfered from.

To register a cutscene to be played in the new map, use:

$gameTemp.reserveCutscene('cutscene_event_name');

If you want to make sure the player will be in a certain position when the cutscene starts, you can perform a new transfer:

$gamePlayer.reserveTransfer(mapId, x, y, direction, 0, false);

You need to return true if you reserved a cutscene, or false if you didn’t.

processNewDay()

This method is executed during the “new day” animation (when the player goes to bed or at 6AM when they stay awake).

No return value is expected.

configManager_makeData(config)

This method is used to change the game settings before they are saved. Whatever is added to the config object will be saved on disk.

No return is expected.

getCurrentSchedule(villagerName)

This method is used to get the name of the currently active schedule for the villager.

Return a schedule name as string, or undefined if you don’t want to change anything.

update()

This method is executed in every frame.

No return is expected.

applyItemDataModifiers(itemData)

This method is called every time the data of a game item is used. You can use this method to modify the item data, such as price, icon, amount of stamina restored, among other things.
The itemData param is an object holding all the item information. You are free to modify it’s properties directly instead of creating a new object.

Return the itemData param (modified or not) or a new object holding all the necessary data.

canCheckInput()

This method can be used to ignore player input (keyboard and gamepad).

Return true for normal behavior, or false to ignore player input.