Jump to content

Recommended Posts

Posted (edited)

 

it doesn´t matter how long i look, i cannot find the error.

 

the log says:

[Server thread/WARN] [minecraft/TileEntity]: Block entity invalid: minecraft:mob_spawner 

but i dont find or remember writing mob_spawner i always wrote spawner. 

Spoiler

 

the code i think that has the error (it doesnt show any in my IDE)


public class MobSpawner extends Block{
    
    public MobSpawner(Properties properties) {
        super(Properties.create(Material.IRON).hardnessAndResistance(3.0f, 3.0f).sound(SoundType.METAL));
        setRegistryName("minecraft:spawner");     
    } 
    @Override
    public TileEntity createTileEntity(BlockState state, IBlockReader world) {
        return new MobSpawnerTileEntity();
    }
    public BlockRenderLayer getRenderLayer()
    {
        return BlockRenderLayer.TRANSLUCENT;
    }
    
    @Override
    public boolean hasTileEntity(BlockState state) {
        return true;
    }
}

@Mod("spawntweak")
public class SpawnTweak{ 
    public static SpawnTweak instance;
    public static final String modid = "spawntweak";
    private static final Logger logger = LogManager.getLogger(modid);
    public SpawnTweak() {
        instance=this;
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries);
        MinecraftForge.EVENT_BUS.register(this);  
        }    
private void setup(final FMLCommonSetupEvent event) {        
        logger.info("setup registered");       
    }
    private void clientRegistries(final FMLClientSetupEvent event) {    
        logger.info("client registered");    
    }
    @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents{
        
        

        @SubscribeEvent
        public static void registerBlocks(final RegistryEvent.Register<Block> event) {
            event.getRegistry().registerAll(

            BlockList.spawner = new MobSpawner(null)
);
            logger.info("Blocks registered");
        }

        
        @SubscribeEvent
        public static void registerTileEntety(RegistryEvent.Register<TileEntityType<?>> event) {           
         TileEntityType<?> type = TileEntityType.Builder.create(MobSpawnerTileEntity::new,  BlockList.spawner).build(null);
          type.setRegistryName("minecraft:spawner");
          event.getRegistry().register(type);
        }
       
    }    
        
    }    
    

the MobSpawnerTileEntity is just the vanilla code

 

Here are my other classes but i think they are ok beacause they are mostly vanilla libaries

 

 

 

Edit: ok the official tag is minecraft:mob_spawner and not spawner, but why is it gone?

Edit2: ive now changed all minecraft:spawner to minecraft:mob_spawner. now i cannot pick up the "spawners"(prev. just blocks without the tile entity) with middle click anymore and after using / setblock minecraft crashed and gave this output:

[02:29:55] [Server thread/ERROR] [minecraft/Chunk]: A TileEntity type fabian.spawntweak.lists.MobSpawnerTileEntity has thrown an exception trying to write state. It will not persist, Report this to the mod author
java.lang.RuntimeException: class fabian.spawntweak.lists.MobSpawnerTileEntity is missing a mapping! This is a bug!
        at net.minecraft.tileentity.TileEntity.writeInternal(TileEntity.java:72) ~[?:?] {re:classloading}
        at net.minecraft.tileentity.TileEntity.write(TileEntity.java:66) ~[?:?] {re:classloading}
        at fabian.spawntweak.lists.MobSpawnerTileEntity.write(MobSpawnerTileEntity.java:72) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.Chunk.func_223134_j(Chunk.java:444) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.storage.ChunkSerializer.write(ChunkSerializer.java:303) ~[?:?] {re:classloading}
        at net.minecraft.world.server.ChunkManager.func_219229_a(ChunkManager.java:677) ~[?:?] {re:classloading}
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) [?:1.8.0_241] {}
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) [?:1.8.0_241] {}
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_241] {}
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) [?:1.8.0_241] {}
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_241] {}
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [?:1.8.0_241] {}
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) [?:1.8.0_241] {}
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) [?:1.8.0_241] {}
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_241] {}
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) [?:1.8.0_241] {}
        at net.minecraft.world.server.ChunkManager.save(ChunkManager.java:336) [?:?] {re:classloading}
        at net.minecraft.world.server.ServerChunkProvider.save(ServerChunkProvider.java:309) [?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.server.ServerWorld.save(ServerWorld.java:770) [?:?] {re:classloading}
        at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:528) [?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:571) [?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:235) [?:?] {re:classloading,pl:runtimedistcleaner:A}
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:685) [?:?] {re:classloading,pl:accesstransformer:B}
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_241] {}

