-
Posts
14 -
Joined
-
Last visited
Everything posted by JuSTGh0sT1242
-
[1.20.1 && 47.3.0] Custom DamageType isn't register.
JuSTGh0sT1242 replied to JuSTGh0sT1242's topic in Modder Support
UPD: I DID IT @Override public void applyEffectTick(LivingEntity livingEntity, int pAmplifier) { Level level = livingEntity.level(); if (!level.isClientSide()) { Holder<DamageType> entropyHolder = level .registryAccess() .registryOrThrow(Registries.DAMAGE_TYPE) .getHolderOrThrow(GTDamageTypes.ENTROPY_KEY); livingEntity.hurt(new DamageSource(entropyHolder), 1); } super.applyEffectTick(livingEntity, pAmplifier); } -
[1.20.1 && 47.3.0] Custom DamageType isn't register.
JuSTGh0sT1242 replied to JuSTGh0sT1242's topic in Modder Support
So I came to this public class ModDamageTypes{ public static void bootstrap(BootstapContext<DamageType> context) { context.register(GTDamageTypes.ENTROPY_KEY, new DamageType(GrimTales.MOD_ID + "_entropy", 0.1f)); } } public class GTDamageTypes implements DamageTypes { public static final ResourceKey<DamageType> ENTROPY_KEY = register("entropy"); private static ResourceKey<DamageType> register(String name) { return ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(GrimTales.MOD_ID, name)); } } public class ModWorldGenProvider extends DatapackBuiltinEntriesProvider { public static final RegistrySetBuilder BUILDER = new RegistrySetBuilder() .add(Registries.DAMAGE_TYPE, ModDamageTypes::bootstrap); public ModWorldGenProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> registries) { super(output, registries, BUILDER, Set.of(GrimTales.MOD_ID)); } But! I still have an issue that, I cannot just use Holder.direct, due to it will create error that "Required type: Holder<DamageType> Provided : Holder<ResourceKey<DamageType>>" And I still have no clue how to fix it -
[1.21] Allowing vanilla enchantments on custom items
JuSTGh0sT1242 replied to CodyRupp's topic in Modder Support
why do you need DiggerItem, just use Pickaxe/AxeItem etc. -
So, I am trying to create and add tags to my custom damage type, but looks like I made something wrong, since it crashing with error that "cannot register" damage type. Im trying to register it, and in datagen add tags, but it everytime crashing due to not register "grimtales:entropy". Full code there - https://github.com/undertakerJ/Grim-Tales-Forge ModDamageTypes class public class ModDamageTypes { public static final DeferredRegister<DamageType> DAMAGE_TYPES = DeferredRegister.create(Registries.DAMAGE_TYPE, GrimTales.MOD_ID); public static final ResourceKey<DamageType> ENTROPY_KEY = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(GrimTales.MOD_ID, "entropy")); public static final RegistryObject<DamageType> ENTROPY = DAMAGE_TYPES.register( "entropy", () -> new DamageType("entropy_effect", DamageScaling.ALWAYS, 1f, DamageEffects.HURT)); // // public static final DamageSource ENTROPY_SOURCE = new DamageSource(Holder.direct(ENTROPY.get())); public static void register(IEventBus eventBus) { DAMAGE_TYPES.register(eventBus); } } Datagen for damageTags public class ModDamageTagsProvider extends DamageTypeTagsProvider { public ModDamageTagsProvider( PackOutput p_270719_, CompletableFuture<HolderLookup.Provider> p_270256_, @Nullable ExistingFileHelper existingFileHelper) { super(p_270719_, p_270256_, GrimTales.MOD_ID, existingFileHelper); } @Override protected void addTags(HolderLookup.Provider pProvider) { this.tag(DamageTypeTags.BYPASSES_INVULNERABILITY).add(ModDamageTypes.ENTROPY_KEY); } } Datagen class it self @Mod.EventBusSubscriber(modid = GrimTales.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class DataGenerators { @SubscribeEvent public static void gatherData(GatherDataEvent event){ DataGenerator generator = event.getGenerator(); PackOutput packOutput = generator.getPackOutput(); ExistingFileHelper helper = event.getExistingFileHelper(); CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider(); generator.addProvider(event.includeServer(), new ModDamageTagsProvider(packOutput, lookupProvider, helper)); } } And register class in main class public GrimTales() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); ModDamageTypes.register(modEventBus); modEventBus.addListener(this::commonSetup); MinecraftForge.EVENT_BUS.register(this); modEventBus.addListener(this::addCreative); }
-
1.19.2 I want to commission a Copper tools and armor mod
JuSTGh0sT1242 replied to AdamantSteele's topic in General Discussion
add me in discord "undertaker_j" -
1.19.2 I want to commission a Copper tools and armor mod
JuSTGh0sT1242 replied to AdamantSteele's topic in General Discussion
Kaupenjoe on YT, but his tutorials not always the best way. Like, if you want to, I could do basic copper set, it will take not so much time. -
1.20.1 How do I create custom DamageSource in Forge 1.20.1?
JuSTGh0sT1242 replied to JuSTGh0sT1242's topic in Modder Support
Well, look like now needs this, but I cannot get it how to do it as damage source, cuz it requires now Holder public static final DamageType ENTROPY = new DamageType(GrimTales.MOD_ID + "entropy_effect", DamageScaling.ALWAYS,1f, DamageEffects.HURT); -
1.19.2 I want to commission a Copper tools and armor mod
JuSTGh0sT1242 replied to AdamantSteele's topic in General Discussion
Its can be done in like 20 minutes, no? Like literally, if go most basic with no like "oxidation" on tools or armor, and just use vanilla like textures for tools and armor(like iron but just copper colored) it will take a few lines of code. Like even I am can do this, in few hours. -
So, I try to make a katana, with katana and scabbard, is that possible to make 2 different models to be on player while he holding item? Katana in hands, and scabbard at belt.
-
So basically after spending sometime I fixed that by creating a new renderer for smoke zone.
-
So basically, I trying to create a "Smoke Bomb", and for that I made Item that throwing a smoke bomb projectile, and after smoke bomb projectile is hit block, it should create entity "smoke zone" but instead of that I got immediately crashed. I can't even make a renderer for this entity in mod class, it give an error, and I honestly don't know WHERE and WHY. public class SmokeBombEntity extends ThrowableItemProjectile { public SmokeBombEntity(EntityType<? extends ThrowableItemProjectile> pEntityType, Level pLevel) { super(pEntityType, pLevel); } public SmokeBombEntity(Level pLevel) { super(ModEntities.SMOKE_BOMB_PROJECTILE.get(), pLevel); } public SmokeBombEntity(Level pLevel, LivingEntity livingEntity) { super(ModEntities.SMOKE_BOMB_PROJECTILE.get(), livingEntity, pLevel); } @Override protected Item getDefaultItem() { return ModItems.SMOKE_BOMB.get(); } @Override protected void onHitBlock(BlockHitResult pResult) { if(!this.level.isClientSide) { SmokeZoneEntity smokeZone = new SmokeZoneEntity(ModEntities.SMOKE_ZONE_ENTITY.get(), level); smokeZone.setPos(getBlockX(),getBlockY(),getBlockZ()); this.level.addFreshEntity(smokeZone); } level.playSound((Player) null, getBlockX(), getBlockY(), getBlockZ(), SoundEvents.GLASS_BREAK, SoundSource.NEUTRAL, 0.5F, 0.4F); this.discard(); super.onHitBlock(pResult); } } public class SmokeZoneEntity extends Entity { public SmokeZoneEntity(EntityType<?> pEntityType, Level pLevel) { super(pEntityType, pLevel); this.noPhysics = true; } public SmokeZoneEntity(Level pLevel, double pX, double pY, double pZ) { this(ModEntities.SMOKE_ZONE_ENTITY.get(), pLevel); this.setPos(pX, pY, pZ); } public SmokeZoneEntity(Level pLevel) { super(ModEntities.SMOKE_ZONE_ENTITY.get(), pLevel); } protected void defineSynchedData() {} protected void readAdditionalSaveData(CompoundTag pCompound) {} protected void addAdditionalSaveData(CompoundTag pCompound) { } public Packet<?> getAddEntityPacket() { return new ClientboundAddEntityPacket(this); } } Also I can't render a smoke zone entity in a mod class, but smoke bomb projectile works completely fine @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { EntityRenderers.register(ModEntities.SMOKE_BOMB_PROJECTILE.get(), ThrownItemRenderer::new); //HERE AN ISSUE EntityRenderers.register(ModEntities.SMOKE_ZONE_ENTITY.get(), EntityRenderer::new); } } } GitHub repository
-
So basically, I added few recepies, and they worked fine, but this one isnt working at all, I double checked everything, but still isn't managed to find the reason. { "type": "minecraft:crafting_shaped", "pattern": [ "XXX" ], "key": { "X": { "item": "timeofsacrifice:cloth" } }, "result": { "item": "timeofsacrifice:bandage" } } If need code below, and Git is here(I don't think you need to "steal" this code, as someone already cried) { "type": "minecraft:crafting_shaped", "pattern": [ "XXX" ], "key": { "X": { "item": "timeofsacrifice:cloth" } }, "result": { "item": "timeofsacrifice:bandage" } }