Jump to content

Rex_Technology

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Rex_Technology

  1. I'm trying to make an item that when I right click it a falling block shoots from the position of the player, in the direction where the player is looking but, I tried FallingBlockEntity fallingBlock = FallingBlockEntity.fall(event.getLevel(), event.getPos(), Blocks.DIRT.defaultBlockState()); and setting the delta movement to the look angle of the player but the falling block just falls from the players feet to 2 block and then disappears and reappears near as a full block on a block near the crosshair. I don't know what to do.
  2. I just found a tutorial for events for forge 1.19, Thank you, my problem is solved
  3. but Can I modify a sick in other modloaders?(like fabric or spigot)
  4. So, I'm trying to make a harry potter mod where when you shift + right click a stick it transforms into a wand(a custom item). I've created a class for what should the vannila stick do: package com.rextechnology.rexmod.item.custom; import com.rextechnology.rexmod.item.ModItems; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import org.jetbrains.annotations.Nullable; import java.util.List; public class StickItem extends Item { public StickItem(Properties pProperties) { super(pProperties); } @Override public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List<Component> pTooltipComponents, TooltipFlag pIsAdvanced) { pTooltipComponents.add(Component.literal("§6Shift §6+ §6click to convert to a wand")); super.appendHoverText(pStack, pLevel, pTooltipComponents, pIsAdvanced); } @Override public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pUsedHand) { if (pPlayer.isShiftKeyDown()) { pPlayer.setItemInHand(pUsedHand, new ItemStack(ModItems.WAND.get())); } return super.use(pLevel, pPlayer, pUsedHand); } } but I dont know how to make this class be used by the vannila stick
  5. I already learned java, I followed a java tutorial made by Kaupenjoe that is made for minecraft modding
  6. In java and in minecraft modding. I've learned java for minecraft modding.
  7. Ok, thank you but how do I start the timer?
  8. So I want to create a delay in my method that destroys a block, waits for 20 ticks and then destroys the block below the destroyed one Thank you
×
×
  • Create New...

Important Information

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