Do not reimplement interactions for rightclicking
All checks were successful
build / build (21) (push) Successful in 2m25s
All checks were successful
build / build (21) (push) Successful in 2m25s
This commit is contained in:
parent
523477deb9
commit
56e4eb4cf0
2 changed files with 18 additions and 12 deletions
|
@ -11,6 +11,15 @@
|
||||||
You get speed 2 when doing damage. **Your superfood are uncooked meats.**
|
You get speed 2 when doing damage. **Your superfood are uncooked meats.**
|
||||||
5. Cow
|
5. Cow
|
||||||
When you hit a mob, there's a 30% chance of slowing them down. Works on players aswell. **Your superfoods are apples, golden apples, and carrots.**
|
When you hit a mob, there's a 30% chance of slowing them down. Works on players aswell. **Your superfoods are apples, golden apples, and carrots.**
|
||||||
|
## **Interactions**
|
||||||
|
1. headpats - You can also rightclick to headpat a animal.
|
||||||
|
2. kiss
|
||||||
|
3. bite
|
||||||
|
4. scratch
|
||||||
|
5. hug
|
||||||
|
6. cuddle
|
||||||
|
7. boop
|
||||||
|
8. nuzzle
|
||||||
## **Chat**
|
## **Chat**
|
||||||
Chat while you are a animal is very different. When you speak, your words will become furry-ified and every time you talk you'll have animal sounds come out of you. You can disable this via /chatmodoff, and turn it back on via /chatmodon.
|
Chat while you are a animal is very different. When you speak, your words will become furry-ified and every time you talk you'll have animal sounds come out of you. You can disable this via /chatmodoff, and turn it back on via /chatmodon.
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,9 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
|
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
|
||||||
import net.fabricmc.fabric.api.event.player.UseEntityCallback;
|
import net.fabricmc.fabric.api.event.player.UseEntityCallback;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
|
@ -58,6 +60,7 @@ public class AnimalRP implements ModInitializer {
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
|
|
||||||
String catAscii = """
|
String catAscii = """
|
||||||
|
|
||||||
|\\ _,,,---,,_
|
|\\ _,,,---,,_
|
||||||
ZZZzz /,`.-'`' -. ;-;;,_
|
ZZZzz /,`.-'`' -. ;-;;,_
|
||||||
|,4- ) )-,_. ,\\ ( `'-'
|
|,4- ) )-,_. ,\\ ( `'-'
|
||||||
|
@ -139,18 +142,12 @@ ZZZzz /,`.-'`' -. ;-;;,_
|
||||||
|
|
||||||
lastPetTimes.put(attackerId, currentTime);
|
lastPetTimes.put(attackerId, currentTime);
|
||||||
|
|
||||||
attackee.sendMessage(AnimalRP.parseText(
|
MinecraftServer server = attacker.getServer();
|
||||||
String.format("%s petted you! %s",
|
if (server != null) {
|
||||||
"<light_purple>" + attacker.getName().getString() + "</light_purple>",
|
server.execute(() -> {
|
||||||
"<italic><gray>" + attackerAnimal.catchphrase)), false);
|
server.getCommandManager().executeWithPrefix(attacker.getCommandSource((ServerWorld) world), "headpats " + attackee.getName().getString());
|
||||||
attacker.sendMessage(AnimalRP.parseText(
|
});
|
||||||
String.format("You petted %s! %s",
|
}
|
||||||
"<light_purple>" + attackee.getName().getString() + "</light_purple>",
|
|
||||||
"<italic><gray>" + attackeeAnimal.catchphrase)), false);
|
|
||||||
attacker.getWorld().playSound(attackee, attackee.getBlockPos(),
|
|
||||||
attackeeAnimal.moodSounds.get(Mood.CUTE), SoundCategory.PLAYERS, 1F,
|
|
||||||
1);
|
|
||||||
|
|
||||||
System.out.println(attackee.getNameForScoreboard() + " was rightclicked by " + attacker.getNameForScoreboard());
|
System.out.println(attackee.getNameForScoreboard() + " was rightclicked by " + attacker.getNameForScoreboard());
|
||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue