-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a52826b
commit acdd650
Showing
6 changed files
with
702 additions
and
126 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Icon | ||
|
||
<img src=".github/icon.png" alt='SurviRed'/> | ||
|
||
[Figma](https://www.figma.com/design/B4xgnDzzLQ11tZtaSKujFo/SurviRed?m=auto&t=UQ0XIsjsgI5N8PWV-1) |
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/pers/cierra_runis/survired/pickup/PickuoRightClickEventListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package pers.cierra_runis.survired.pickup | ||
|
||
import net.fabricmc.fabric.api.event.player.UseEntityCallback | ||
import net.minecraft.item.SpawnEggItem | ||
import net.minecraft.util.ActionResult | ||
|
||
class PickupRightClickEventListener { | ||
fun registerRightClickEvent() { | ||
UseEntityCallback.EVENT.register(UseEntityCallback { playerEntity, world, hand, entity, entityHitResult -> | ||
if (playerEntity.isSneaking) { | ||
entity.toString() | ||
val spawnEgg = SpawnEggItem.forEntity(entity.type) | ||
spawnEgg | ||
playerEntity.giveItemStack(spawnEgg) | ||
return@isSneaking ActionResult.SUCCESS | ||
} | ||
return@UseEntityCallback ActionResult.PASS | ||
}) | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters