Game State Queries

BETAS adds 62 new Game State Queries for you to use. Some were made primarily with the intent to use them alongside the new triggers or new trigger actions added by BETAS, but they can all be used in whatever Condition fields you see fit. These game state queries, unless otherwise stated, support tokenizable strings (including those added by BETAS).

If a parameter is wrapped in < > then it is a required parameter. If the parameter is wrapped in [] then it is an optional parameter. If the parameter has a + after it, that means you can provide multiple of that parameter separated by spaces. If a parameter starts with # then it expects a number. If it ends with ? then it expects true/false. If neither, it expects a string.

All of the Game State Queries listed here must be prefixed with Spiderbuttons.BETAS_! This prefix was removed in these docs for brevity but they will not work without it! For example, HAS_MOD MUST be written as Spiderbuttons.BETAS_HAS_MOD in your actual mod!

Game State Queries by Category:

MISC

CONDITION EFFECT
CURRENT_SONG [SongName]+ Whether or not the name of the currently playing song matches any given SongName. If a SongName is not provided, this checks whether any song is currently playing
GIANT_CROP_GROWN <GiantCrop Id> Whether or not a giant crop is grown anywhere in the world and matches the given GiantCrop Id (as found in Data/GiantCrops)
GOLD_CLOCK_ACTIVE Whether or not a Gold Clock is both built and turned on.
GRANDPA_SCORE <Scoring> <#Min> [#Max] Whether or not the farm's score, as evaluated by dearly departed Grandpa, is between #Min and #Max (default unlimited). The Scoring parameter must be either Score or Candles. The former checks the raw score (see Utility.getGrandpaScore() in the decompile) and the latter checks how many candles dearly departed Grandpa thinks he should light. This query can be used before dearly departed Grandpa actually lights the candles.
HAS_MOD <ModId>+ Whether or not a mod that matches any ModId is found and loaded
ITEM_IN_WORLD <ItemId>+ Whether or not an item with a matching ItemId exists anywhere in the world. This searches inventories, chests, placed furniture, equipped items, etc.
SALOON_DISH <ItemId>+ Whether or not the dish of the day at the Saloon matches any given ItemId
TOTAL_CROPS <#Min> [#Max] [ItemId]+ Whether or not the total number of crops fully grown in the world is between #Min and #Max (default unlimited) inclusively. Set #Max to -1 to make it unlimited when providing an ItemId. If an ItemId is specified, this will only count crops corresponding to that ID. You can specify the ItemId of the seed or the crop the seed grows into
TOTAL_PETS <#Min> [#Max] [PetType]+ Whether or not the number of pets on the farm or in the farmhouse/cabins is between #Min and #Max (default unlimited) inclusively. Set #Max to -1 to make it unlimited when providing a PetType. If a PetType is specified, this will only count pets with a matching type (e.g. Cat or Turtle)
USING_SEPARATE_WALLETS <ItemId>+ Whether or not the current save file is using separate wallets for different farmers
VOLUME <Category> <#Min> [#Max] Whether or not the volume level of the given Category is set between #Min and #Max (default unlimited). The Category can be Music, Sound, Ambient, or Footstep
WEATHER_FOR_TOMORROW <ContextID> <Weather>+ Whether or not any Weather matches the weather forecast for tomorrow for the given location ContextID.

MOD DATA

