You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
759 B
Java
26 lines
759 B
Java
package net.fabricmc.example;
|
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.sound.SoundEvents;
|
|
import net.minecraft.util.ActionResult;
|
|
import net.minecraft.util.Hand;
|
|
import net.minecraft.util.TypedActionResult;
|
|
import net.minecraft.world.World;
|
|
|
|
public class RingOfFlight extends Item {
|
|
|
|
public RingOfFlight(Settings settings) {
|
|
super(settings);
|
|
}
|
|
|
|
@Override
|
|
public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) {
|
|
playerEntity.playSound(SoundEvents.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F);
|
|
return new TypedActionResult<>(ActionResult.SUCCESS, playerEntity.getStackInHand(hand));
|
|
}
|
|
}
|
|
|
|
|