Jump to content

LB2

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

LB2's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I just registered the entity type Thats the class: public class ModEntityTypes extends EntityType{ private static final Logger LOGGER = LogUtils.getLogger(); public static final DeferredRegister<EntityType<?>> MOD_ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITIES, Foodstuffs.MOD_ID); public static final EntityType<ModBoat> MOD_BOAT = register("mod_boat", ModEntityTypes.Builder.<ModBoat>of(ModBoat::new, MobCategory.MISC).sized(1.375F, 0.5625F).clientTrackingRange(10)); public static final EntityType<ModChestBoat> MOD_CHEST_BOAT = register("mod_chest_boat", ModEntityTypes.Builder.<ModChestBoat>of(ModChestBoat::new, MobCategory.MISC).sized(1.375F, 0.5625F).clientTrackingRange(10)); public ModEntityTypes(EntityFactory p_20574_, MobCategory p_20575_, boolean p_20576_, boolean p_20577_, boolean p_20578_, boolean p_20579_, ImmutableSet p_20580_, EntityDimensions p_20581_, int p_20582_, int p_20583_) { super(p_20574_, p_20575_, p_20576_, p_20577_, p_20578_, p_20579_, p_20580_, p_20581_, p_20582_, p_20583_); } private static <T extends Entity> EntityType<T> register(String p_20635_, ModEntityTypes.Builder<T> p_20636_) { return Registry.register(Registry.ENTITY_TYPE, p_20635_, p_20636_.build(p_20635_)); } public static void register(IEventBus eventBus) { MOD_ENTITY_TYPES.register(eventBus); } }
  2. I registered the Boat and Chest Boat Classes and I registered the entity type and the renderer Also i have an error when I spawn the boat, the world just crashes. (Caused by: java.lang.IllegalStateException: Registry is already frozen)
  3. I maded the Boat and the BoatItem classes and it works, but when i spawn the boat the world crashes
  4. public class ModBoat extends Boat { private static final EntityDataAccessor<Integer> DATA_ID_TYPE = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.INT); public ModBoat(EntityType<? extends Boat> p_38290_, Level p_38291_) { super(p_38290_, p_38291_); } public ModBoat.Type getModBoatType() { return ModBoat.Type.byId(this.entityData.get(DATA_ID_TYPE)); } public void setType(ModBoat.Type p_38333_) { this.entityData.set(DATA_ID_TYPE, p_38333_.ordinal()); } public static enum Type { CHERRY(ModBlocks.CHERRY_PLANKS.get(), "cherry"), ALMOND(ModBlocks.ALMOND_PLANKS.get(), "almond"), PEACH(ModBlocks.PEACH_PLANKS.get(), "peach"), APPLE(ModBlocks.APPLE_PLANKS.get(), "apple"), PLUM(ModBlocks.PLUM_PLANKS.get(), "plum"), PEAR(ModBlocks.PEAR_PLANKS.get(), "pear"); private final String name; private final Block planks; private Type(Block p_38427_, String p_38428_) { this.name = p_38428_; this.planks = p_38427_; } public String getName() { return this.name; } public Block getPlanks() { return this.planks; } public String toString() { return this.name; } public static ModBoat.Type byId(int p_38431_) { ModBoat.Type[] aboat$type = values(); if (p_38431_ < 0 || p_38431_ >= aboat$type.length) { p_38431_ = 0; } return aboat$type[p_38431_]; } } } ---------------------------------------------------------- Thats all I got in this class
  5. I maded a custom wood type and I want to add a boat.
  6. I found nothing that could help me (yes im dumb)
  7. You said to use BiomeColors.getAverageFoliageColor(), but I dont know what value to put in there. (sorry for dumb questions)
  8. I maded a biome datapack. I dont know how to import it.
  9. I maded a tree and I want it to spawn with vines but when I grow the sapling minecraft crashes. The code: public static final ConfiguredFeature<BaseTreeFeatureConfig, ?> JACARANDA = register("jacaranda", Feature.TREE.configured(( new BaseTreeFeatureConfig.Builder( new SimpleBlockStateProvider(com.LB.foodstuffs.block.ModBlocks.JACARANDA_LOG.get().defaultBlockState()), new SimpleBlockStateProvider(com.LB.foodstuffs.block.ModBlocks.JACARANDA_LEAVES.get().defaultBlockState()), new FancyFoliagePlacer(FeatureSpread.fixed(3), FeatureSpread.fixed(3), 3), new FancyTrunkPlacer(5, 4, 2), new TwoLayerFeature(1, 0, 1))).decorators((List<TreeDecorator>) new TrunkVineTreeDecorator()).build()));
  10. I maded a custom tree and I want it to generate in my own biome
×
×
  • Create New...

Important Information

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