Everything posted by Zanckor
-
[1.19] Creating new Packet
Man I LOVE you ❤️ Finally, I made it before in the exact same way that i made it now, but idk why my event handler was not working.
-
[1.19] Creating new Packet
I'm still lost, I don't know how to do it lmao. I want to change the life every time they increase CON, and from what I've seen it only works with a constant value? Btw, I don't know if that's the case, but it gives me the feeling that it would change max health of all the players at the same time, not individually, but since I haven't been able to test it, I can't be sure. And all the examples I found work in the entity class, not in events, so I think it would not work for me, since I want it to be updated when increasing the stat in a menu
-
[1.19] Creating new Packet
I'm looking how to use addTransientAttributeModifiers, but i found nothing, may you send me an example please?
-
[1.19] Creating new Packet
I want to create a stat system, like a typical MMORPG, so, i'll create capabilities to each stat, for example, CON to health, if i've 50CON, It would be 50*5 (250) of health
-
[1.19] Creating new Packet
How can I add an attribute modifier?
-
[1.19] Creating new Packet
Eya! I'm trying to create a new packet to send new max health of player to server side, but i've never made a packet before, so i hope if anyone can help me That's how I change max health in an event: player.getAttribute(Attributes.MAX_HEALTH).setBaseValue(50D); And that's my network class: public class Network { public static final String NETWORK_VERSION = "0.1.0"; public static final SimpleChannel CHANNEL = NetworkRegistry. newSimpleChannel(new ResourceLocation(DragonBallZ.MOD_ID, "network"), () -> NETWORK_VERSION, version -> version.equals(NETWORK_VERSION), version -> version.equals(NETWORK_VERSION)); public static void init(){ int index = 0; SimpleChannel.MessageBuilder(maxHealthPacket.class, index++, NetworkDirection.PLAY_TO_SERVER); } }
-
[1.16.5] Force player sweep attack
Eya! I'm doing a 1.16.5 mod with some skills. Ftm i'm working on an area attack but idk how to force to the player to do a sweep attack, or just a normal attack
-
(1.16.5) Player Capabilities help
There's any way to send the capaiblities from PlayerTickEvent and save them into Server side without packets?
-
(1.16.5) Player Capabilities help
Mhh, when i try to access to them it crash me. My github: https://github.com/Zanckor/mmorpg Crash: Time: 20/02/22 18:16 Description: Ticking memory connection java.lang.NullPointerException: Ticking memory connection at com.mod.capabilities.MyCapabilityProvider.<init>(MyCapabilityProvider.java:11) ~[main/:?] {re:classloading} at com.mod.capabilities.Capabilities.attachCapabilities(Capabilities.java:31) ~[main/:?] {re:classloading,pl:capability_inject_definalize:A} at net.minecraftforge.eventbus.ASMEventHandler_3_Capabilities_attachCapabilities_AttachCapabilitiesEvent.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:579) ~[forge:?] {re:classloading} at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:573) ~[forge:?] {re:classloading} at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:48) ~[forge:?] {re:classloading} at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:44) ~[forge:?] {re:classloading} at net.minecraft.entity.Entity.<init>(Entity.java:221) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:205) ~[forge:?] {re:classloading} at net.minecraft.entity.player.PlayerEntity.<init>(PlayerEntity.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.player.ServerPlayerEntity.<init>(ServerPlayerEntity.java:179) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.management.PlayerList.getPlayerForLogin(PlayerList.java:406) ~[forge:?] {re:classloading} at net.minecraft.network.login.ServerLoginNetHandler.handleAcceptedLogin(ServerLoginNetHandler.java:118) ~[forge:?] {re:classloading} at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:65) ~[forge:?] {re:classloading} at net.minecraft.network.NetworkManager.tick(NetworkManager.java:222) ~[forge:?] {re:classloading} at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:134) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:865) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:787) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tickServer(IntegratedServer.java:78) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:642) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_231] {}
-
(1.16.5) Player Capabilities help
Okay, i'm idiot, i put the capabilities.class like interface xD, so, how can i get the capabilitie now? like, make a player.getMana() And, btw, i read that i need to send the information from the server to the client when i change my capabilities, how can i make it?
-
(1.16.5) Player Capabilities help
Maybe is my gradle? Cause it shows me this error: "Could not run phased build action using a connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-6.8.1-all.zip'.
-
(1.16.5) Player Capabilities help
I'm using Eclipse, and to start it i just go to the icon "Start" and select the option runClient
-
(1.16.5) Player Capabilities help
where can i check it?
-
(1.16.5) Player Capabilities help
okay, i done everything but still dont works when i try to open the game to test the capabilities it crash... there's my code and crash-log: code: https://github.com/Zanckor/mmorpg crash-log:
-
(1.16.5) Player Capabilities help
K, tnks, so, i need to add the provider and delete storage? Btw, what do the storage??
-
(1.16.5) Player Capabilities help
Ok, I done all of the capability system, i think, so, this should work? Or im missing something? That should work on players? https://github.com/Zanckor/mmorpg/tree/main/src/main/java/com/mod
-
(1.16.5) Player Capabilities help
well, a lot of code errors, but if its for 1.18 that explains all
-
(1.16.5) Player Capabilities help
A lot of this code is not working, are you sure that is for 1.16.5?
-
(1.16.5) Player Capabilities help
Eya, I need some help to add capabilities to the player. I want just to add simple NBT to the player, like booleans and int, no more, but I've been searching for information since 1 or 2 weeks ago and every guide or github do the capabilities different, i've seen like 6 differents forms or more to do the capabilities but i dont understand it, some people make only 1 class, others makes like 8... So, I hope if anybody can give me a little example and can explain it a bit to me, thanks!
-
Change player speed
You mean something like that?: player.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
-
Change player speed
Eya guys, im just trying to change the minecraft player walking speed, there's a function but idk why it doesnt works. My code is something like: @SubscribeEvent public static void onPlayerTick(PlayerTickEvent e) { PlayerEntity player = e.player; player.inventory.armor.set(0, new ItemStack(Items.GOLDEN_HELMET)); player.setSpeed(0.1F); System.out.println(player.getSpeed()); } I've just put the armor.set to check if is any problem in the class, but it works, so idk why it dont works Oh, and my eventHandler subscriber is: @Mod.EventBusSubscriber(modid = MMORPGZanckorMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
IPS spam blocked by CleanTalk.