CONDITION EFFECT
ITEM_MOD_DATA <Item> <Key> [Value] Whether or not the specified item has a mod data entry with the given Key and Value. If no Value is given, this query checks whether the Key exists at all
ITEM_MOD_DATA_RANGE <Item> <Key> <#Min> [#Max] If the specified item has a mod data entry with the given Key and the Value is an integer, this query checks whether that Value is between the #Min and #Max (default unlimited)
ITEM_MOD_DATA_CONTAINS <Item> <Key> <Value>+ If the specified item has a mod data entry with the given Key and the Value is a space- or comma-delimited list, this query checks whether that list contains any given Value
PLAYER_MOD_DATA <Player> <Key> [Value] Whether or not the specified player has a mod data entry with the given Key and Value. If no Value is given, this query checks whether the Key exists at all
PLAYER_MOD_DATA_RANGE <Player> <Key> <#Min> [#Max] If the specified player has a mod data entry with the given Key and the Value is an integer, this query checks whether that Value is between the #Min and #Max (default unlimited)
PLAYER_MOD_DATA_CONTAINS <Player> <Key> <Value>+ If the specified player has a mod data entry with the given Key and the Value is a space- or comma-delimited list, this query checks whether that list contains any given Value
LOCATION_MOD_DATA <Location> <Key> [Value] Whether or not the specified location has a mod data entry with the given Key and Value. If no Value is given, this query checks whether the Key exists at all
LOCATION_MOD_DATA_RANGE <Location> <Key> <#Min> [#Max] If the specified location has a mod data entry with the given Key and the Value is an integer, this query checks whether that Value is between the #Min and #Max (default unlimited)
LOCATION_MOD_DATA_CONTAINS <Location> <Key> <Value>+ If the specified location has a mod data entry with the given Key and the Value is a space- or comma-delimited list, this query checks whether that list contains any given Value
FARM_MOD_DATA <Key> [Value] Whether or not the farm has a mod data entry with the given Key and Value. If no Value is given, this query checks whether the Key exists at all
FARM_MOD_DATA_RANGE <Key> <#Min> [#Max] If the farm has a mod data entry with the given Key and the Value is an integer, this query checks whether that Value is between the #Min and #Max (default unlimited)
FARM_MOD_DATA_CONTAINS <Key> <Value>+ If the farm has a mod data entry with the given Key and the Value is a space- or comma-delimited list, this query checks whether that list contains any given Value
GLOBAL_MOD_DATA <UniqueId> <Key> [Value] Whether or not the global mod data for your mod, identified by your UniqueId, has an entry with the given Key and Value. If no Value is given, this query checks whether the Key exists at all

This query requires you to enable certain Advanced Permissions.

GLOBAL_MOD_DATA_RANGE <UniqueId> <Key> <#Min> [#Max] If the global mod data for your mod, identified by your UniqueId, has an entry with the given Key and the Value is an integer, this query checks whether that Value is between the #Min and #Max (default unlimited)

This query requires you to enable certain Advanced Permissions.

GLOBAL_MOD_DATA_CONTAINS <UniqueId> <Key> <Value>+ If the global mod data for your mod, identified by your UniqueId, has an entry with the given Key and the Value is a space- or comma-delimited list, this query checks whether that list contains any given Value

This query requires you to enable certain Advanced Permissions.

PLAYER

