Storstadsom

==General:==
The Storstadsom is a mostly neutral mob that uses auctions to trade. They usually spawn in End Cites as part of the structure and continue to occasionally spawn post-generation in End Cities. Every Storstadsom spawns with an inventory with 24 slots (the items in the inventory stack) which is filled with random items (they can be anything but items that are useful to an end-game player and more easily obtainable from the end are more common). They have a special 25th pseudo-slot for their main currency, rubies (which doesn't have a maximum stack size). Each Storstadsom starts with 0-100 rubies. They have an 8.5% chance to drop one of their items upon death.
==Appearance:==
Its head is 8 pixels tall, 8 pixels wide, and 10 pixels long (forward and backward). It has a nose in the middle of its front that is 2 pixels tall, 2 pixels wide, and 5 pixels long (forward and backward) Its body is bigger than its arms and legs (like a pillager) but it has fairly normally shaped arms and legs (like a player). A Storstadsom has beady black eyes. Their skin color is a randomly selected hex color (but colors closer to a very light tan are more likely). Each Storstadsom wears a suit. This suit has 6 features, the tie, the undershirt, the jacket/vest, the shoe, the leg wear (type varies), the top hat, and the monocle (the last two only have a 10% of appearing on a Storstadsom). Each feature has 5 variations and each feature's color is a randomly selected hex color.
==Auctions: ==
===Pre-Auction Phase: ===
Every 5 minutes or so, (unless it is participating in an auction already) a Storstadsom will scan the inventory of every other Storstadsom and player in a 10 block radius and choose the most valuable item in its inventory for it's auction. The value of an item is determined by the stack size (higher=more value), the average amount of the item in the inventories of everyone it scanned (lower=more value), and the value of an item tag shared by all items that measures its general value from the perspective of a Storstadsom (so items that are more useful and are harder to get in The End have a higher value for this tag). They will then check if the item's value is equal to or lower than the balance (in rubies) of the entity with the second highest balance. If not, it will repeat this process again, excluding the items that have already failed this check. If there are no items that fit the criteria, the auction fails and the Storstadsom waits for another 5 minutes. 
=== Starting An Auction: ===
Once its item is chosen, it will play a special sound and animation where it holds the chosen item above it's head and shows the item off (this Storstadsom becomes the 'host' of this auction). Every other Storstadsom not already participating in an auction as a host or a bidder in a 10 block radius will become the 'bidders' of this auction and will always they will still freely move but they will always try to stay of 2-6 blocks away from the host until the auction ends or they leave the auction. The price of the now-being-auctioned item is then set to 0 rubies. Finally, the host stops moving (but they can still rotate) and holds the item being auctioned until their auction ends. For both Storstadsom and player hosts (we'll get to that in a bit), other storstadsoms will become peaceful towards the host until the auction ends. 
===During An Auction:===
The host waits for a bidder (or a player) to bid. The Auction Each bidder decides if they'll bid. This is determined using roughly the same system as the one used to determine the value of an individual item before starting an auction, except the one being scanned is the bidder themself and the item having it's value determined is the item being auctioned by the host. In addition, the balance of the bidder is also considered (more rubies=higher value). After that the value is changed by a random modifier. The the resulting value is then capped at the total balance of the bidder and is rounded to the nearest integer. If no one bids within 60 seconds, the host gives the item being auctioned to the last bidder to bid and the auction ends (the host keeps it if no one else has ever bid). If the auction ends, the bidders disperse and the host waits for another 5 minutes before attempting to start another auction.
If the total value is greater than the price of the item being auctioned, the bidder chooses a random time between 0-59 seconds before bidding. If no one has bid before them, they play a different special animation and sound, the bidder gives to the host an amount of rubies equal to price+1, and then the price of the item being auctioned is raised by 1. (there is a 10% chance the bidder will give an extra ruby and raise the price again instantaneously. If that happens, there is a 10% chance it will happen again). A player can also choose to bid by Right Clicking the host with a ruby. When this happens, the player instantly loses a ruby, the host gains a ruby, and the price is raised by 1. If either a player or a Storstadsom bids, the auction continues, the process described in this section then repeats but the price of the item and the total balance (in rubies) of everyone involved does not get reset.
If the total value is less or equal to 0 then the bidder will leave the auction. This means that they are no longer a bidder in that auction and behave as so (for example, they can start and join auctions again). If the host is hurt, the host will start moving again to try to run away from the block or entity hurting it. If the host dies, the auction immediately ends and the last bidder to bid gets the item being held at the auction. If the threat has been neutralized, the host will go back to standing still.
===Player-Hosted Auctions:===
Players can host their own auctions by dropping an item while looking straight up and then catching it within ten blocks of a Storstadsom. (unless they're already in an auction). A player-hosted auction is like a normal auction but with these differences:
*The auction uses the item that was dropped as the item being auctioned instead of the item with the highest value.
*When someone bids, the host gets it in their normal inventory in a fashion similar to the /give command.
*The host can freely move and doesn't have to hold the item being used in the auction.
*The host isn't compelled to run away when attacked.
==Other Behavior: ==
When attacked, they do fight back if they aren't hosting an auction but they don't alert anyone else. If they are hosting an auction, they'll just run away from you, then fight you if the auction ends before their aggro does. While aggroing, they won't host an auction but they will become a bidder if they're within 10 blocks of a Storstadsom when they start an auction..
===Reputation:===
A player has a separate reputation value (that starts at 0) for each End City its been to, similarly to how villager reputation is localized to a single village. When your reputation value for an End City is at -10 or lower, all of the Storstadsom in the End City are hostile towards you too (although they become temporarily passive and run away from you when hosting an auction). They will continue to be hostile towards you until your reputation is at 0 or higher. You can gain reputation by hosting or winning an auction. 
Reputation Loss: 	Kill/Break	Hurt/Open
Storstadsom 	-20 	-2
Baby Storstadsom 	-40 	-4
Shulker 	-10 	-1
Crystalized Purpur/Chest with "from_end_city" set to "true"	 	
-2 	 	
==Variants:==
Storstadsoms have some special variants. These variants are like normal Storstadsoms but they make you lose/gain a different amount of reputation, and they also have the following traits listed below:
=== Baby Storstadsom: ===
They have a 10% chance to spawn from an Adult Storstadsom when they win an auction (be the last to bid in an auction). They inherit the skin color of their parent but they get their own unique suit. Baby Storstadsoms tend to follow their parent around and can't bid or host auctions. They become adults in 40 minutes. They are also 0.925 blocks tall, are always passive, make higher pitched sounds, and only have 12 health.
=== Storstadom (with map) ===
Spawns rarely anywhere in The End. It usually spawns with a couple of City Explorer Maps which it can then auction. These maps function like normal Explorer Maps except it maps out The End, its at maximum zoom out, its magenta, and it displays the location of a nearby End City. This trait of having maps is genetic, so their children will also have maps, and so will their children, and so on.
== Trivia==
*Since the bidders will constantly try to stay 2-6 blocks away from the host in an auction, the bidders will move with the host whenever the host runs away.
* The textures for the Storstadsom are black and white. The color is applied afterwards, like with leather armor.
*Storstadsoms are the End equivalent to Villagers and Piglins.
*"Storstadsom" is Swedish for "Metropolitan".
*Storstadsoms don't despawn while in an auction. They permanently persist if they win an auction, spawn during world generation, or host an auction that a player bids on.
*After the addition of Storstadsoms, chests generated in end cities have the nbt tag "from_end_city" set to "true" and spawn crystalized purpur underneath.
*Originally, the Storstadsoms were going to live in a mega structure called the "End Metropolis" which had a capital and a dense network of specialized end cities (that had friendly shulkers). However, that was ultimately scrapped in favor of improving the pre-existing end city and creating a seperate structure for the enderman. 
Category:Mobs
Category:The End Mobs
Category:Neutral Mobs
Category:Races
Category:Ender
Category:Entities
Category:USERNAMEITHINKIGUESSYEAH'S IDEAS
Category:Characters
Category:Males
Category:Females