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    2401

Draco18s

Draco18s    2401

  • Reality Controller
  • Draco18s
  • Members
  • 2401
  • 15920 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    7587

diesieben07

diesieben07    7587

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7587
  • 54940 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    7587

diesieben07

diesieben07    7587

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7587
  • 54940 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    7587

diesieben07

diesieben07    7587

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7587
  • 54940 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    7587

diesieben07

diesieben07    7587

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7587
  • 54940 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    7587

diesieben07

diesieben07    7587

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7587
  • 54940 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    7587

diesieben07

diesieben07    7587

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7587
  • 54940 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    2401

Draco18s

Draco18s    2401

  • Reality Controller
  • Draco18s
  • Members
  • 2401
  • 15920 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
      [1.16.4] Smithing table custom recipe use durability

      By diesieben07 · Posted 52 minutes ago

      There is no way to do this. The smithing container is hardcoded to just decrease its inputs and not use the container item (see SmithingTableContainer#func_230301_a_).
    • st4s1k
      [1.16.4] Smithing table custom recipe use durability

      By st4s1k · Posted 1 hour ago

      Hi! How do I make so that when I place in the smithing table a tool and a material, I get another material and decrease the durability of the tool without loosing the tool? I overrided the item container methods but the item is still consumed on craft: @Override public boolean hasContainerItem(ItemStack itemStack) { return true; } @Override public ItemStack getContainerItem(ItemStack itemStack) { if (itemStack.attemptDamageItem(1, random, null)) { itemStack.shrink(1); itemStack.setDamage(0); } return itemStack; } Thanks in advance!
    • diesieben07
      (1.16.2) Making a new capability (3)

      By diesieben07 · Posted 1 hour ago

      So now you just removed the @EventBusSubscriber annotation. I did not tell you to do this.
    • diesieben07
      [1.16.4] How i can open a container by clicking on my mob

      By diesieben07 · Posted 1 hour ago

      Do not use @OnlyIn.   I do not understand this question.
    • diesieben07
      Game crashes while loading world

      By diesieben07 · Posted 1 hour ago

      Please refer to the Optifine downloads page regarding compatibility with Forge.
  • Topics

    • st4s1k
      1
      [1.16.4] Smithing table custom recipe use durability

      By st4s1k
      Started 1 hour ago

    • e2rifia
      14
      (1.16.2) Making a new capability (3)

      By e2rifia
      Started 8 hours ago

    • Klarks
      13
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks
      Started 20 hours ago

    • Rollng
      1
      Game crashes while loading world

      By Rollng
      Started 1 hour ago

    • KEKEL
      1
      I have a problem with chisels and bits mod.

      By KEKEL
      Started 4 hours ago

  • Who's Online (See full list)

    • diesieben07
    • Heinzchen
    • pikadium
    • Danebi
    • jjreason88@gmail.com
    • clermont.holiday
    • BrooksWalkerNelson
    • Chumbanotz
    • Keyko_
    • MistyMarshes
    • FrostyTerror
    • Somonestolemyusername
    • Godis_apan
    • Talp1
    • BirdLady
    • JustAMeanie
    • JeefPeef
    • KEKEL
  • 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