Create a mod for ASMR keyboards
I’ll create a minimal Fabric 1.21.11 mod with an ASMR Keyboard item: right-clicking plays a soft randomized key-click sound, emits a small visual cue, and applies a short cooldown.
Created a Fabric 1.21.11 mod named ASMR Keyboards.
Adds an ASMR Keyboard item.
Right-clicking plays a randomized soft wooden key-click.
Includes a short cooldown to prevent spam.
Includes Fabric/Loom project setup, item registration, language entry, and mandatory 1.21.11 item model files.
Uses the vanilla writable-book texture as a temporary keyboard visual.
The compilation failed with this error:
Compilation failed with 10 error(s):
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 9: cannot find symbol
import net.minecraft.util.TypedActionResult;
^
symbol: class TypedActionResult
location: package net.minecraft.util
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 18: cannot find symbol
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
^
symbol: class TypedActionResult
location: class AsmrKeyboardItem
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 28: cannot find symbol
SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_ON.value(),
^
symbol: method value()
location: variable BLOCK_WOODEN_BUTTON_CLICK_ON of type SoundEvent
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 33: no suitable method found for set(AsmrKeyboardItem,int)
user.getItemCooldownManager().set(this, 4);
^
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 36: cannot find symbol
return TypedActionResult.success(stack, world.isClient());
^
symbol: variable TypedActionResult
location: class AsmrKeyboardItem
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 33: no suitable method found for set(AsmrKeyboardItem,int)
user.getItemCooldownManager().set(this, 4);
^
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 9: cannot find symbol
import net.minecraft.util.TypedActionResult;
^
symbol: class TypedActionResult
location: package net.minecraft.util
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 18: cannot find symbol
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
^
symbol: class TypedActionResult
location: class AsmrKeyboardItem
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 36: cannot find symbol
return TypedActionResult.success(stack, world.isClient());
^
symbol: variable TypedActionResult
location: class AsmrKeyboardItem
ERROR in src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java at line 28: cannot find symbol
SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_ON.value(),
^
symbol: method value()
location: variable BLOCK_WOODEN_BUTTON_CLICK_ON of type SoundEvent
=== COMPILATION ERROR ANALYSIS ===
MISSING CLASSES:
- TypedActionResult
ACTION: Create these classes or check imports
MISSING METHODS:
- value()
ACTION: Check method names and signatures
FILES TO INVESTIGATE:
- src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java
- src/main/java/com/kodari/asmrkeyboards/AsmrKeyboardItem.java
Please fix this error by creating a new artifact with the corrected code.
Replace the removed
TypedActionResult<ItemStack>API withActionResult.Use the direct
SoundEventconstant and apply cooldown to the heldItemStack.
Fixed AsmrKeyboardItem.java for Fabric 1.21.11:
Replaced removed
TypedActionResult<ItemStack>withActionResult.Removed the invalid
.value()call fromSoundEvents.BLOCK_WOODEN_BUTTON_CLICK_ON.Updated cooldown handling to use the held
ItemStack.Updated the success return to
ActionResult.success(world.isClient()).
package com.kodari.asmrkeyboards;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AsmrKeyboards implements ModInitializer {
public static final String MOD_ID = "asmr_keyboards";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
@Override
public void onInitialize() {
ModItems.initialize();
}
}