Attendees play video games at trade fair in Paris, France, October 29, 2019.
Attendees play video games at trade fair in Paris, France, October 29, 2019. Reuters / BENOIT TESSIER

Spain is set to become the first European country to have a law regulating the use of so-called loot boxes in videogames, aiming to avoid "thoughtless, compulsive or even pathological" consumer behaviour, the government said on Wednesday.

The loot boxes - digital packages of virtual items that can be purchased using real money - are an important source of developers' revenue. They give players the chance to win desirable or often randomised game-changing equipment, and allow gaming companies a stream of high-margin income.

Consumer Minister Alberto Garzon said the government will in a few weeks regulate gaming features that offer prizes with an economic value in a real or virtual market and that can be resold or exchanged, including using non-fungible tokens (NFTs) or cryptocurrencies.

Loot boxes have introduced similar features to those of traditional gambling, including the randomness of prizes that have a quantifiable value, and a cost to activate the mechanism.

In a statement Garzon said the law would allow gamers to have fun while preserving their health and, in particular, that of the most vulnerable, though he didn't give details of exactly what the regulation would entail.

Three out of 10 Spanish students spent money in 2021 to improve their ranking, character, accessories or image in videogames after the initial purchase, according to a survey of the National Plan on Drugs that also monitors online addiction.

Younger boys tend to use these purchasing mechanisms the most, it showed.