Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FantaLaTone

Members
  • Joined

  • Last visited

Everything posted by FantaLaTone

  1. I did a lot of changes. Now all I need to do sync the HashMap data from server to client. I am using menus now. How I can sync the hashmap?
  2. Alright, so should I write the writeMap() method again under the first one?
  3. https://gist.github.com/fantalatone/65116264037b83955a99c8c014d328ef this is my current server to client packet's code and this is the error i am getting https://gist.github.com/fantalatone/6dc0501034cde16c21873f22e9aa6a2b
  4. I tried sending the OpenScreen packet from a custom command but it didn't worked
  5. I have a capability called NPCTrades and a screen class called NPCScreen. This is the current packet I am using to handle opening screen: https://gist.github.com/fantalatone/65116264037b83955a99c8c014d328ef But with this packet I can't set the hashmap in the constructor method of NPCScreen class (https://gist.github.com/fantalatone/8d309e1c6bcc86a2f5ba92c707a78f4e) How I can send capability data to a screen class?
  6. I want to make replace all the blocks that is not center of chunk with air. For ex. all the blocks in a chunk will be replaced by air except blocks that chunk position is [0 <y> 0] I used Mixins for WorldGenRegion class and i successfully did what i want to do with structures and features. But I want to replace all blocks not just structure and feature blocks. How I can do that? Which class should I modify to achieve this?
  7. i created an entity that implements PlayerRideable. currently when a player is riding the entity, entity do not climb blocks like horses do while you ride them. i looked all rideable entities' codes but i couldn't figured it out. can you help me? current codes here : https://gist.github.com/fantalatone/d9f44a948208ec954d2bfbdad1092acf
  8. I made it using initializing an entity in every tick. It worked for me.
  9. I have mod in 1.18. I want to write a log file every X seconds. How I can do that? I looked ITickHandler but I think it's not exist in 1.18.
  10. I have a block entity and a block entity renderer class. I want to render an entity inside block and I am kinda able to do that. When I first placed the block everything works fine. But when I save & load back the world entity is gone. How I can save the entity on server-side or render entity without spawning it. I need some answers how I can do that? Block Entity Class Base Block Class Renderer Class
  11. I am working on a mod that adds loot crates and I want to make every loot crate is different per world. Like: world1 - Loot Data -> Diamond Shovel world2 - Loot Data -> Diamond Helmet How I can achieve this? Any advice?
  12. I am a idiot. I noticed the problem finally. EntityRenderers.register(ModEntityTypes.WANDERING_RAIDER, EntityWanderingRaider::new); it should be this instead EntityRenderers.register(ModEntityTypes.WANDERING_RAIDER.get(), RendererWanderingRaider::new); I hate myself
  13. Hi! I have a mod entity class, model, renderer. I got error about types are not match. I am trying to fix it for the last 2 hours. Please help me. MainModFile.java (I get where it says ModEntityTypes.WANDERING_RAIDER.get(). It says "reason: Incompatible parameter types in method reference expression" ) private void clientSetup(final FMLClientSetupEvent event) { ItemBlockRenderTypes.setRenderLayer(ModBlocks.GOLDEN_OAK_LEAVES.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(ModBlocks.GOLDEN_OAK_SAPLING.get(), RenderType.cutout()); EntityRenderers.register(ModEntityTypes.WANDERING_RAIDER.get(), EntityWanderingRaider::new); } Entity Class https://pastebin.com/ktaFry3Q Mod Entity Types public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITIES, BetterMinecraftMod.MODID); public static final RegistryObject<EntityType<EntityWanderingRaider>> WANDERING_RAIDER = ENTITY_TYPES.register( "wandering_raider", () -> EntityType.Builder.of(EntityWanderingRaider::new, MobCategory.MONSTER) .sized(0.6f, 1.95f) .clientTrackingRange(10).build(new ResourceLocation(BetterMinecraftMod.MODID, "wandering_raider").toString()) ); public static void register(IEventBus bus) { ENTITY_TYPES.register(bus); }
  14. Your event is not supported now but thanks
  15. I tried this but it didn't work it is not cancellable so what I can do? @SubscribeEvent public static void livingEntityTargetChange(LivingSetAttackTargetEvent event) { if (event.getTarget() != null) { if (event.getTarget().hasEffect(ModEffects.PLAYING_DEAD.get())) { if (event.isCancelable()) { event.setCanceled(true); System.out.println("Hi5!"); } } } System.out.println("Hi!"); }
  16. Hello, I am working on a mod and I want add an effect that makes near hostile mobs unable to target player. For an example, if a player has the effect, no near mob can target to player. How I can achieve this effect? Any advice?
  17. I am not a god level dev so I have tried to copy vanilla effect registirations and I also tried setting base value of players attributes but none of them worked.
  18. Hello, I have a mod for custom effects. I want to add an effect that increase entity's speed and attack at the same time. I think I can do that by attributes. I looked into vanilla code a little bit but I couldn't figured out how to implement that. What should I do? Any open source project or an advice? public class Adrenaline extends MobEffect { public Adrenaline(MobEffectCategory pCategory, int pInt) { super(pCategory, pInt); } } public class ModEffects { public static final DeferredRegister<MobEffect> EFFECTS = DeferredRegister.create(ForgeRegistries.MOB_EFFECTS, BetterMinecraftMod.MODID); public static final RegistryObject<MobEffect> ADRENALINE = EFFECTS.register("adrenaline", () -> new Adrenaline(MobEffectCategory.BENEFICIAL, 9643043).addAttributeModifier( Attributes.MOVEMENT_SPEED, "91AEAA56-376B-4498-935B-2F7F68070630", 0.2D, AttributeModifier.Operation.MULTIPLY_TOTAL )); public static void register(IEventBus eventBus) { EFFECTS.register(eventBus); } }
  19. Yeah, you were right. Making mobs silent for sculk sensors is really easy. Make sure your mob is implementing these: implements VibrationListener.VibrationListenerConfig And then override these methods: @Override public boolean canTriggerAvoidVibration() { return true; // Actions will not cause vibration } @Override public boolean shouldListen(ServerLevel p_223872_, GameEventListener p_223873_, BlockPos p_223874_, GameEvent p_223875_, GameEvent.Context p_223876_) { return false; // Do not listen vibrations } @Override public void onSignalReceive(ServerLevel p_223865_, GameEventListener p_223866_, BlockPos p_223867_, GameEvent p_223868_, @Nullable Entity p_223869_, @Nullable Entity p_223870_, float p_223871_) { } @Override // I DON'T KNOW WHAT THIS ONE DO :( public boolean alwaysAccepts() { return false; }
  20. Hello, I have an entity and I want to make it unable to trigger sculk sensors like Warden. I looked the Warden's code but I couldn't find anything that I can use. How I can implement that feature?
  21. Ok I finally did it working. Everything works fine. Here's the last version of my codes: accesstransformers.cfg : public net.minecraft.client.player.LocalPlayer f_108601_ # crouching ModEvents.java : package com.fantalatone.sculknightmare.event; import com.fantalatone.sculknightmare.SculkNightmare; import com.fantalatone.sculknightmare.effect.ModEffects; import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.MovementInputUpdateEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = SculkNightmare.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModEvents { @SubscribeEvent public static void onPlayerTick(MovementInputUpdateEvent event) { LocalPlayer pPlayer = Minecraft.getInstance().player; if (pPlayer.hasEffect(ModEffects.LAZY_LEGS.get())) { event.getInput().shiftKeyDown = false; pPlayer.crouching = false; } } } Thanks for everybody helped me!
  22. package com.fantalatone.sculknightmare.event; import com.fantalatone.sculknightmare.SculkNightmare; import com.fantalatone.sculknightmare.effect.ModEffects; import net.minecraft.client.Minecraft; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Pose; import net.minecraft.world.entity.monster.Creeper; import net.minecraft.world.entity.player.Player; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.InputEvent; import net.minecraftforge.client.event.MovementInputUpdateEvent; import net.minecraftforge.event.TickEvent; import net.minecraftforge.event.entity.EntityJoinLevelEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = SculkNightmare.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModEvents { @SubscribeEvent public static void onKeyInput(InputEvent.Key event) { if (Minecraft.getInstance().screen != null) return; if (event.getKey() == 340) { Player pPlayer = Minecraft.getInstance().player; if (pPlayer.hasEffect(ModEffects.LAZY_LEGS.get())) { } } } @SubscribeEvent public static void onPlayerTick(MovementInputUpdateEvent event) { Minecraft.getInstance().player.crouching = false; } @SubscribeEvent public static void onEntityJoin(EntityJoinLevelEvent event) { if (event.getEntity() instanceof Creeper) { ((Creeper) event.getEntity()).explosionRadius = 20; } } }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.