FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
roramigator
roramigatorlootGenAPI
Public
Like
2
lootGenAPI
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Settings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
main.tsx
https://roramigator--0c8c641626d911f0a5b3569c3dd06744.web.val.run
README.md

Loot Generator API

How It Works

Components

The Loot Generator API creates random loot items by combining:

  • 30 adjectives
  • 29 materials
  • 15 item types

resulting in 13,050 possible items.

Legendary Items

Occasionally, a rare legendary item is generated. An item becomes legendary if all three components are rare. Rarity is determined by a threshold:

Threshold = max(1,⌊log(length)×0.6⌋)

Probability of a legendary item with the default settings:

P(Legendary) = 1/13,050 ≈ 0.00766%

Only one legendary item is possible: ✨💎 Arcane Diamond Rock.

Customization

You can expand the lists or adjust the 0.6 multiplier to control rarity.

HTTP
  • main.tsx
    roramigator--0c…44.web.val.run
Code
README.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.