-
Render quads/filled rectangles on 1.18.2
I've already managed to draw lined shapes using RenderType.lined() but whenever I am trying to swap it to RenderType.solid() my game crashed and I don't know what to do... Also if I could add a texture/shader on top of that quad that'd also be nice but just drawing a quad is the important thing
-
Loading BlockEntity data using the Level object
I guess this can work, I'll give that a try
-
Loading BlockEntity data using the Level object
What I have so far, is a way to store the "world name"(the String I can use the get the ResourceKey<Level> from), and a method called initAndGetWorld(MinecraftServer) that checks if the world is null and if not gives it a value, as well as a method to load the world without the server just by filling in that String, but the problem with that is: I don't know whether I init the world at any point of the code.... so I'm just gonna have to use it anywhere(?)
-
Loading BlockEntity data using the Level object
Well yeah but if my Location class only contains the ResourceKey<Level> then how is it gonna use the Level internally? There are short methods such as getBlockState(), getBlockEntity() etc. Are they all gonna demand a MinecraftServer instance?
-
Loading BlockEntity data using the Level object
How will I use it later tho?? When I need to use the Level? I don't want to always be forced to input a MinecraftServer into my get method
-
Loading BlockEntity data using the Level object
Also, wdym? How do I do that? I just looked at tutorials for BlockEntitiy and all of them used BlockEntity#saveAdditional and BlockEntity#load
-
Loading BlockEntity data using the Level object
The data I use a Location, which is a class I made containing a BlockPos and a Level, the reason I need a level iis because it might not be the same world as the BlockEntity's one. Basically I am making wireless redstone and I want it to work accross dimensions too and I am trying to load the transmitter's target, but to load a world you need to use MinecraftServer#getLevel which I can only access using Level#getServer
-
Loading BlockEntity data using the Level object
During the load() method, BlockEntity.level is always null.. which means I cannot use it to get the MinecraftServer(Level#getServer), which means I cannot get the data I need when loading, causing it so when I rejoin the world(or Ig reload the chunk, never tried), Some data about my block is not saved... How can I get around this? What I need is: The MinecraftServer instance, which I thought of getting using BlockEntity.level, but it is null during the BlockEntity#load method
-
Persistant Block Data(after destruction)
Thank you
-
Persistant Block Data(after destruction)
How do I work with "BlockEntityTag"s?
-
Persistant Block Data(after destruction)
I have a boolean on my BlockEntity that determines something.. However, I want this value to be saved even after the block is broken and replacd(this way, seprating the blocks who have it as TRUE in the ItemStack, an NBT perhaps) How can I do it so blocks with that value set to TRUE will drop this variation of the item with a different NBT, that when placed down, will make sure the newly created BlockEntity will have this boolean set that way? Basically I want to be able to destroy and place a block with a certain state and have that block remember that state(also be seperated from the same types of blocks who are not in that state in the Inventroy, prob using NBT)
-
Block#use is not called when player is crouching
Ik this is kinda the thing that a block is not used if you crouch... but what do I do if I want something to happen when you right click a block while crouching, regardless of the item(so don't tell me Item#useOn)
-
Get Level object from dimension ResourceLocation CLIENT sided
Alrighty, thank you
-
Get Level object from dimension ResourceLocation CLIENT sided
Then how can I store and retreive a world via NBT?
-
Get Level object from dimension ResourceLocation CLIENT sided
So far I've been able to obtain a world object using the MinecraftServer#getLevel method, obtaining the instance from Level#getServer. However, only ServerLevel#getServer actually returns a result that is not null, meaning that you can only get a world using its location on the server... How can I get it from the CLIENT?? I can't do Level#getServer as it returns null, because of that, I cannot use MinecraftServer#getLevel to get the world from its location name
IPS spam blocked by CleanTalk.