Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.14.4] Minecraft Stuck on loading world 100%


Recommended Posts

When loading a world with my custom NetherItemEntity on the ground the game gets stuck at 100% loading world, The process is then unable to be terminated and requires restarting my computer before becoming bootable.

The issue only happens when reloading a world that has my custom ItemEntity on the ground.

At first I was cancelling the EntityJoinWorldEvent and replacing the itemEntity with my own if it was a NetherItem but when this issue started happening I moved to having my Item implement IForgeItem and have a customEntity. This did not fix my issue.

I don't know where to go from here as I don't know how to make my itemEntity invulnerable to fire & lava without this method.

The only similar forum post I found was this: 

 

This is my NetherItemEntity.class

Spoiler

 


public class NetherItemEntity extends ItemEntity {

    private int health = 5;

    public NetherItemEntity(World worldIn, double x, double y, double z, ItemStack stack) {
        super(worldIn, x, y, z, stack);
    }

    @Override
    public void dealFireDamage(int amount){ return; }

    @Override
    public boolean isInvulnerableTo(DamageSource source){
        if(source == DamageSource.IN_FIRE || source == DamageSource.LAVA || source == DamageSource.ON_FIRE)
            return true;
        return super.isInvulnerableTo(source);
    }

}

 

This is my NetheriteIngotItem.class

Spoiler

public class NetheriteIngotItem extends Item implements IForgeItem {
    public NetheriteIngotItem(Properties properties) {
        super(properties);
        setRegistryName("netherite_ingot");
    }

    @Override
    public boolean hasCustomEntity(ItemStack stack) {
        return true;
    }

    @Override
    @Nullable
    public Entity createEntity(World world, Entity location, ItemStack itemstack) {
        NetherItemEntity entity = new NetherItemEntity(world, location.posX, location.posY, location.posZ, itemstack);
        entity.setPickupDelay(30);
        return entity;
    }


}

 

 

Link to post
Share on other sites
5 hours ago, kowagatte said:

When loading a world with my custom NetherItemEntity on the ground the game gets stuck at 100% loading world, The process is then unable to be terminated and requires restarting my computer before becoming bootable.

Post the debug.log file.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to post
Share on other sites
5 hours ago, diesieben07 said:

You must use the ItemEntity constructor that takes an EntityType parameter and pass your EntityType.

You will also need to override createSpawnPacket in your entity class and return NetworkHooks.getEntitySpawningPacket.

I have not created an EntityType, would I just use the ItemEntity ItemType? Where will this constructor be called? my IDE says this is never used.

 

Edit: I tried doing what you suggested but the issue seems to keep persiting.
My NetherItemEntity.class

Spoiler

public class NetherItemEntity extends ItemEntity {

    private int health = 5;

    public NetherItemEntity(World worldIn, Entity location, ItemStack stack) {
        super(worldIn, location.posX, location.posY, location.posZ, stack);
    }

    @SuppressWarnings("unchecked")
    public NetherItemEntity(EntityType<Entity> entityEntityType, World world) {
        super((EntityType<? extends ItemEntity>) Patch116Entities.NETHER_ITEM_ENTITY, world);
    }

    @Override
    public void dealFireDamage(int amount){ return; }

    @Override
    public boolean isInvulnerableTo(DamageSource source){
        if(source == DamageSource.IN_FIRE || source == DamageSource.LAVA || source == DamageSource.ON_FIRE)
            return true;
        return super.isInvulnerableTo(source);
    }

    @Override
    public IPacket<?> createSpawnPacket() {
        return NetworkHooks.getEntitySpawningPacket(this);
    }
}

 

My Patch116Entities.class

Spoiler

public class Patch116Entities {

    public static EntityType<?> NETHER_ITEM_ENTITY = EntityType.Builder.create(NetherItemEntity::new, EntityClassification.MISC)
            .build(Patch116.MOD_ID+":nether_item_entity")
            .setRegistryName(new ResourceLocation(Patch116.MOD_ID, "nether_item_entity"));

