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    2402

Draco18s

Draco18s    2402

  • Reality Controller
  • Draco18s
  • Members
  • 2402
  • 15924 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    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55068 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    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55068 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
  • 1797 posts
Posted November 11, 2020

because they are shared between you DreamEntitys

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55068 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    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55068 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    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55068 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    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55068 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    2402

Draco18s

Draco18s    2402

  • Reality Controller
  • Draco18s
  • Members
  • 2402
  • 15924 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

    • DaemonUmbra
      REALLY low FPS on Minecraft Forge 1.16.4

      By DaemonUmbra · Posted just now

      Does this impact the ability to play or are you just here to whine?
    • CatSack
      Forge unable to find model

      By CatSack · Posted 16 minutes ago

      Hi, I'm super new to modding with forge. I've been messing around a bit to see if I can get anything working, but I ran into an issue when trying to use runClient. Some point right after the texture stitching phase of loading the game, it gives me this error: I understand that this is an error that it can't find the model the model file bedrock_sword.json, but I honestly have no idea what's wrong. I've looked through every forum post on the first page of google that isn't really sketchy, and none solved my issue. In case it helps, here are some other screenshots. II I've tried everything and I'm not sure what to do at this point. Thanks! EDIT: This is for game version 1.12.2
    • cadbane86140
      Minecraft: Block Party Mini-Game #8!

      By cadbane86140 · Posted 1 hour ago

      Hello There! Today we are back with a game that hasn't been on the channel in quite someday but a favorite of mine: Block Party! This is also apart of the final Hive videos! There are so many hilarious moments in this video that I know you guys are gonna love! I hope you all enjoy this video and if you did don't forget to like and sub for more!  
    • RFJoker
      REALLY low FPS on Minecraft Forge 1.16.4

      By RFJoker · Posted 1 hour ago

      Hello there,    So, I am having MAJOR FPS issues with Minecraft forge. I was going to install it on my server for my friends because we want to have some mods. But before I did this, I wanted to test the mods out myself on my client. I haven't installed any mods yet and just hopped ion a single player world and I am getting 30- 40 FPS. On regular vanilla Minecraft, I get around 500+ FPS with everything on max settings. But with max settings on forge with no mods installed, I get 30-40 FPS. That is crazy! I'm not sure if its because the client is supposed to do that or what.    https://prnt.sc/xbcdos   This is my f3 menu screen.   I have no idea what is going on.   If someone could help me with this, that would be great. Thank you
    • BastouP
      [1.16.4] Get Overworld save directory

      By BastouP · Posted 1 hour ago

      And if there is another way to directly get the save dir, it'd also be great ^^
  • Topics

    • RFJoker
      1
      REALLY low FPS on Minecraft Forge 1.16.4

      By RFJoker
      Started 1 hour ago

    • CatSack
      0
      Forge unable to find model

      By CatSack
      Started 16 minutes ago

    • cadbane86140
      0
      Minecraft: Block Party Mini-Game #8!

      By cadbane86140
      Started 1 hour ago

    • BastouP
      1
      [1.16.4] Get Overworld save directory

      By BastouP
      Started 1 hour ago

    • hijackster99
      0
      Adding Fluids

      By hijackster99
      Started 1 hour ago

  • Who's Online (See full list)

    • DaemonUmbra
    • Woodside
    • Danebi
    • hohserg
    • Johnkakminecraft
    • Aecht_Rob
    • ChampionAsh5357
    • noodleWrecker7
    • Edstew
    • MemeMan
    • CatSack
    • hijackster99
    • loordgek
    • LexManos
  • 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