mojira.dev
MC-31577

Some arrows shot into a block never despawn

Arrows shot from skeletons and (likely) infinity bows as well do not despawn over time (didn't test infinity because I don't have it yet..). Normally, these dissapear after 5 minutes of sitting like any dropped item, xp orb or similar entity. These count as entities in the world, so they can contribute to entity lag like that of item frames, minecarts, glitched items or other things.

The server I've been playing the snapshots on has a skeleton farm within the spawn chunks (meaning that the area is loaded 100% of the time). After 2 days or so of this farm being used briefly after 37b release, roughly 700 arrows have accumulated there since skeletons can see through the corner of blocks sometimes, depending on the block and angle, and shoot at you. Normally this isn't a problem, but the arrows don't despawn.. and it's within spawn chunks, so the lag from them is always there.

The picture with the sky shot is outside of spawn/skeleton farm range, standard entity count of 110ish. The picture with the furnace + chest is within the same room as the farm, but looking away (800+ entities). Proof shot of the skeleton farm is there. And the picture with the dispenser is the most direct shot of the arrows. See those glitched out ones inside it? Yeah, 680 or so. You can also see the fps drop, which I didn't really look at until now (37 on far to 10 on tiny).

Linked issues

MC-32204 arrows do not despawn from farmland Resolved MC-33330 Arrows Not Despawning Resolved MC-34113 Arrows Don't Despawn Resolved MC-34582 Arrows are entities, No despawn Resolved MC-38974 Sugar Cane + Light Source FPS issue Resolved

Attachments

Comments 51

It seems to be fixed in 13w38a. Arrows seem to despawn within 30-60 seconds after being shot by skeletons now. I threw up about 1500 of them from skeletons for testing's sake, and it took far less than 5 minutes for them to despawn if no updates occur to them (break the block they're stuck to, etc will reset the despawn timer). That was done in singleplayer, I'll have to see if it's any different on the server I'll be playing snapshots on.

I checked on the server, and the arrow count didn't go down at all when waiting for the arrows to despawn.. That sucks.

Still no change on the server, but I think they changed the entity ID if that's possible. If they used the same one from 37a/b in 38a-c, it may fix itself. Otherwise, I don't know. I just know that no new arrows are stacking up. All old ones are still all over the world.

41 more comments

Did my previous comment just got deleted without any notice?

Anyhow, here a more informative comment about this issue: This one is in my opinion the most annoying bug in 1.7.x and causes unecessary lag, please fix this soon!
The issue is not just temporary, e.g. I've been having an arrow stuck in the ground in front of my house for the last 2 months now. I've restarted my server a couple of times inbetween so that did not fix it. (I'm using 1.7.4, was it perhaps fixed in 1.7.4 but broken arrows from 1.7.2 still persist or so?)

So I checked with my world save with some code. Just around my house, I'm finding over a hundred unique arrows stuck somewhere. I don't know why but all relevant arrow variables related to despawning are Zero, expect its coordinates. When I shoot new arrows, these seems to be ok though. I hope this can be of some help to someone.

One example:

found arrow with entityid 1493 (total found: 116)
motion: -0.0/0.0
arrowshake: 0
ticks in air 0
inground: 0
xtile: 56
ytile: 41
ztile: -375
life: 0
intile: 0
indata: 0

Variables printed with this (badly written) forgecode ('started' is set at FMLServerStartedEvent):

Hashtable<Integer, EntityArrow>arrows = new Hashtable<Integer, EntityArrow>();
    
    @SubscribeEvent 
    public void onEntityUpdate(EntityEvent event) {
    	if (!started) return;
    	
    	if (event.entity instanceof EntityArrow) {
    		EntityArrow arrow = (EntityArrow)event.entity;
    		
    		if ((!arrows.containsKey(arrow.getEntityId()) && arrow.posX != 0)) {
    			System.out.println("found arrow with entityid " + arrow.getEntityId() + " (total found: " + arrows.size() + ")");
	    		
    			arrows.put(arrow.getEntityId(), arrow);
    			
    			System.out.println("motion: " + arrow.motionX + "/" + arrow.motionZ);
    			System.out.println("arrowshake: " + arrow.arrowShake);	
                  
    			try {
    				Field field = EntityArrow.class.getDeclaredField("ticksInAir");
    				field.setAccessible(true);
        	    	int ticksinair = (Integer)field.get(arrow);
        	    	System.out.println("ticks in air " + ticksinair);
    			} catch (Exception e) {
    				System.out.println(e.getMessage());
    			}
    			
	    		NBTTagCompound nbttagcompound = new NBTTagCompound();
	            arrow.writeEntityToNBT(nbttagcompound);
	            
	            System.out.println("inground: " + nbttagcompound.getByte("inGround"));
	            System.out.println("xtile: " + nbttagcompound.getShort("xTile"));
	            System.out.println("ytile: " + nbttagcompound.getShort("yTile"));
	            System.out.println("ztile: " + nbttagcompound.getShort("zTile"));
	            
	            System.out.println("life: " + nbttagcompound.getShort("life"));
	            System.out.println("intile: " + nbttagcompound.getByte("inTile"));
	            System.out.println("indata: " + nbttagcompound.getByte("inData"));
    		}
    	}
    }

[Edit:]
I just broke the block beneath on of the never despawning arrows and it despawned! So looks pretty surely to me like 1.7.2 arrows saved to the world don't despawn in 1.7.4. - perhaps some missing nbt data?

Evedence of this bug can be found in the most recent BdeoubleO mindcrack episode.

When Bdubs starts taking down the fairy over Town hall 2 arrows are found inside the fairy. These same arrows were fired at MCgamer when he was building the fairy at the beginning of February during a Mindcrack @ Dusk Livestream.

Jump to 13:17
https://www.youtube.com/watch?v=zqnQ60kORkw

Mindcrack server is running Snapshot 14w11b Arrows were shot at Mcgamer when the server was running 1.7.2

You can actually find these same arrows for your self by going on the playmindcrack server. Go to Museum Season 4 map. Climb on top of town hall and look up at the back side of the fairy in the head in the yellow wool blocks.

Is this still a concern in the current Minecraft version 1.8.1 Prerelease 3 / Launcher version 1.5.3 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Based on @unknown's comment the *onGround* tag was invalid. As soon as it is in a block, it should have *inGround:1b*. The *inTile* tag is wrong as well, 0 means Air so it thinks the arrow is still flying (in 1.8.x the *inTile* tag is an empty string when it didn't hit a block). One thing which would have been interesting is if the *xTile*, *yTile* and *zTile* refered to a block or to air.

I can however not confirm this

Can not reproduce in 16w05a

Grave

Nathan Adams

Confirmed

FPS, arrow, drops, infinity, lag, server, skeletons

Minecraft 13w37b, Minecraft 13w39b, Minecraft 13w41a, Minecraft 13w41b, Minecraft 1.7.2, ..., Minecraft 14w08a, Minecraft 1.7.5, Minecraft 14w10c, Minecraft 14w11b, Minecraft 1.7.6-pre2

Minecraft 13w38a, Minecraft 13w42a, Minecraft 1.8.9

Retrieved