We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

51

/gamerule doItemDespawning

8 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 2
    Registered User commented
    Comment actions Permalink

    The reason they despawn is so that the game won't crash due to there being too many items.  It's the same reason why mobs despawn.

  • 1
    Registered User commented
    Comment actions Permalink

    "The reason they despawn is so that the game won't crash due to there being too many items.  It's the same reason why mobs despawn." Then how come the game does not crash from all the blocks? If they could make blocks not crash the game why not items?

  • 3
    Registered User commented
    Comment actions Permalink

    Because blocks are not entities, while dropped items are. The game isn't rendering every block in the world whenever the chunk is loaded; only what can be seen. Entities work a little differently to that and have a *far* greater impact on game performance due to the many additional factors that an entity must consider, such as the AI in the case of mobs. This is why the game struggles to render 1000 zombies, but doesn't struggle to render 1000 blocks - they're not the same thing.

    While I understand what you're asking for, it would cause a performance problem if too many items end up floating around.

  • 2
    Registered User commented
    Comment actions Permalink

    If you dont belief that this creats a lot of lag put a repeating always active commandblock in your spawn chunks with the command: execute as @e[type=item] run data merge entity @s {Age:1}
    But be warned it can make your world unplayable if too many items lie around!

  • 3
    Registered User commented
    Comment actions Permalink

    I think that only the item dropped when a player dies should never despawn. Or at least give the player the option to do so,

    with a command that disables despawning only on items dropped by a player when he dies

  • 4
    Registered User commented
    Comment actions Permalink

    I feel like it should be more of a value instead of a binary action. Like "/gamerule itemDespawnTime (value)"

  • 0
    Registered User commented
    Comment actions Permalink

    yeah except it should also be like an option when making the world for people playing without cheats

  • 0
    Registered User commented
    Comment actions Permalink

    ulraf mentioned the idea, of named items not despawning. I think this is perfect as an optional game rule defaulted to on, so server owners can trun it off to prevent lag machines.