-
Posts
57 -
Joined
-
Last visited
Posts posted by Maciej916
-
-
I understand your point, but is it possible to get default blockstate and get a texture out of that ?
-
Hell I want to draw in my gui fluid texture e.g water, lava but Im having troubles of getting ResourceLocation of teqture from FluidStack
-
Thank you, that was easier than i expected. ?
-
How I can use multiple texture locations while drawing gui elements. I know how to use only one texture. Please be tolerant Im trying to learn something new.
@Override protected void drawGuiContainerBackgroundLayer(final float partialTicks, final int mouseX, final int mouseY) { RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); getMinecraft().getTextureManager().bindTexture(BACKGROUND_TEXTURE); int startX = this.guiLeft; int startY = this.guiTop; this.blit(startX, startY, 0, 0, this.xSize, this.ySize); this.blit(x, y, u, v, width, height); // How can i draw another element here using other texture than "BACKGROUND_TEXTURE" }
-
Thank you, that's what i looked for
-
Hello how can I get Fluid from Bucket ItemStack e.g LAVA from Lava Bucket, WATER from Water Bucket ect.
-
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!
-
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); }
-
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);
-
-
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 }
-
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.
-
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.
-
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.
-
Where i can find any useful information how to do that? (I want to use already existing key for jump)
-
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) { }
-
Im having troubles to get list of all enchanted books items
-
So i have Items.ENCHANTED_BOOK and what's next?
-
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
-
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 }
-
Hello, Is there an event what fire when user got teleported or if there is a way to detect player teleport.
-
Thank you, that's what i needed.
-
Hello I want to kick player from server but i can't find method to do that.
-
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); } }
[1.15] Tickable world capability
in Modder Support
Posted
Hello is it possible to make tickable world capability? When i implements ITickable it's working fine untill its run on client, when i run it on server it crash.