package Ġcom . github . vir us bear . met rix Ċ Ċ import Ġnet . fabric mc . fabric . api . event . lifecycle . v 1 . Server Entity Events Ċ import Ġnet . fabric mc . fabric . api . event . lifecycle . v 1 . Server World Events Ċ Ċ fun ĠEntity Metrics ( registry : ĠMeter Registry ) Ġ{ ĊĠĠĠ Ġval Ġcount Ġ= Ġregistry . gauge ( met rix Identifier (" entity . count ")) ĊĠĠĠ Ġval Ġspawn Ġ= Ġregistry . counter ( met rix Identifier (" entity . spawn ")) ĊĠĠĠ Ġval Ġde spawn Ġ= Ġregistry . counter ( met rix Identifier (" entity . de spawn ")) ĊĊĠĠĠ ĠServer World Events . LOAD . register ( Server World Events . Load Ġ{ Ġ_, Ġworld Ġ-> ĊĠĠĠĠĠĠĠ Ġcount . register ( map Of (" dimension " Ġto Ġworld . name )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġworld . iterate Entities (). count (). toDouble () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠĠĠ ĠServer World Events . UN LOAD . register ( Server World Events . Unload Ġ{ Ġ_, Ġworld Ġ-> ĊĠĠĠĠĠĠĠ Ġcount Ġ-= Ġmap Of (" dimension " Ġto Ġworld . name ) ĊĠĠĠ Ġ}) ĊĊĠĠĠ ĠServer Entity Events . ENTITY _ LOAD . register ( Server Entity Events . Load Ġ{ Ġ_, Ġworld Ġ-> ĊĠĠĠĠĠĠĠ Ġspawn [ map Of (" dimension " Ġto Ġworld . name )]. inc () ĊĠĠĠ Ġ}) ĊĠĠĠ ĠServer Entity Events . ENTITY _ UN LOAD . register ( Server Entity Events . Unload Ġ{ Ġ_, Ġworld Ġ-> ĊĠĠĠĠĠĠĠ Ġde spawn [ map Of (" dimension " Ġto Ġworld . name )]. inc () ĊĠĠĠ Ġ}) Ċ }