Items

In Ranvier all items for an area are defined in a single file within the area folder: items.yml

Example File

bundles/ranvier-areas/areas/limbo/items.yml

- id: 1
  name: "Rusty Shiv"
  roomDesc: "a razor-sharp shiv coated in rust"
  keywords: [ "shiv", "rusty", "shank", "metal", "rust" ]
  description: "A short, jagged metal shard, discolored with red corrosion. Rather than a handle, someone has wrapped grimy grip tape around the base of the instrument."
  script: "1-shiv"
  slot: 'wield'
  attributes:
      speed: 10
      damage: 1-15
- id: 2
  name: "Slice of Cheese"
  roomDesc: "A moldy slice of cheese"
  keywords: [ "slice", "cheese", "moldy" ]
  description: "A yellow, slightly moldy slice of cheese. Only a rat could find this appetizing."
  behaviors:
    decay:
      duration: 240
- id: 3
  type: CONTAINER
  name: "Wooden Chest"
  roomDesc: "A wooden chest rests in the corner, its hinges badly rusted."
  keywords: [ "wooden", "chest" ]
  description: "Time has not been kind to this chest. It seems to be held together solely by the dirt and rust."
  items: [ "limbo:1" ]
- id: locked_chest
  type: CONTAINER
  name: "Locked Chest"
  roomDesc: "A steel chest sits in the corner."
  keywords: [ "locked", "chest" ]
  description: "Time has not been kind to this chest. It seems to be held together solely by the dirt and rust."
  items: [ "limbo:1" ]
  locked: true
  closed: true
  lockedBy: "limbo:test_key"
- id: test_key
  name: "Oddly-shaped Key"
  keywords: ["key", "odd", "oddly", "shaped"]
  roomDesc: "A strange looking key"
  description: "This key seems overly complex with numerous grooves."
  quality: common

Definition Fields

field type (default)


id number
required Item id unique among the items of the current area
type ItemType (OBJECT)
See src/ItemType.js. Natively, does not change functionality, simply a helpful flag for you to use in scripts to detect the item type
name string
required String seen while in the player's inventory or equipment list, or in a container
roomDesc string
required String displayed when the item is seen on the ground in a room
keywords string
required Keywords that the player can use to target this item; keywords do not need to be unique on a per-item basis
description string
String displayed when the player looks directly at the item
script string
Name of custom script to attach to this item (See Scripting)
behaviors Object<string,Object>
List of behaviors to attach to this item. The key is the behavior name, the value is the configuration object for that behavior. For boolean (on/off) behaviors, true suffices for the config. (See Scripting for more on creating behaviors)
slot string
If the item can be equipped, slot identifies the wear location of the item. This can be an arbitrary string but you probably want to limit equipment to a standard list of locations
attributes object
Arbitrary list of attributes to attach to this object. There are no constraints on this so you are free to assign basically anything here that you want to look for inside commands/scripts/etc. Accessible in scripts via the item.attributes property
items array<EntityReference>
For containers. A list of Entity References identifying which items should be loaded into this item's inventory
closeable boolean (false)
Whether this item can be closed/locked. If either closed or locked is set to true this is true by default.
closed boolean (false)
For containers, whether this item is closed by default or not. If true, this item can be opened/closed. If you want this item to be closed by default but allow it to be opened/closed set closeable to true
locked boolean (false)
For containers, whether this item is locked by default or not. Warning: setting locked: true without specifying a lockedBy will result in an item that cannot be opened.
lockedBy EntityReference
Which item acts as the key for this item