    @Mod.EventBusSubscriber(modid = Patch116.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class Registration {
        @SubscribeEvent
        public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) {
            event.getRegistry().registerAll(NETHER_ITEM_ENTITY);
        }
    }
}

 

The issues still keeps happening, stuck loading at 100% when my custom ItemEntity is on the ground.

Edited by kowagatte
Link to post
Share on other sites
6 hours ago, Animefan8888 said:

Post the debug.log file.

I don't know how useful it's going to be since the client completely hangs and stops writing to the debug.log, there are no errors in the log.
Heres the last little bit before it hangs, I cant upload the entire thing since its too big.

Spoiler

[19Apr2020 17:34:12.906] [Server thread/DEBUG] [net.minecraftforge.registries.ObjectHolderRegistry/REGISTRIES]: Applying holder lookups
[19Apr2020 17:34:12.907] [Server thread/DEBUG] [net.minecraftforge.registries.ObjectHolderRegistry/REGISTRIES]: Holder lookups applied
[19Apr2020 17:34:12.907] [Server thread/DEBUG] [net.minecraftforge.fml.server.ServerLifecycleHooks/CORE]: Generating PackInfo named mod:forge for mod file /home/kowa/.gradle/caches/forge_gradle/minecraft_user_repo/net/minecraftforge/forge/1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3/forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar
[19Apr2020 17:34:12.907] [Server thread/DEBUG] [net.minecraftforge.fml.server.ServerLifecycleHooks/CORE]: Generating PackInfo named mod:patch116 for mod file /home/kowa/Desktop/netherrite_patch/build/resources/main
[19Apr2020 17:34:12.907] [Server thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar, main
[19Apr2020 17:34:13.136] [Server thread/INFO] [net.minecraft.item.crafting.RecipeManager/]: Loaded 6 recipes
[19Apr2020 17:34:13.304] [Server thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 811 advancements
[19Apr2020 17:34:13.309] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing start region for dimension minecraft:overworld
[19Apr2020 17:34:13.726] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[19Apr2020 17:34:13.829] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 24%
[19Apr2020 17:34:14.338] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 83%
[19Apr2020 17:34:14.824] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 88%
[19Apr2020 17:34:15.330] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 94%

 

 

Link to post
Share on other sites
8 hours ago, kowagatte said:

I have not created an EntityType, would I just use the ItemEntity ItemType?

No, you must create your own one. Otherwise Minecraft cannot recognize your entity as its own type and properly spawn it. It will just spawn as a normal item entity on the client also be saved to the disk as such. When it then loads from disk that fails, because the custom item entity hook is not designed to work like that.

 

8 hours ago, kowagatte said:

@SuppressWarnings("unchecked") public NetherItemEntity(EntityType<Entity> entityEntityType, World world) { super((EntityType<? extends ItemEntity>) Patch116Entities.NETHER_ITEM_ENTITY, world); }

Why is there an "entityEntityType" parameter but you don't use it?

 

8 hours ago, kowagatte said:

public NetherItemEntity(World worldIn, Entity location, ItemStack stack) { super(worldIn, location.posX, location.posY, location.posZ, stack); }

No. You can't have this constructor, as it would use the vanilla item entity type. All your constructors must pass your entity type to super.

Link to post
Share on other sites
3 hours ago, diesieben07 said:

No, you must create your own one. Otherwise Minecraft cannot recognize your entity as its own type and properly spawn it. It will just spawn as a normal item entity on the client also be saved to the disk as such. When it then loads from disk that fails, because the custom item entity hook is not designed to work like that.

 

Why is there an "entityEntityType" parameter but you don't use it?

 

No. You can't have this constructor, as it would use the vanilla item entity type. All your constructors must pass your entity type to super.

Thanks a ton, fixing these issues solved my problem. Kindest regards.

Link to post
Share on other sites
  • 2 weeks later...

I am getting this problem with my custom item Entity, i've followed whats on this post but its still not working.
 

Main Class

 
 
 
 
Spoiler

@Mod("lavasmelting")
public class LavaSmelting {

    private static final Logger LOGGER = LogManager.getLogger();

    public static EntityType<?> ITEM_ENTITY = EntityType.Builder.create((entityType, world) -> new NewItemEntity(world), EntityClassification.MISC)
            .build("lavasmelting"+":item_entity")
            .setRegistryName(new ResourceLocation("lavasmelting", "item_entity"));



    public LavaSmelting() {
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
        MinecraftForge.EVENT_BUS.register(this);
    }

    private void setup(final FMLCommonSetupEvent event) {
        LOGGER.info("Lava Smelting is setup!");
    }

    private void doClientStuff(final FMLClientSetupEvent event) {
        LOGGER.info("Lava Smelting client is setup!");
    }

    @SubscribeEvent
    public void itemJoinWorld(EntityJoinWorldEvent event) {
        if(event.getEntity() instanceof ItemEntity && !(event.getEntity() instanceof NewItemEntity)) {
            if(event.getWorld().getChunkProvider().chunkExists(event.getEntity().chunkCoordX, event.getEntity().chunkCoordZ)) {
                event.setCanceled(true);
                NewItemEntity item = new NewItemEntity(event.getWorld(), event.getEntity().getPosX(), event.getEntity().getPosY(), event.getEntity().getPosZ(), ((ItemEntity) event.getEntity()).getItem());
                System.out.println("made item noW!");
                item.setMotion(event.getEntity().getMotion());
                item.setDefaultPickupDelay();
                event.getWorld().addEntity(item);
                System.out.println("Added item");
            }
        }
    }

    @Mod.EventBusSubscriber(modid = "lavasmelting", bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class Registration {
        @SubscribeEvent
        public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) {
            event.getRegistry().registerAll(ITEM_ENTITY);
            System.out.println("LOADED");
        }
    }
}

 

 

ItemEntity Class

 
 
 
 
Spoiler

public class NewItemEntity extends ItemEntity {

    public NewItemEntity(World world) {
        super((EntityType<? extends ItemEntity>) LavaSmelting.ITEM_ENTITY, world);
    }

    public NewItemEntity(World world, double posX, double posY, double posZ, ItemStack item) {
        super(world,posX,posY,posZ,item);
    }

    @Override
    public IPacket<?> createSpawnPacket() {
        return NetworkHooks.getEntitySpawningPacket(this);
    }
}

 

 I am getting stuck on 100%.

Link to post
Share on other sites
12 minutes ago, Redstoneguy129 said:

i've followed whats on this post

You have not:

12 minutes ago, Redstoneguy129 said:

public NewItemEntity(World world, double posX, double posY, double posZ, ItemStack item) {
  super(world,posX,posY,posZ,item);
}

 

 

On 4/19/2020 at 8:01 PM, diesieben07 said:

You must use the ItemEntity constructor that takes an EntityType parameter and pass your EntityType.

 

Link to post
Share on other sites
55 minutes ago, Redstoneguy129 said:
On 4/19/2020 at 1:01 PM, diesieben07 said:

You must use the ItemEntity constructor that takes an EntityType parameter and pass your EntityType.

 

So this?
 


public ItemEntity(World worldIn, double x, double y, double z, ItemStack stack) {
      this(worldIn, x, y, z);
      this.setItem(stack);
      this.lifespan = (stack.getItem() == null ? 6000 : stack.getEntityLifespan(worldIn));
   }

 

Lets look at that constructor for a moment.

It has the following parameters:

  • World worldin
  • double x
  • double y
  • double z
  • ItemStack stack

Are any of these the type EntityType?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I have made a custom armor piece and have given it a texture for when you hold it. I have also made a custom armor material but I dont know how to make it so that when you where the armor you see a custom texture.
    • Probably only the main block should hold all the data, that way you don't have things spread out.
    • It hasn't been changed in a long time and should be updated.  But no, it's not overly aggressive. People don't read it. Look at all the support threads. 90% of them are "okay i have this issue", no debug.log in sight.
    • I solved it by copying the .gradle folder from another laptop where it works to run the client!
    • I am currently drawing a compass to my ingame gui as follows: private static void renderCompass(MatrixStack matrixStack, int width, int height) { TextureDrawer.drawGuiTexture(matrixStack, width / 2 - 110, 10, 0, 37, 221, 14); int rot; boolean f0 = mc.player.yRot < 0.0f; if(f0) rot = -MathHelper.floor(mc.player.yRot % 360); else rot = MathHelper.floor(mc.player.yRot % 360); boolean f1 = rot > 0 && rot < 180; boolean f2 = rot <= 270 && rot >= 90; boolean f3 = rot <= 180 && rot >= 0; AtomicInteger targetAngle = new AtomicInteger(-1); mc.player.getCapability(ISkyrimPlayerDataProvider.SKYRIM_PLAYER_DATA_CAPABILITY).ifPresent(cap -> { if(cap.getCurrentTarget() != null && cap.getCurrentTarget().isAlive()) { Vector3d playerPos = mc.player.getLookAngle(); Vector3d targetPos = cap.getCurrentTarget().position(); Vector3d norm = playerPos.subtract(targetPos); double angleDir = (Math.atan2(norm.z, norm.x) / 2 / Math.PI * 360 + 360) % 360; double angleLook = (Math.atan2(playerPos.z, playerPos.x) / 2 / Math.PI * 360 + 360) % 360; targetAngle.set((int)(angleDir - angleLook + 360) % 360); } else targetAngle.set(-1); }); int targetEntityAngle = targetAngle.get(); if(targetEntityAngle > 0 && targetEntityAngle <= 90) TextureDrawer.drawGuiTexture(matrixStack, width / 2 - targetEntityAngle, 14, 105, 52, 6, 6); else if(targetEntityAngle > 90 && targetEntityAngle <= 180) TextureDrawer.drawGuiTexture(matrixStack, width / 2 - targetEntityAngle + 90, 14, 105, 52, 6, 6); if (rot == 0) { drawCenteredString(matrixStack, fontRenderer, "S", width / 2, 13, 16777215); drawCenteredString(matrixStack, fontRenderer, "E", (width / 2) - 90, 13, 16777215); drawCenteredString(matrixStack, fontRenderer, "W", (width / 2) + 90, 13, 16777215); } else if (!f0) { drawCenteredString(matrixStack, fontRenderer, f2 ? "N" : "", (width / 2 - rot) + 180, 13, 16777215); if (!f1) rot -= 360; drawCenteredString(matrixStack, fontRenderer, !f2 ? "S" : "", width / 2 - rot, 13, 16777215); drawCenteredString(matrixStack, fontRenderer, !f3 ? "E" : "", (width / 2 - rot) - 90, 13, 16777215); drawCenteredString(matrixStack, fontRenderer, f3 ? "W" : "", (width / 2 - rot) + 90, 13, 16777215); } else if(f0) { drawCenteredString(matrixStack, fontRenderer, f2 ? "N" : "", (width / 2 + rot) - 180, 13, 16777215); if (!f1) rot -= 360; drawCenteredString(matrixStack, fontRenderer, !f2 ? "S" : "", width / 2 + rot, 13, 16777215); drawCenteredString(matrixStack, fontRenderer, !f3 ? "W" : "", (width / 2 + rot) + 90, 13, 16777215); drawCenteredString(matrixStack, fontRenderer, f3 ? "E" : "", (width / 2 + rot) - 90, 13, 16777215); } } What I'm trying to do is only render the entity texture (the calls including targetEntityAngle) when it is in compass view.  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.