Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Tick Entity Crash
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
hypov

Tick Entity Crash

By hypov, November 11, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

hypov    0

hypov

hypov    0

  • Tree Puncher
  • hypov
  • Members
  • 0
  • 14 posts
Posted November 11, 2020

My mod keeps crashing the client.

Can anyone help?

crash-2020-11-10_22.15.47-server.txt

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2408

Draco18s

Draco18s    2408

  • Reality Controller
  • Draco18s
  • Members
  • 2408
  • 15946 posts
Posted November 11, 2020
Quote

    at io.github.withonetee.entities.DreamEntity.onLivingFall(DreamEntity.java:148) ~[?:?] {re:classloading}

Complain to the mod author.

  • Quote

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.

Share this post


Link to post
Share on other sites

diesieben07    7622

diesieben07

diesieben07    7622

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7622
  • 55275 posts
Posted November 11, 2020
2 hours ago, Draco18s said:

Complain to the mod author.

They are the mod author ;)

 

@hypov Show your code.

  • Quote

Share this post


Link to post
Share on other sites

hypov    0

hypov

hypov    0

  • Tree Puncher
  • hypov
  • Members
  • 0
  • 14 posts
Posted November 11, 2020
11 hours ago, diesieben07 said:

They are the mod author ;)

 

@hypov Show your code.

The entity class?

 

 

DreamEntity.java

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7622

diesieben07

diesieben07    7622

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7622
  • 55275 posts
Posted November 11, 2020
  1. Please learn what static means. None of those things should be static.
  2. Do not re-use ItemStack instances.
  3. Do not cache things like Blocks.WATER in your own fields.

That crash is impossible to get with the code you posted.

  • Quote

Share this post


Link to post
Share on other sites

hypov    0

hypov

hypov    0

  • Tree Puncher
  • hypov
  • Members
  • 0
  • 14 posts
Posted November 11, 2020
18 minutes ago, diesieben07 said:
  1. Please learn what static means. None of those things should be static.
  2. Do not re-use ItemStack instances.
  3. Do not cache things like Blocks.WATER in your own fields.

That crash is impossible to get with the code you posted.

Why can't I re-use ItemStack instances?

  • Quote

Share this post


Link to post
Share on other sites

loordgek    174

loordgek

loordgek    174

  • World Shaper
  • loordgek
  • Members
  • 174
  • 1800 posts
Posted November 11, 2020

because they are shared between you DreamEntitys

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7622

diesieben07

diesieben07    7622

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7622
  • 55275 posts
Posted November 11, 2020
5 minutes ago, hypov said:

Why can't I re-use ItemStack instances?

Because they hold state, like size, damage, etc. This will all be shared.

  • Quote

Share this post


Link to post
Share on other sites

hypov    0

hypov

hypov    0

  • Tree Puncher
  • hypov
  • Members
  • 0
  • 14 posts
Posted November 11, 2020
59 minutes ago, diesieben07 said:

Because they hold state, like size, damage, etc. This will all be shared.

I'm confused 

What does that mean?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7622

diesieben07

diesieben07    7622

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7622
  • 55275 posts
Posted November 11, 2020

You create an ItemStack and store it in a static field.

You then do something with that stack, e.g. give it to the player. This will cause this ItemStack reference to get modified (if the player splits the stack in their inventory, for example). Now your static field holds the same ItemStack instance still, but it has changed (now has a different count).

You now give this stack to a different player. The first player then changes the stack in their inventory and magically the stack in the 2nd player's inventory changes also.

  • Quote

Share this post


Link to post
Share on other sites

hypov    0

hypov

hypov    0

  • Tree Puncher
  • hypov
  • Members
  • 0
  • 14 posts
Posted November 11, 2020
2 minutes ago, diesieben07 said:

You create an ItemStack and store it in a static field.

