#Custom Entity Not Working

1 messages · Page 1 of 1 (latest)

steady inlet
#

this is my code
Main

package dzcore;

import cn.nukkit.plugin.PluginBase;
import cn.nukkit.registry.EntityRegistry;
import cn.nukkit.registry.RegisterException;
import cn.nukkit.registry.Registries;
import dzcore.items.menu_book;
import dzcore.entities.map_table;

public class Main extends PluginBase {

    private static Main instance;

    private static Main getInstance() {
        return instance;
    }
    @Override
    public void onEnable() {
        getLogger().info("DzCore has been enabled!");
        Main.instance = this;
    }

    @Override
    public void onDisable() {
        getLogger().info("DzCore has been disabled!");
    }

    @Override
    public void onLoad() {
        instance = this;
        getLogger().info("DzCore has been loaded!");

        try {
            Registries.ITEM.registerCustomItem(this, menu_book.class);
            Registries.ENTITY.registerCustomEntity
                    (this, new EntityRegistry.CustomEntityDefinition("dz:map_table","",false, true), map_table.class);
        } catch (RegisterException e) {
            throw new RuntimeException(e);
        }
    }
}
#

This is Entity

package dzcore.entities;


import cn.nukkit.entity.Entity;
import cn.nukkit.entity.custom.CustomEntity;
import cn.nukkit.level.format.IChunk;
import cn.nukkit.nbt.tag.CompoundTag;
import org.jetbrains.annotations.NotNull;

public class map_table extends Entity implements CustomEntity {

    public map_table(IChunk chunk, CompoundTag nbt) {
        super(chunk, nbt);
    }

    @Override
    public @NotNull String getIdentifier() {
        return "dz:map_table";
    }

    @Override
    public String getOriginalName() {
        return "Map Table";
    }
}
charred stag
#

use /summon dz:map_table

steady inlet
#

Oh it's work
At first I thought it didn't autocomplete so it didn't work, haha.

#

@charred stag How to set Entity Hitbox?

charred stag
#

I think you have to do that in your texture pack but idk