-
Posts
19 -
Joined
-
Last visited
Everything posted by ISenseHostility
-
Hello, As the title states, my mod attempts to load the client-only LocalPlayer class on the dedicated server, which crashes the server. Here is the log: https://www.toptal.com/developers/hastebin/erokehabir.sql Here is the github link to the class I believe is causing the problem: https://github.com/ISenseHostility/EnchantableStaffs/blob/latest/src/main/java/isensehostility/enchantable_staffs/item/Staff.java Any help is appreciated.
-
[1.18.2] Problems registering custom arrow entity
ISenseHostility replied to ISenseHostility's topic in Modder Support
That worked, thank you! -
[1.18.2] Problems registering custom arrow entity
ISenseHostility replied to ISenseHostility's topic in Modder Support
That sadly doesn't work, as it wants this constructor (bottom constructor): It should use the top contructor, which it does when I remove the second one: However, I need the second constructor, because it is used in the createArrow method: Any ideas as to why it is doing this? -
I seem to be overlooking something as I am getting an error I'm not sure how to fix, as I thought I did it correctly. public class EntityInit { private static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, PrimitiveStart.MODID); public static void initialize() { ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static final RegistryObject<EntityType<BoneArrow>> BONE_ARROW = ENTITIES.register("bone_arrow", () -> EntityType.Builder .of(BoneArrow::new, MobCategory.MISC) .sized(0.5F, 0.5F) .clientTrackingRange(4) .updateInterval(20) .build(new ResourceLocation(PrimitiveStart.MODID, "bone_arrow").toString()) ); } Above code seems to have the following problem: This is the BoneArrow class in question: public class BoneArrow extends AbstractArrow { public BoneArrow(EntityType<? extends AbstractArrow> p_36721_, Level p_36722_) { super(p_36721_, p_36722_); } public BoneArrow(LivingEntity p_36718_, Level p_36719_) { super(EntityInit.BONE_ARROW.get(), p_36718_, p_36719_); } @Override protected ItemStack getPickupItem() { return new ItemStack(ItemInit.BONE_ARROW.get()); } } Any help is appreciated.
-
[1.17.1] Plant doesn't render with cutout texture
ISenseHostility replied to ISenseHostility's topic in Modder Support
You're right, the event wasn't fired. Turns out it was fired on the mod event bus instead of the forge one. Thank you! -
Hello, I have been trying to make a plant that has transparent parts. I'm pretty sure I need to set the RenderType to cutout for this, but what I have currently isn't doing anything. I'm pretty sure this is wrong: https://hastebin.com/focitibabo.swift Thanks
-
Hello, I have been getting the error stated in the title when trying to start a new project on 1.17.1 The full error: I have attempted to go to this file location manually, but the 'bundled_repo' folder doesn't exist. I'm not sure where the problem is, so if I need to send anything please tell me. Thank you
-
[1.16.5] Game crashes because of MeleeAttackGoal#tick
ISenseHostility replied to ISenseHostility's topic in Modder Support
This fixed it, thank you! -
Here is a clip to explain: https://streamable.com/5xjofu Basically, when I walk out of range, I get a NullPointerException at LookController#setLookAt when it's being called from MeleeAttackGoal#tick. Here is the log: https://privatebin.net/?05d1c1f8826d8bb2#79SvshoEzUji3NxL2oqTR2fi3CVzq66JPfps4HV1xTDb Here is the class of the entity in question: package com.isensehostility.entity_testing.entities; import net.minecraft.entity.*; import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.entity.ai.attributes.Attributes; import net.minecraft.entity.ai.goal.*; import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import javax.annotation.Nullable; public class GobletEntity extends CreatureEntity { public GobletEntity(EntityType<? extends CreatureEntity> type, World worldIn) { super(type, worldIn); } @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new SwimGoal(this)); this.goalSelector.addGoal(7, new WaterAvoidingRandomWalkingGoal(this, 1.0d)); this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.3D, true)); this.goalSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true)); } public static AttributeModifierMap.MutableAttribute setAttributes() { return MobEntity.createMobAttributes() .add(Attributes.MAX_HEALTH, 1.0D) .add(Attributes.MOVEMENT_SPEED, 0.25D) .add(Attributes.ATTACK_DAMAGE, 2.0D); } } I'm not sure what is causing the error, or how to fix it. Any help is appreciated.
-
[1.16.5] Entity has no attributes
ISenseHostility replied to ISenseHostility's topic in Modder Support
I forgot to say, this fixed the attribute problem. -
I am having a problem with entity attributes. I feel like have set them correctly, but when I launch the game I get multiple errors stating that I, in fact, have not. I'm not sure where the problem lies, so I was hoping someone could help me. Here is the log: https://privatebin.net/?0938f12eb189ae59#H5EKLWjp8BL2iZ6tAgVFmAyheUSmJDVhBgMcbHS12G79 Here is the entity class: Here is the registry class: Here is the main class: If more info is needed tell me and I will add it.
-
[1.16.5] Couldn't parse loot modifier error
ISenseHostility replied to ISenseHostility's topic in Modder Support
It works now, I made a stupid spelling mistake in the global_loot_modifiers.json so it wasnt registering. Thank you for trying to help despite my dumb mistake. -
[1.16.5] Couldn't parse loot modifier error
ISenseHostility replied to ISenseHostility's topic in Modder Support
Oh my god sorry for wasting your time I see the spelling mistake in global_loot_modifiers.json -
[1.16.5] Couldn't parse loot modifier error
ISenseHostility replied to ISenseHostility's topic in Modder Support
global_loot_modifiers.json: { "replace": false, "entries": [ "enchantment_enchancements:midas_modifier" ] } -
[1.16.5] Couldn't parse loot modifier error
ISenseHostility replied to ISenseHostility's topic in Modder Support
Oops, I forgot to start the world there. This should be the correct one: https://privatebin.net/?642aefdf9db0e663#2KBFD9ZU3o57RkDcFYQQHyjU9p1yDpAtrK4B7NV3sVYu -
[1.16.5] Couldn't parse loot modifier error
ISenseHostility replied to ISenseHostility's topic in Modder Support
Link to a pastebin for the full log: https://privatebin.net/?88a5d5a33b23f589#3FDdN327mqNbckkHUsejGkMUuEVJcKhzbQrJ8qJbbsEp -
I was wondering if anyone knows what is causing this error / how to fix it. The full error: The modifier JSON: { "type": "enchantment_enhancements:midas_modifier", "conditions": [ { "condition": "minecraft:match_tool", "predicate": { "enchantments": [ { "enchantment": "enchantment_enhancements:midas", "levels": { "min": 1 } } ] } } ], "curseItem": "minecraft:gold_nugget" } How I'm registering the modifier serializer: package com.isensehostility.enchantment_enhancements.registries; import com.isensehostility.enchantment_enhancements.EnchantmentEnhancements; import com.isensehostility.enchantment_enhancements.loot_modifiers.MidasEnchantmentModifier; import net.minecraftforge.common.loot.GlobalLootModifierSerializer; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.IForgeRegistry; @Mod.EventBusSubscriber(modid = EnchantmentEnhancements.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class SerializerRegistry { @SubscribeEvent public static void registerModifierSerializers(final RegistryEvent.Register< GlobalLootModifierSerializer<?>> event) { IForgeRegistry<GlobalLootModifierSerializer<?>> registry = event.getRegistry(); register(registry, new MidasEnchantmentModifier.Serializer(), "midas_modifier"); } private static void register(IForgeRegistry<GlobalLootModifierSerializer<?>> registry, GlobalLootModifierSerializer<?> serializer, String name) { registry.register(serializer.setRegistryName(EnchantmentEnhancements.locate(name))); } } The modifier itself: package com.isensehostility.enchantment_enhancements.loot_modifiers; import com.google.gson.JsonObject; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.loot.LootContext; import net.minecraft.loot.conditions.ILootCondition; import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.loot.GlobalLootModifierSerializer; import net.minecraftforge.common.loot.LootModifier; import net.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nonnull; import java.util.List; public class MidasEnchantmentModifier extends LootModifier { private final Item curseItem; public MidasEnchantmentModifier(ILootCondition[] conditionsIn, Item nugget) { super(conditionsIn); this.curseItem = nugget; } @Nonnull @Override public List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) { generatedLoot.add(new ItemStack(curseItem)); return generatedLoot; } public static class Serializer extends GlobalLootModifierSerializer<MidasEnchantmentModifier> { @Override public MidasEnchantmentModifier read(ResourceLocation name, JsonObject object, ILootCondition[] conditionsIn) { Item gold_nugget = ForgeRegistries.ITEMS.getValue(new ResourceLocation(JSONUtils.getString(object, "curseItem"))); return new MidasEnchantmentModifier(conditionsIn, gold_nugget); } @Override public JsonObject write(MidasEnchantmentModifier instance) { return null; } } } I thought I did everything correctly, but clearly that is not the case. Any help is appreciated.