Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Maciej916

  1. Hello how can I get Fluid from Bucket ItemStack e.g LAVA from Lava Bucket, WATER from Water Bucket ect.
  2. Sorry that was my mistake i didn't realize that i have other method in that class using Minecraft instance. Now everything works correctly, thank you!
  3. I tried to use DistExecutor but error remain the same: public void handle(Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> { DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { PlayerEntity player = Minecraft.getInstance().player; IEnchants enchantsCap = PlayerUtil.getEnchantsCapability(player); enchantsCap.setMultiJump(multiJump); }); }); ctx.get().setPacketHandled(true); }
  4. Hello I want to sent packet from server to client and everything is working in single player but mod don't want to start on dedicated server because in packet I use Minecraft class. How can I fix this, can I use @OnlyIn() public class PacketMultiJumpSync { private final int multiJump; public PacketMultiJumpSync(int multiJump) { this.multiJump = multiJump; } public PacketMultiJumpSync(PacketBuffer buf) { multiJump = buf.readInt(); } public void toBytes(PacketBuffer buf) { buf.writeInt(multiJump); } public void handle(Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> { PlayerEntity player = Minecraft.getInstance().player; IEnchants enchantsCap = PlayerUtil.getEnchantsCapability(player); enchantsCap.setMultiJump(multiJump); }); ctx.get().setPacketHandled(true); } } INSTANCE.registerMessage(nextID(), PacketMultiJumpSync.class, PacketMultiJumpSync::toBytes, PacketMultiJumpSync::new, PacketMultiJumpSync::handle);
  5. I want to change amount of item drops and i want to do that by using BlockEvent.HarvestDropsEvent but it seems like it's never called and idk why. It's weird because i have other BlockEvents in this class and they work just fine. My forge version is 28.1.90 @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onHarvest(BlockEvent.HarvestDropsEvent event) { // not working } @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onPlace(BlockEvent.EntityPlaceEvent event) { // working } @SubscribeEvent public static void onBreak(BlockEvent.BreakEvent event) { // working }
  6. I'll check that but for now i managed to fix this by using capability and set it to true/false when space is pressed.
  7. Im making something like double jump and the thing is that it conflict with jumping when player holds space it fire multiple times. So I wanted to make it so player need to press space again to fire multi jump.
  8. I already found that mc.gameSettings.keyBindJump there is a method isPressed() that should fire only once. But the porblem is how to handle this, because when i use event KeyInputEvent i get true every tick.
  9. Where i can find any useful information how to do that? (I want to use already existing key for jump)
  10. Hello I want to detect key press only once but when i use InputEvent.KeyInputEvents it detect press and hold. How can I detect keypress only once? @SubscribeEvent public static void clientKeyInput(InputEvent.KeyInputEvent event) { }
  11. Im having troubles to get list of all enchanted books items
  12. So i try final Item.Properties properties = new Item.Properties().group(MOD_ITEM_GROUP); final EnchantedBookItem book = new EnchantedBookItem(properties); // register but it's still don't work
  13. Hello I want to add new enchant from my mod to my mod creative tab but i don't know how to do that. for (final Enchantment enchantment : ForgeRegistries.ENCHANTMENTS.getValues()) { final ResourceLocation enchantmentRegistryName = enchantment.getRegistryName(); if (!enchantmentRegistryName.getNamespace().equals(MyMod.MODID)) { continue; } final Item.Properties properties = new Item.Properties().group(MOD_ITEM_GROUP); // how to set ItemGroup }
  14. Hello, Is there an event what fire when user got teleported or if there is a way to detect player teleport.
  15. Hello I want to kick player from server but i can't find method to do that.
  16. Hello, Im having trouble to teleport player from the end to overworld. For example if player teleport from end to nether it or from nether to overworld it works just fine but if player wants to teleport from end to overworld it always teleport him to spawn location not coordinates i want to. Here is code what i use: public static void teleportPlayer(ServerPlayerEntity player, Location loc, boolean exact) { if (player.dimension.getId() != loc.dim) { player.changeDimension(DimensionType.getById(loc.dim)); } ServerWorld world = player.getServerWorld(); if (exact) { player.teleport(world, loc.posX, loc.posY, loc.posZ, loc.rotationYaw, loc.rotationPitch); } else { player.teleport(world, loc.x + 0.5, loc.y + 0.5, loc.z, player.rotationYaw, player.rotationPitch); } }
  17. Hello I have a problem because lang files are not working on client when mod is installed only on server, when i install mod also on client its working just fine. Is there a solution for that?
  18. It's weird I just downloaded lastest beta (1.14.4 - 28.1.26) and it worked without any issues.
  19. Maybe im doing something wrong. It looks like net.minecraft.block doesn't have Blocks class same for other includes maybe it downloaded wrong version or someting.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.