-
Posts
150 -
Joined
-
Last visited
Everything posted by Anonomys
-
Hello, I'm having trouble keeping player nbt data after death, this is my code currently: @SubscribeEvent public static void onPlayerCloned(PlayerEvent.Clone event) { if(event.isWasDeath()) { System.out.println("Player died"); System.out.println("Cloning wallet 0/2"); System.out.println(event.getOriginal().getDisplayName().getString()); System.out.println(event.getOriginal().getCapability(WalletProvider.WALLET_CAPABILITY).isPresent()); event.getOriginal().getCapability(WalletProvider.WALLET_CAPABILITY).ifPresent(oldStore -> { System.out.println("Cloning wallet 1/2"); event.getPlayer().getCapability(WalletProvider.WALLET_CAPABILITY).ifPresent(newStore -> { System.out.println("Cloning wallet 2/2"); newStore.copyFrom(oldStore); }); }); } } I have a /balance command, and when I give myself some money it displays the correct balance, but for some reason the capability is not present in the playerclone event, the System.out.println(event.getOriginal().getCapability(WalletProvider.WALLET_CAPABILITY).isPresent()); prints "false". I know that the capability is being attached properly and everything, this is my console: Attached wallet to player Player died Cloning wallet 0/2 Dev false Attached wallet to player Please anyone help
-
How do I store a string in the block's nbt data?
Anonomys replied to Anonomys's topic in Modder Support
I found where the error was, in the blockentity class the getCapability was returning the ATMCapability.INSTANCE instead of the ATMCapabilityImplementation. Sorry for taking your time -
How do I store a string in the block's nbt data?
Anonomys replied to Anonomys's topic in Modder Support
Yes but its not being cast to that anywhere, ive looked through everything -
How do I store a string in the block's nbt data?
Anonomys replied to Anonomys's topic in Modder Support
Hey, yeah i did that and made a blockentity and now im getting this error class ...atm.capability.ATMCapability cannot be cast to class ...atm.capability.ATMCapabilityInterface -
How do I store a string in the block's nbt data?
Anonomys replied to Anonomys's topic in Modder Support
Yes, but I don't understand the AttachCapabilitiesEvent<Entity>, how does that attach it to the atm block, I tried subscribing and all of that, changing code i dont know what to do, can you please explain it? -
How do I store a string in the block's nbt data?
Anonomys replied to Anonomys's topic in Modder Support
Hey I did all that, tbh i've been struggling the last hour trying to make the thing, I did everything but now I'm trying to add the capability to the block and then set it when it is placed down, this is the code: @NotNull @Override public <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) { return LazyOptional.of(ATMCapability::new).cast(); } @Override public void onPlace(BlockState state, Level world, BlockPos pos, BlockState blockState, boolean p_60570_) { world.getCapability(ATMCapability.INSTANCE).ifPresent((cap) -> { cap.setPrivateKey("test"); cap.setAtmId("test"); }); System.out.println("ATM created!"); System.out.println("Private key: " + world.getCapability(ATMCapability.INSTANCE).orElseThrow(NullPointerException::new).getPrivateKey()); System.out.println("ATM ID: " + world.getCapability(ATMCapability.INSTANCE).orElseThrow(NullPointerException::new).getAtmId()); } I have no idea if this is even correct, but i dont know what else to do, it keeps giving me the nullpointerexception which means that its not being saved -
Hello, I'm trying to store data in the block's nbt data, but i have no idea how to do this, apparently im supposed to use capabilities but there's so little documentation, and I have no idea how to do this, can someone please provide me some example code?
-
[FIXED] Custom block model has weird gradient on it's faces
Anonomys replied to Anonomys's topic in Modder Support
Hey, so i fixed it somehow, I don't know what I did, I'm just glad i fixed it. -
Here's what I was talking about, this now shows at the start if you use cracked minecraft. The exit button just takes you to the main menu, if you don't want to login. But you will not be able to use the stuff the mod needs the api for. And this shows if the API is down.
-
I know physics mod, the pro version asks you to enter your key when you launch the game. My mod just requires you to make a separate password for the mod if you are using cracked minecraft (the mod has separate accounts for cracked and premium users, premium users do not need to enter their password), so that people can't just access your stuff by using your username. I am not in any way doing it to make money. Okay, thank you, I'll try.
-
Anyone? it doesn't have to be an input, but at least a warning (text that says something, and then a button to proceed to minecraft)
-
Hey, I want to ask the user to input their key on game launch, I just don't know how to show the screen on start. Can someone help?
-
[1.16.5] Failed to create screen for menu type.
Anonomys replied to Anonomys's topic in Modder Support
Forgot about that, heh. Thanks. -
Hey, so, I am trying to create a chest using my code from the 1.15 tutorial by TurtyWurty I've followed everything, but the problem is it gives me this error when i right click on the block: Failed to create screen for menu type: imod:bluestone_chest I have a github repo for my mod, here it is. Also dont mind the chest texture if you are looking at it, i will change it, as soon as i get this fixed.
-
Hey, so I was taking a break from minecraft modding and then today i decided to go back and do some modding again. I saw that my latest version of my mod was 1.16.3, so i decided to update it to 1.16.5. Then I found out that they renamed basically everything, and now im stuck with this problem, the problem is that its not the same code as in the 1.16.3 because the voxel shapes and facing things dont work in this version. So i just deleted them, and now i dont know how to fix this. These blocks have no rotation and no boundary boxes, since i deleted them. I never liked working with them, for me they are annoying. And yeah as i said, the problem is that the custom block model makes the block underneath or beside it transparent. The code is basic, basically just a constructor in a class and some properties in the init class. Any help appreciated!