CONDITION EFFECT
PLAYER_ANNIVERSARY_TODAY <Player> Whether or not the specified player has a wedding anniversary today
PLAYER_BACKPACK_SIZE <Player> <#Min> [#Max] Whether or not the backpack size of the specified player is between the #Min and #Max (default unlimited)
PLAYER_DANCE_PARTNER <Player> [NPC] Whether or not the specified player has a dance partner for the flower dance. If NPC is set to Farmer, this checks whether or not the player's partner is another farmer. If NPC is set to an NPC name, this checks whether or not they are partnered with a specific NPC. If no NPC is specified, this checks whether or not the player has any dance partner at all.
PLAYER_DAYS_MARRIED <Player> <#Min> [#Max] Whether or not the specified player has been married for at least #Min days and at most #Max days (default unlimited)
PLAYER_DAYS_UNTIL_HOUSE_UPGRADE <Player> <#Min> [#Max] Whether or not the specified player has a house upgrade set to finish between #Min days and at most #Max days (default unlimited)
PLAYER_EMPTY_INVENTORY_SLOTS <Player> <#Min> [#Max] Whether or not the number of empty inventory slots in the backpack of the specified player is between the #Min and #Max (default unlimited)
PLAYER_FULL_INVENTORY_SLOTS <Player> <#Min> [#Max] Whether or not the number of full inventory slots in the backpack of the specified player is between the #Min and #Max (default unlimited)
PLAYER_FESTIVAL_SCORE <Player> <#Min> [#Max] Whether or not the specified player has a festival score (e.g. star tokens) between #Min and #Max (default unlimited)
PLAYER_HAS_COOKED_ITEM <Player> <ItemId> [#Min] [#Max] Whether or not the specified player has cooked the item with the given unqualified ItemId between #Min (default 1) and #Max (default unlimited) times.
PLAYER_HAS_CRAFTED_ITEM <Player> <RecipeId> [#Min] [#Max] Whether or not the specified player has crafted the crafting recipe with the given RecipeId between #Min (default 1) and #Max (default unlimited) times.
PLAYER_HAS_EQUIPPED <Player> <ItemId>+ Whether or not the specified player has an item equipped that matches any given ItemId. This checks the currently equipped tool, clothing, rings, and trinkets.
PLAYER_HAS_QUEST <Player> <QuestId> Whether or not the specified player has the quest with the given QuestId currently in their quest log.
PLAYER_HEALTH <Player> <#Min> [#Max] Whether or not the current health of the specified player is between the #Min and #Max (default unlimited)
PLAYER_MAX_HEALTH <Player> <#Min> [#Max] Whether or not the maximum health of the specified player is between the #Min and #Max (default unlimited)
PLAYER_STAMINA <Player> <#Min> [#Max] Whether or not the current stamina of the specified player is between the #Min and #Max (default unlimited)
PLAYER_MAX_STAMINA <Player> <#Min> [#Max] Whether or not the maximum stamina of the specified player is between the #Min and #Max (default unlimited)
PLAYER_HELD_ITEM <Player> <ItemId>+ Whether or not the specified player is currently holding an item with a matching ItemId. The item does not need to be held above their head but simply held in their hands (i.e. selected on the hotbar) to account for things such as tools or furniture
PLAYER_MOUNTED <Player> Whether or not the specified player is currently riding a horse or other mount
PLAYER_PERFECTION_ITEMS_SHIPPED <Player> <Calculation> <#Min> [#Max] Whether or not the perfection progress for shipped items of the specified player is between the #Min and #Max (default unlimited). Calculation can be either Raw or Percent. If set to Raw, this will check the number of distinct items the player has shipped. If set to Percent, this will check the percentage of distinct items shipped out of the total number of shippable items in the game.
PLAYER_PERFECTION_FISH_CAUGHT <Player> <Calculation> <#Min> [#Max] Whether or not the perfection progress for fish caught of the specified player is between the #Min and #Max (default unlimited). Calculation can be either Raw or Percent. If set to Raw, this will check the number of distinct fish the player has caught. If set to Percent, this will check the percentage of distinct fish caught out of the total number of fish in the game.
PLAYER_PERFECTION_RECIPES_COOKED <Player> <Calculation> <#Min> [#Max] Whether or not the perfection progress for recipes cooked of the specified player is between the #Min and #Max (default unlimited). Calculation can be either Raw or Percent. If set to Raw, this will check the number of distinct recipes the player has cooked. If set to Percent, this will check the percentage of distinct recipes cooked out of the total number of cooking recipes in the game.
PLAYER_PERFECTION_RECIPES_CRAFTED <Player> <Calculation> <#Min> [#Max] Whether or not the perfection progress for recipes crafted of the specified player is between the #Min and #Max (default unlimited). Calculation can be either Raw or Percent. If set to Raw, this will check the number of distinct recipes the player has crafted. If set to Percent, this will check the percentage of distinct recipes crafted out of the total number of crafting recipes in the game.
PLAYER_PERFECTION_FRIENDSHIP <Player> <Calculation> <#Min> [#Max] Whether or not the perfection progress for friendships maxed of the specified player is between the #Min and #Max (default unlimited). Calculation can be either Raw or Percent. If set to Raw, this will check the number of maxed friendships the player has. If set to Percent, this will check the percentage of maxed friendships the player has out of the total number of socializable NPCs in the game.
PLAYER_SPEED <Player> <#Min> [#Max] Whether or not the specified player has a speed between #Min and #Max (default unlimited). For this query, #Min and #Max are floats (i.e. they can have decimals)
PLAYER_SPOUSE_GENDER <Player> <Gender> Whether or not the specified player has a spouse that is Female, Male, or Undefined
PLAYER_STARDROPS_FOUND <Player> <#Min> [#Max] Whether or not the specified player has found at least #Min Stardrops and at most #Max Stardrops (default unlimited)
PLAYER_SWIMMING <Player> Whether or not the specified player is currently swimming
PLAYER_WEDDING_TODAY <Player> Whether or not the specified player has a wedding today

NPCs

CONDITION EFFECT
NPC_IS_SINGLE <NPC>+ Whether or not any given NPC is currently single i.e. not dating, engaged, or married to any player.
NPC_KISSED_TODAY <NPC>+ Whether or not any given NPC has been kissed today by any player.
NPC_LOCATION <NPC> <Location>+ Whether or not the given NPC is currently in any given Location. If you put Any instead of an NPC name, this query will check whether there is any NPC in any given Location
NPC_NEAR_AREA <Location> <#X> <#Y> <#Radius> [NPC]+ Whether or mot any given NPC is within the given Radius (in tiles) of the #X and #Y coordinates of the given Location. If no NPC is given, this query checks whether there is any NPC at all within the #Radius of the given #X and #Y coordinates
NPC_NEAR_NPC <TargetNPC> <#Radius> [NPC]+ Whether or not any given NPC is within the given #Radius (in tiles) of the TargetNPC. If no NPC is given, this query checks whether there is any NPC at all within the #Radius of the TargetNPC
NPC_NEAR_PLAYER <Player> <#Radius> [NPC]+ Whether or not any given NPC is within the given #Radius of the specified player. If no NPC is given, this query checks whether there is any NPC at all within the #Radius (in tiles) of the player. For Farmhands, this is only accurate for the Current player or players in the same location as them

LOCATIONS

CONDITION EFFECT
LOCATION_HAS_FURNITURE <Location> <FurnitureID>+ Whether or not the specified location has any furniture placed in it that matches any given FurnitureID. You may use Any or All for the Location parameter in addition to the usual ways of specifying locations
LOCATION_HAS_NPC <Location> [NPC]+ Whether or not the specified location has any given NPC in it. If no NPC is given, this query checks whether there is any NPC at all within the Location

FOR ITEMS ONLY

CONDITION EFFECT
ITEM_ENCHANTMENTS <Item> [Enchantment]+ Whether the specified item has an enchantment on it that matches the name of any given Enchantment. If no Enchantment is specified, this checks whether the item has any enchantment on it at all

QUERIES WITH SIDE EFFECTS

Unlike normal Game State Queries, these queries make some kind of change simply through the act of being checked, regardless of whether or not they return true or false and regardless of whether or not you have an action to go with them. This includes if you check them via debug commands. Please keep this in mind.

CONDITION EFFECT
CHECK_AND_SET_MAIL <Mail ID> [Mailbox Type] Whether the current player has the specified Mail ID in the given Mailbox Type before this condition is checked. After this condition is checked, the mail in question will be added to the mailbox specified in the query for the current player. Mailbox Type (default Any) may be one of Mailbox, Tomorrow, Received, or Any. If Any is used, then the mail will be added to all of the mailbox types after the query is checked.
For example, if you write CHECK_AND_SET_MAIL MyFlag Received and the current player does not have the MyFlag mail flag, this query will return false and then give the current player the MyFlag mail flag into their received mail. If the current player does have the MyFlag mail flag when this query is checked, it will return true and do nothing else (because the player already has it).
CHECK_AND_REMOVE_MAIL <Mail ID> [Mailbox Type] Whether the current player has the specified Mail ID in the given Mailbox Type before this condition is checked. After this condition is checked, the mail in question will be removed from the mailbox specified in the query for the current player. Mailbox Type (default Any) may be one of Mailbox, Tomorrow, Received, or Any. If Any is used, then the mail will be removed from all of the mailbox types after the query is checked.
For example, if you write CHECK_AND_REMOVE_MAIL MyFlag Any and the current player does not have the MyFlag mail flag in any mailbox, this query will return false and do nothing else (because the player does not have it). If the current player does have the MyFlag mail flag in some mailbox when this query is checked, it will return true and then remove the MyFlag mailflag from every mailbox type.