Skip to content

Commit 4f465d5

Browse files
committed
Feature: FakePlayer
1 parent 9ad8e56 commit 4f465d5

File tree

1 file changed

+37
-0
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/render

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.lambda.module.modules.render
2+
3+
import com.lambda.module.Module
4+
import com.lambda.module.tag.ModuleTag
5+
import com.mojang.authlib.GameProfile
6+
import net.minecraft.client.network.OtherClientPlayerEntity
7+
import net.minecraft.entity.Entity
8+
import java.util.*
9+
10+
object FakePlayer : Module(
11+
name = "FakePlayer",
12+
description = "Spawns a fake player",
13+
defaultTags = setOf(ModuleTag.MISC, ModuleTag.RENDER)
14+
) {
15+
private val playerName by setting("Name", "Steve")
16+
17+
private val uuid = UUID.fromString("41C82C87-7AfB-4024-BA57-13D2C99CAE77")
18+
19+
private var fakePlayer: OtherClientPlayerEntity? = null
20+
21+
init {
22+
onEnable {
23+
OtherClientPlayerEntity(world, GameProfile(uuid, playerName)).apply {
24+
copyFrom(player)
25+
id = -2024-4-20
26+
27+
fakePlayer = this
28+
}
29+
30+
world.addEntity(fakePlayer)
31+
}
32+
33+
onDisable {
34+
fakePlayer?.setRemoved(Entity.RemovalReason.DISCARDED)
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)