Feature Request: Include Item Position in GetKitObject API
Summary
The GetKitObject API currently doesn't include the Position property of items in the returned JSON, even though this information is stored internally in the ItemData class.
Problem
When using GetKitObject(string kitName), the returned JSON contains all item information except the slot position. This makes it impossible to know:
- Which hotbar slot an item should be placed in
- Which wear slot armor/clothing should occupy
- Which main inventory slot items belong to
Current Behavior
{
"Shortname": "rifle.ak",
"Amount": 1,
"SkinID": 0
// Position is missing!
}
Requested Behavior
{
"Shortname": "rifle.ak",
"Amount": 1,
"SkinID": 0,
"Position": 0
}
Technical Details
The ItemData class already has the Position property and it's populated correctly in the constructor:
Position = item.position; // This works
But it's not included in the ToJObject method:
// Missing this line in ToJObject:
["Position"] = Position,
Use Cases
- Building kit preview UIs that show exact item placement
- Creating kit comparison tools
- Developing inventory management plugins
- Analyzing kit layouts programmatically
Proposed Solution
Add the Position field to the ToJObject method in the ItemData class:
internal JObject ToJObject
{
get
{
if (_jObject == null)
{
_jObject = new JObject
{
["Shortname"] = Shortname,
["DisplayName"] = DisplayName,
["SkinID"] = Skin,
["Amount"] = Amount,
["Position"] = Position, // ← ADD THIS LINE
["Condition"] = Condition,
// ... rest of properties
};
}
return _jObject;
}
}
Impact
- Breaking Change: No
- Backward Compatible: Yes (just adds new field)
- Performance Impact: Negligible
- Implementation Effort: Very low (single line addition)
Priority
Medium - This would significantly improve the usefulness of the API for developers building kit-related tools and UIs.
Thank you for considering this enhancement!