someone on here with the same error said that he forgot to register it but i thought i had registered it here: 

@SubscribeEvent
public static void registerTileEntety(RegistryEvent.Register<TileEntityType<?>> event) {           
         TileEntityType<?> type = TileEntityType.Builder.create(MobSpawnerTileEntity::new,  BlockList.spawner).build(null);
          type.setRegistryName("minecraft:spawner");
          event.getRegistry().register(type);
        }

Edit 3 : i have now(for the vanilla textures that are for the block minecraft:spawner) changed the block in blockList back to spawner but left the id minecraft:mob_spawner. now the texture is shown again and if placed after /give(for some reason the command was now /give (id:)minecraft:spawner) the pig and fire particles appear for a brief moment and then minecraft crashes again with the same error

Edited by DarkAssassin
Posted
Just now, poopoodice said:

You should use your own modid?

i want to modify the vanilla spawner and in another Topic someone said that the best way to do so is to make your own spawner and override the registry entry with your own

Posted
7 minutes ago, DarkAssassin said:

i want to modify the vanilla spawner and in another Topic someone said that the best way to do so is to make your own spawner and override the registry entry with your own

where do you override it?

Posted (edited)
38 minutes ago, poopoodice said:

where do you override it?

i just realised that i dont override, i just make a block with the same id but the tile entity doesn´t correctly work when using a different id  either

he said that i should override Blocks.SPAWNER but how can i do that?

 

when using the id minecraft:spawner the spawner block is just a block and minecraft:mob_spawner does not exist but the log still says :

[Server thread/WARN] [minecraft/TileEntity]: Block entity invalid: minecraft:mob_spawner 

but when using the id minecraft:mob_spawner the game instantly crashes whan confronted with that block and this error log:

[02:29:55] [Server thread/ERROR] [minecraft/Chunk]: A TileEntity type fabian.spawntweak.lists.MobSpawnerTileEntity has thrown an exception trying to write state. It will not persist, Report this to the mod author java.lang.RuntimeException: class fabian.spawntweak.lists.MobSpawnerTileEntity is missing a mapping! This is a bug!         at net.minecraft.tileentity.TileEntity.writeInternal(TileEntity.java:72) ~[?:?] {re:classloading}         at net.minecraft.tileentity.TileEntity.write(TileEntity.java:66) ~[?:?] {re:classloading}         at fabian.spawntweak.lists.MobSpawnerTileEntity.write(MobSpawnerTileEntity.java:72) ~[?:?] {re:classloading}         at net.minecraft.world.chunk.Chunk.func_223134_j(Chunk.java:444) ~[?:?] {re:classloading}         at net.minecraft.world.chunk.storage.ChunkSerializer.write(ChunkSerializer.java:303) ~[?:?] {re:classloading}         at net.minecraft.world.server.ChunkManager.func_219229_a(ChunkManager.java:677) ~[?:?] {re:classloading}         at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) [?:1.8.0_241] {}         at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) [?:1.8.0_241] {}         at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_241] {}         at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) [?:1.8.0_241] {}         at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_241] {}         at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [?:1.8.0_241] {}         at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) [?:1.8.0_241] {}         at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) [?:1.8.0_241] {}         at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_241] {}         at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) [?:1.8.0_241] {}         at net.minecraft.world.server.ChunkManager.save(ChunkManager.java:336) [?:?] {re:classloading}         at net.minecraft.world.server.ServerChunkProvider.save(ServerChunkProvider.java:309) [?:?] {re:classloading,pl:accesstransformer:B}         at net.minecraft.world.server.ServerWorld.save(ServerWorld.java:770) [?:?] {re:classloading}         at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:528) [?:?] {re:classloading,pl:accesstransformer:B}         at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:571) [?:?] {re:classloading,pl:accesstransformer:B}         at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:235) [?:?] {re:classloading,pl:runtimedistcleaner:A}         at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:685) [?:?] {re:classloading,pl:accesstransformer:B}         at java.lang.Thread.run(Thread.java:748) [?:1.8.0_241] {}

ok i figured out that if the tileentityid is minecraft:mob_spawner the game crashes 

if the blockid is minecraft:spawner it replaces the original one

if the tileentityid is minecraft:spawner it does nothing.

Edited by DarkAssassin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.