Thank you! But I need integer representation of current dimention. Because I want to put it to database as integer. BTW, I have tried the following with not result. I miss something simple, because I have no idea what are "ResourceKey", "ResourceLocation" and so on. And why they are implemented.
LOGGER.info(String.valueOf(player.level.dimension()));
// Log:
// ResourceKey[minecraft:dimension / minecraft:overworld]
LOGGER.info(String.valueOf(Level.OVERWORLD));
// Log:
// ResourceKey[minecraft:dimension / minecraft:overworld]
LOGGER.info(String.valueOf(player.level.dimensionTypeId()));
// Log:
// ResourceKey[minecraft:dimension_type / minecraft:overworld]
LOGGER.info(String.valueOf(player.level.dimensionType()));
// Log:
// DimensionType[fixedTime=OptionalLong.empty, hasSkyLight=true, hasCeiling=false, ultraWarm=false, natural=true, coordinateScale=1.0, bedWorks=true, respawnAnchorWorks=false, minY=-64, height=384, logicalHeight=384, infiniburn=TagKey[minecraft:block / minecraft:infiniburn_overworld], effectsLocation=minecraft:overworld, ambientLight=0.0, monsterSettings=MonsterSettings[piglinSafe=false, hasRaids=true, monsterSpawnLightTest=[0-7], monsterSpawnBlockLightLimit=0]]
LOGGER.info(String.valueOf(player.level.dimension() == Level.OVERWORLD));
// Log:
// true
Added later: My guess is that the dimension is stored as an enum somewhere. And so I can get its numeric representation. Seems I'm wrong...
Yes, I know. Already, haha. It's okay for now.
Very interesting! But if tick is gone it will never repeat... And if I want to write some kind of logger... Well. Do I need to create new threads with SQL-insert-queries? The reason is: I _need_ to write some data to database exactly when it happened and never-never-never skip writing operations. I think MineCraft hasn't things like queues?
Thank you! I'm new in modding. Any information is useful. Does Forge community has some guides may be? I google every time I need something. It's not the best way to learn something new. And to code correctly.
Oh, thank you, sir! That's why I wondering how it work twice a time... I'll fix it right now.