You then do something with that stack, e.g. give it to the player. This will cause this ItemStack reference to get modified (if the player splits the stack in their inventory, for example). Now your static field holds the same ItemStack instance still, but it has changed (now has a different count).

You now give this stack to a different player. The first player then changes the stack in their inventory and magically the stack in the 2nd player's inventory changes also.

oh right

How would I fix this?

 

Also I'm trying to add mlg features to the entity.. how would I do that?

 

Thank you!

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7622

diesieben07

diesieben07    7622

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7622
  • 55275 posts
Posted November 11, 2020
Just now, hypov said:

oh right

How would I fix this?

Don't re-use Itemstacks.

 

1 minute ago, hypov said:

Also I'm trying to add mlg features to the entity.. how would I do that?

What?

  • Quote

Share this post


Link to post
Share on other sites

hypov    0

hypov

hypov    0

  • Tree Puncher
  • hypov
  • Members
  • 0
  • 14 posts
Posted November 11, 2020
Just now, diesieben07 said:

Don't re-use Itemstacks.

 

What?

Okay

 

Basically if an entity is falling, the entity would place a water bucket below them to counteract the fall damage

 

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7622

diesieben07

diesieben07    7622

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7622
  • 55275 posts
Posted November 11, 2020

Probably need to check the Y motion for a negative value and check if there is ground below.

  • Quote

Share this post


Link to post
Share on other sites

hypov    0

hypov

hypov    0

  • Tree Puncher
  • hypov
  • Members
  • 0
  • 14 posts
Posted November 11, 2020
1 minute ago, diesieben07 said:

Probably need to check the Y motion for a negative value and check if there is ground below.

Uhm yes, I have problems though

 

1. How do I check if there's ground below an entity?

2. I'm registering the event handler in another class, so how would I set the item of the entity in the other class?

 

 

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2408

Draco18s

Draco18s    2408

  • Reality Controller
  • Draco18s
  • Members
  • 2408
  • 15946 posts
Posted November 11, 2020
44 minutes ago, hypov said:

Uhm yes, I have problems though

 

1. How do I check if there's ground below an entity?

world#getBlockState

 

  • Quote

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.

Share this post


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.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Forge 1.16.5 - 36.0.9 start up crash

      By diesieben07 · Posted 2 minutes ago

      Problem with RandomPatches.
    • diesieben07
      my 1.16.5 modded game crashes after a while of playing

      By diesieben07 · Posted 2 minutes ago

    • diesieben07
      I need help

      By diesieben07 · Posted 4 minutes ago

      Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
    • diesieben07
      [1.16.5] Enchantments can Apply to all Tools

      By diesieben07 · Posted 6 minutes ago

      https://www.geeksforgeeks.org/how-to-use-iterator-in-java/
    • Zockerbua
      I need help

      By Zockerbua · Posted 11 minutes ago

      I want to download forge for version 1.16.5, but wehn i download forge i get a JAR-File and not the Java-file and when i open this JAR-File i can see the code of the programm i dont know how to fix this please help me.
  • Topics

    • Maxi90909
      3
      Forge 1.16.5 - 36.0.9 start up crash

      By Maxi90909
      Started 1 hour ago

    • matthyit
      3
      my 1.16.5 modded game crashes after a while of playing

      By matthyit
      Started 1 hour ago

    • Zockerbua
      1
      I need help

      By Zockerbua
      Started 11 minutes ago

    • Luis_ST
      17
      [1.16.5] Enchantments can Apply to all Tools

      By Luis_ST
      Started Yesterday at 07:21 AM

    • domi0908
      6
      fix hitbox red baby mobs version forge

      By domi0908
      Started Tuesday at 03:04 PM

  • Who's Online (See full list)

    • gaularn@gmail.com
    • Alpvax
    • Stefan2007
    • diesieben07
    • Tavi007
    • ozi
    • Maxi90909
    • 007lol
    • Zemelua
    • matthyit
    • domi0908
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Tick Entity Crash
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community