Jump to content

Recommended Posts

Posted (edited)

Hello, I hope you have a good day

As the title states, I've been encountering a problem on the server that my friends and I are playing on: Several crashes occur occasionally and I don't know where to start looking into the problem.

The server is on Minecraft 1.20, with datapacks and mods included.

The mods we use are:

  • Quote

     

    • Al-Improvements-1.20-0.5.2
    • alexsmobs-1.22.4
    • citadel-2.4.1-1.20
    • dungeons-and-taverns-v2.1.2+ [Forge] (2)
    • DungeonsArise-1.20.1-2.1.56.1-beta
    • explorify-v1.3.0-mc1.20u1.20.1
    • InventoryProfilesNext-forge-1.20-1.10.3
    • ironchests-5.0.0-forge
    • jei-1.20-forge-14.0.0.11
    • journeymap-1.20-5.9.7-forge
    • kotlinforforge-4.6.2-all
    • liblPN-forge-1.20-3.0.2
    • lootr-1.20-0.7.30.73
    • MODS Part 1
    • MODS Part 2
    • MouseTweaks-forge-mc1.20-2.25
    • preview_OptiFine_1.20_HD_U_15_pre5
    • Structure 1.20.1_v1.3.2
    • YungsApi-1.20-Forge-4.0.2
    • YungsBetterDungeons-1.20-Forge-4.0.3
    • YungsBetterMineshafts-1.20-Forge-4.0.4
    • YungsBetterStrongholds-1.20-Forge-4.0.3
    • YungsBridges-1.20-Forge-4.0.3

     

Datapacks used:

  • Quote

     

    • [1.20] Wither Soldier DP by CMD-Golem v3.zip
    • better-nether-mobs-v6.4-datapack.zip
    • blazeandcave-s-advancements-pack-1-16-3-e2630 (1).zip
    • cavernous-r-v1-0-2.zip
    • craftable-elytra-datapack.zip
    • CraftSound_for_1.20.zip
    • Dungeons+ V1.8.4.zip
    • enchantment-plus-v2-2.zip
    • From-The-Fog-1.20-v1.9.2-Data-Resource-Pack.zip.zip
    • illager-fortresses-v13-for-1-20.zip
    • lunarevents.zip
    • No-Lag (1).zip
    • qraftyfied.zip
    • Reds_More_Structure_v1.0.8_C.zip
    • Ships 3.0.1 for 1.20.zip
    • Structory_1.20_v1.3.3.zip
    • thebastionoverhaul-v1-0.zip
    • treecapitator-v3-0.zip
    • trueending_v1.0.1_1.20.zip
    • worldtool-0-6-1.zip

     

I will host the last 3 crash reports, which occurred within 1 hour, for better help:

Link to the crash-reports

Please any help or knowledge on the subject, I would really appreciate it.

Thank you for your attention

Edited by Daliborn
Change upload site
Posted (edited)
37 minutes ago, TileEntity said:

Same issue if you set max-tick-time to -1 in the server.properties?

Hii, thanks for your suggestion.

In the research I did on the subject previously, I came across a suggestion similar to what you said. Its problem is that it opens doors so that the world can end up becoming corrupt. =(

You see, Watchdog It is a server component that is used to measure ticks over a period of time and it crashes to prevent save corruption.

Edited by Daliborn
Word error
Posted (edited)
5 minutes ago, TileEntity said:

Create a test world and make some tests without mods - start without mods like

explorify, alexsmobs and AI-Improvements

I'll do that, it's a good idea.

I will also try to monitor the performance with the Spark mod to see if there is any specific area that is causing a delay in saving the tick.

Again, thank you for your time trying to help me.

Edited by Daliborn
Sparks -> Spark
  • Like 1
Posted

After analyzing it and using Spark as an aid, I saw some things that could help me.

As for creating a single player world to find the problem when removing mod by mod (or datapack by datapack), I didn't get many results. Unlike the server, in my world, there was no lag, drops or even crashes. The problem must probably be something else, I thought.

Already actively on the server, I uninstalled some additional datapacks (such as From the Frog, Qraftyfied, Reds More Structures, etc...)

The most notable thing that I noticed while using Spark is that the server presents random long ticks (some up to 2000% above normal), I thought it was the constant TP between dimensions that my friends and I used simultaneously at times (which increased the tick time), but it wasn't enough to add seconds and crash. I still haven't been able to find the cause of the problem, that's why I started uninstalling the datapacks.

Apart from me not finding the problem, apparently the server stopped crashing after I removed the datapacks and gave advice to my friends on the issue of teleports between worlds. But I still can't be sure that it won't crash when there are more players online, because ticks randomly take longer to generate at times, even when there is no chunk generation.

I'll leave a screenshot of the profiler that I created during 12 hours and 30 minutes on the server:

Print Screen - prnt.sc

As you can see, the MSPT (milliseconds per tick) presents a somewhat strange incongruity.

Thank you for your attention

Posted
21 hours ago, Paint_Ninja said:

Consider upgrading to 1.20.1 - it came out about a week after 1.20 and is a lot more stable for modding as it's still maintained. All existing 1.20 mods and worlds should work on 1.20.1

I'll do that and leave a backup just in case. Thanks for the sugestion.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.