#help-development

1 messages · Page 105 of 1

tardy delta
#

fucked up a lil as im trying to implement multiple operators

icy beacon
#

nevermind i don't understand shit lol good luck

#

😄

tardy delta
#

ah fun -Double.NaN is still the same

kindred valley
#

can someone help

gray merlin
#

Is there a common way to get coloured wool/dyes across all versions? In legacy we used to get an Ink Sack, and set the data to the colour we want, but in recent versions we just get the material for the dye.

kind hatch
#

XMaterial

gray merlin
#

Thank you.

kind hatch
tender shard
#

well "inventory" is null

kindred valley
tender shard
#

"inventory" in line 26 is null

#

what are you setting it to?

#

or just ?paste the whole class

kindred valley
#

well

#

never mind about those big sentences

#

trying to do something

tardy delta
#

tf

kindred valley
#

?paste

undone axleBOT
kindred valley
torpid sapphire
#

why does ItemMeta.getLocalizedName always return an empty string? do i need to specify a lang file somewhere?

kindred valley
#

ah sorry

#

yes

river oracle
#

Yes

kindred valley
#

and taking it

#

but returns null

sacred mountain
#

also to whoever said i shouldn't round the percentages on the quest progress

#

i think these rewards are pretty good ngl

sacred mountain
#

server properties or something

torpid sapphire
#

ive been through every config file i can find and theres nothing like that

sacred mountain
#

idk because people can make their own languages in a texturepack

torpid sapphire
#

from what i can tell thats the item name in the language the server is in

young knoll
#

It’ll only return something if you’ve done setLocalizedName iirc

sacred mountain
#

well if there isnt a language specified it may default to english

#

or nothing

young knoll
#

The server only has the English Lang

sacred mountain
#

because to get seomthing u need to set something

#

also why dont you just get the item name? if you're only using the server localized name

torpid sapphire
#

cause thatll be something like DIAMOND_SWORD

sacred mountain
#

i see

#

is there a parameter to specify the local lang

#

something like setLocalizedName(LanguageOrSomething.YOUR_LANGUAGE)

#

ive got no clue about what that method actual does so theres my shitty suggestion

fluid orbit
#

using .setPassenger(entity), but which one?

young knoll
#

Try a marker armorstand

#

Or maybe AreaEffectCloud

reef lagoon
#

What does marker mean on an armor stand

young knoll
#

Means it basically has no hitbox

reef lagoon
#

ah I see ty

fluid orbit
young knoll
#

The cloud spawned by lingering potions

fluid orbit
#

ok, i ll see

sacred mountain
#

to communicate to other plugins as an API plugin should i make my own events like QuestCompleteEvent

#

or should i just let them hook on directly

#

to the plugin instance

#

and get the data direct from the hashmaps/where the data is stored

young knoll
#

It would be very nice for them to have an event to listen for even if they can directly access your plugin

sacred mountain
#

mkay

#

gonna go look to see how to make my own events then

hazy parrot
#

google about observer pattern

icy beacon
#

i have a yaml file with multiple entries (closed reports), where each report has a resolve timestamp (system.currenttimemillis). i want to check how many reports have been closed today - so, 86400000 or less milliseconds from now. what's a good approach to take here?

vivid skiff
#

i added more commands in my plugin.yml and now it gives me this error

java.lang.NullPointerException: null
        at me.gurwi.ChatManager.onEnable(ChatManager.java:30) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.frankheijden.serverutils.bukkit.managers.BukkitPluginManager.enableOrderedPlugins(BukkitPluginManager.java:192) ~[?:?]
        at net.frankheijden.serverutils.common.managers.AbstractPluginManager.enablePlugins(AbstractPluginManager.java:105) ~[?:?]
        at net.frankheijden.serverutils.common.managers.AbstractPluginManager.reloadPlugins(AbstractPluginManager.java:219) ~[?:?]
        at net.frankheijden.serverutils.common.commands.CommandServerUtils.handleReloadPlugin(CommandServerUtils.java:243) ~[?:?]
        at net.frankheijden.serverutils.dependencies.cloud.execution.CommandExecutionHandler.executeFuture(CommandExecutionHandler.java:95) ~[?:?]
        at net.frankheijden.serverutils.dependencies.cloud.execution.CommandExecutionCoordinator$SimpleCoordinator.coordinateExecution(CommandExecutionCoordinator.java:123) ~[?:?]
        at net.frankheijden.serverutils.dependencies.cloud.CommandManager.executeCommand(CommandManager.java:188) ~[?:?]
        at net.frankheijden.serverutils.dependencies.cloud.bukkit.BukkitCommand.execute(BukkitCommand.java:116) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]```
#
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
        at java.lang.Thread.run(Thread.java:829) [?:?]```
fluid orbit
sacred mountain
#

?paste

undone axleBOT
vivid skiff
icy beacon
#

we can't exactly see your code ._. and learn how to read stacktraces me.gurwi.ChatManager.onEnable(ChatManager.java:30)

sacred mountain
#

@vivid skiff

fluid orbit
vivid skiff
#

k

icy beacon
#

preferably

vivid skiff
#

The commands or the main?

#

ok

#

import me.gurwi.commands.Action;
import me.gurwi.commands.Scream;
import me.gurwi.commands.Whisper;
import org.bukkit.plugin.java.JavaPlugin;

public final class ChatManager extends JavaPlugin {

    private static ChatManager instance;

    public ChatManager() {

        instance = this;

    }

    public static ChatManager getInstance() {
        return instance;
    }

    @Override
    public void onEnable() {
        long start = System.currentTimeMillis();

        // COMMANDS

        this.getCommand("scream").setExecutor(new Scream());
        this.getCommand("whisper").setExecutor(new Whisper());
        this.getCommand("action ").setExecutor(new Action());

        // LISTENERS



        // CONSOLE MESSAGE

        System.out.println("");
        System.out.println("§8§l» §3§lCHAT§b§lMANAGER §7v1.0");
        System.out.println("");
        System.out.println("&7Plugin enabled successfully. §9(" + (System.currentTimeMillis() - start) + "ms)");
        System.out.println("§f§oBy @Gurwi30");
        System.out.println("");

    }

    @Override
    public void onDisable() {
        long start = System.currentTimeMillis();

        // CONSOLE MESSAGE

        System.out.println("");
        System.out.println("§8§l» §3§lCHAT§b§lMANAGER §7v1.0");
        System.out.println("");
        System.out.println("&7Plugin disable successfully. §9(" + (System.currentTimeMillis() - start) + "ms)");
        System.out.println("§f§oBy @Gurwi30");
        System.out.println("");

    }
}```
icy beacon
#

"action "

fluid orbit
#

i guess one of them is 30 lol

#

this.getCommand("scream").setExecutor(new Scream());
this.getCommand("whisper").setExecutor(new Whisper());
this.getCommand("action ").setExecutor(new Action());

icy beacon
#

probably the space

fluid orbit
#

yes

icy beacon
#

and i asked for the context not the entire goddamn file

vivid skiff
#

lol, i didn' t see it

#

Thx

icy beacon
fluid orbit
quiet ice
tardy delta
#

someone did not read that currently only one operator works

#

:)

hasty prawn
#

Isn’t there an algorithm for parsing expressions? I thought someone sent it earlier.

#

Reverse Polish or something

tardy delta
#

redempt has his library

quiet ice
icy beacon
tardy delta
#

this already works lol

hasty prawn
quiet ice
#

probably

hasty prawn
#

Idk I remember doing this as an assignment maybe last year I just don’t remember the terminology

timid jetty
#

Is there a way to reduce the armor/bypass the armor of a player during an EntityDamageEvent?

vocal cloud
#

Set damage to 0 and subtract the amount from their health

tardy delta
#

if you have a division x / y, hows y called?

zealous osprey
#

do you mean the dividend?

#

or was it called divisor, can't recall

#

wait, no,
x would be the dividend and
y would be the divisor

hazy parrot
prime flint
#

is there an easy way to prevent item to be rename in anvil ?

#

there isn't item flag for example

gray merlin
#

I'm trying to package a plugin that I've made, inside a maven multi module project. However, it doesn't seem to be able to find two really important modules of mine (i'm running package on a module)

#

Any clue why that is?

#
[INFO] --------------------< com.mrkelpy:Crucible_1_7_10 >---------
[INFO] Building Crucible_1_7_10 1.0
[INFO] --------------------------------[ jar ]---------------------
[WARNING] The POM for com.mrkelpy:Commons:jar:1.0 is missing, no dependency information available
[WARNING] The POM for com.mrkelpy:CNMS:jar:1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------```
#

It just says it's missing

quiet ice
#

As long as just the pom is missing its okay

gray merlin
#

yeah but the build fails

#

Oh wait, there's more

#
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException```
quiet ice
#

Did you do mvn install or compararable?

charred blaze
#

how can i check if player got - health after damage event? i wanted to do it like if oldhealth > newhealth but i cant figure out how can i get player's old health?

gray merlin
quiet ice
#

For your com.mrkelpy:Commons and com.mrklepy:CNMS artifacts you need to do mvn install (or mvn deploy if applicable) to push them to a repository

#

Otherwise dependencies will not be able to resolve them

onyx fjord
#

if i make an api i should use interfaces right?

gray merlin
tardy flame
gray merlin
#

and rerun

charred blaze
quiet ice
agile anvil
quiet ice
#

APIs are usually interfaces, but they mustn't be

onyx fjord
#

im basically making a simple chat color api

charred blaze
quiet ice
tardy flame
#

I don't think you would need interfaces in chat lib

onyx fjord
#

just plain classes?

tardy flame
#

:∆

gray merlin
tardy flame
#

You can do records if you are so greedy 😦

#

Also based ^

#

Of course as everything

agile anvil
onyx fjord
charred blaze
onyx fjord
#

i do use records already lol

#

W ig

tardy flame
#

Records are cool

#

But kinda limited to it's own structure

charred blaze
tardy flame
#

You won't find a lot of use for it

tardy flame
#

setHealth()

charred blaze
#

why

tardy flame
#

Why would you need it then

#

I thought you want to change it

#

If not, my bad

charred blaze
#

to check if player got damaged or it was empty click

tardy flame
#

Alright

charred blaze
#

i need to not do anything with cancelled events

tardy flame
#

I have no idea what empty click is but alrighty

charred blaze
#

yes i did this @EventHandler(ignoreCancelled = true)

#

but it wasnt enough

#

it does not filter empty clicks on worldguard regions

eternal oxide
#

empty hand clicking what?

agile anvil
eternal oxide
#

getFinalDamage()

agile anvil
#

^

eternal oxide
#

thats after modification for armour etc

grim ice
#

awesome pfp

granite burrow
#

Why does Player#setAllowFlight(true) reset on death or on join?

eternal oxide
#

server settings

mighty pier
#

what that mean

eternal oxide
#

java 8 doesn;t support newer types of switch

mighty pier
#

use different java version?

agile anvil
#

Yes definitely

mighty pier
#

what can i use

#

1.8.8

agile anvil
#

Java 11

eternal oxide
#

you should be supporting java 11+ now

#

Spigot 1.8.8 will still run on java 11

mighty pier
#

like that?

eternal oxide
#

yes

mighty pier
grim ice
#

sigh

eternal oxide
#

and yoru compile target/source needs to also be 11

mighty pier
#

hgis

grim ice
#

thats not why btw

#

go to ur intellij settings

#

and change it there too

#

ur langauge lvl is set on 8 and prob ur jdk too

eternal oxide
#

good old Ij having its own settings 😦

vocal cloud
#

Ctrl+shift+alt+s

mighty pier
#

changed that

grim ice
#

faster

#

than that "shortcut"

#

i dont think a shortcut is supposed to be 4 buttons 💀

grim ice
grim ice
eternal oxide
#

depends on the plugin

#

GM still supports java 8

#

all newer are 16/17+

sacred mountain
#

didnt really think that one through 💀

grim ice
#

lmao

#

you can die from poison btw

#

just not in java edition

sacred mountain
#

ohhh

#

thats why its on the list

#

ok

grim ice
#

in bedrock edition and education edition there is something called fatal posion

#

though its display name is the same, the id of the potion differs

#

it happens when u give a cookie to a parrot

#

thats probably the only reason they added, because of the lawsuit mojang got, when kids started giving their parrots cookies

#

and thats prob why they didnt do it in java edition

#

since most java edition users are older than bedrock edition users

agile anvil
#

😂😂😂

grim ice
#

though the death reason and message

#

are just

#

"Entity was killed by magic"

young knoll
#

I mean they still die in java

grim ice
#

yeah but not get fatal posion

#

in BE and EE u can see the green particles covering the poor parrot

young knoll
#

You still see the particles in java

grim ice
#

o

gray merlin
#

I'm trying to use XMaterial, and for some reason there's always this error happening.: Could not initialize class com.cryptomorin.xseries.XMaterial. I have no clue why. I have shaded my jar and the library is scoped on compile.

quiet ice
#

What is the full stacktrace?

#
  • any caused by: things
gray merlin
#

one sec

#

?paste

undone axleBOT
gray merlin
#

Unfortunately that's really all I got

quiet ice
#

Did you relocate it?

#

And are there any previous stacktraces?

gray merlin
#

That's really all, since it's printed to the server's console, and i'm doing remote debugging on it

#

I could do JAR debugging, but that'd have to be on another version

eternal oxide
#

not shaded

#

open your jar with any compression tool

gray merlin
#

it's shaded

eternal oxide
#

see if it exists

quiet ice
#

Could you send us the compiled jar?

gray merlin
#

yep it does

#

for sure

#

1s

#

Actually the error is that it can't be initialised, and I just noticed they say that some modules depend on others...

#

and for some reason there are only two there, even though I'm not doing exclusion

#

might be that?

eternal oxide
#

No

#

the XMaterial class is simply an enum

#

Your server says its not in teh jar you uploaded

gray merlin
#

but it is there though, which is weird

#

and when I debug it, I can use the eval feature with it normally

eternal oxide
#

its in the jar you sent us. I'm guessing you failed to update your server

#

or you uploaded the unshaded jar

gray merlin
#

the one I sent was inside the server

#

and still is cause it's a copy xD

eternal oxide
#

?paste your pom

undone axleBOT
gray merlin
#

I'll be pasting three POMS, since this is a multimodule project, then.

eternal oxide
#

it looks fine from what I see

quiet ice
#

The only thing that coudl cuase an issue might be

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: com/cryptomorin/xseries/XMaterial$Data */
    public static final class Data { /* <snip> */
        static {
            String version = Bukkit.getVersion();
            Matcher matcher = Pattern.compile("MC: \\d\\.(\\d+)").matcher(version);
            if (matcher.find()) {
                VERSION = Integer.parseInt(matcher.group(1));
                ISFLAT = XMaterial.supports(13);
                return;
            }
            throw new IllegalArgumentException("Failed to parse server version from: " + version);
        }
    }

Chances are your server is not compliant to that regex and thus throws an exception

eternal oxide
#

could be

quiet ice
#

And since you are using a nonstandard server jar it is possible that this exception is supressed/discarded

#

Chances of that actually happening are rather minimal, but that is the only explaination I could scramble

gray merlin
#

Let me check

shut field
#

is there a way to get the Plugin from a NamespacedKey ?

eternal night
#

not really

#

you can look up a plugin by its name

#

but no guarantee that plugin is loaded

shut field
gray merlin
#

Oh my

#

@quiet ice That is actually what's happening here.

#

Jesus christ, good job lol, thank you!

quiet ice
#

Beware that plugins can actually create arbitrary namespaced keys

river oracle
#

Is there a way to remove the text under a potion that says its potion effect?

vagrant stratus
#

nearbyChunks.toArray(new ChunkContainer[nearbyChunks.size()]);
Doesn't this just replace whatever's in "nearbyChunks" with new ChunkContainer[nearbyChunks.size()] or am I mis-understanding what toArray does 🤔

agile anvil
#

No, it input all the nearbyChunks in the new ChunkContainer I guess

vagrant stratus
#

🤷‍♂️

opal juniper
#

it copies it to the chunkcontainer

#

which is the same size as nearbychunks

vagrant stratus
#

Ah, because NetBeans gives the New array created just to be passed to Collection.toArray
code

#
        ArrayList<ChunkContainer> nearbyChunks = new ArrayList<>();
        int cX = chunk.getX();
        int cZ = chunk.getZ();

        for (int x = cX - radius; x <= cX + radius; x++) {
            for (int z = cZ - radius; z <= cZ + radius; z++) {
                nearbyChunks.add(new ChunkContainer(chunk.getWorld(), x, z));
            }
        }
        return nearbyChunks.toArray(new ChunkContainer[nearbyChunks.size()]);
opal juniper
#

thats cause netbeans is a shit ide

vagrant stratus
#

Meh

#

IntellIJ nor Eclipse are any better

grim ice
#

why

vagrant stratus
#

Eclipse fails to handle certain large projects, and IntelliJ doesn't have workspaces which requires you to open up the entire directory instead of per-project

#

I can do this w/ NetBeans for example, but not IntelliJ

grim ice
#

but dude

vagrant stratus
#

I can code Paper on IntelliJ but not Eclipse or NetBeans since they break

grim ice
#

ur really using that god awful ui

river oracle
#

the ui isn't bad lol

grim ice
#

i use netbeans

#

its god awful

vagrant stratus
#

I have no issues w/ the UI, in fact I heavily dislike IntelliJ's UI and UX

grim ice
#

i somewhat prefer eclipse ui too

#

but

river oracle
vagrant stratus
#

Meh, I can just disable NetBeans's hint for that specific thing

grim ice
#

netbeans is just aa

#

show me netbeans ui

#

for you

vagrant stratus
#

I don't really like anything about Eclipse & IntelliJ is only useful to me for Paper coding so meh

#

Hell, iirc the way IntelliJ handles git is more annoying too

grim ice
#

well

#

eclipse is lightweight, but has issues with hints and correction, as well as the way its organized
intellij has issues with git, but is laggy as fuck nowadays, and lacks some features from eclipse and has absolute shit of a swing designer

river oracle
#

lol

vagrant stratus
#

I quite dislike IntelliJ's .idea folder bullshit as well, annoying to deal w/

river oracle
#

whats in its .idea folder lol

grim ice
#

netbeans has the worst ui

#

a somewhat decent gui designer

vagrant stratus
grim ice
#

awful hints and corrections

#

bad limitations

#

breaks constantly

vagrant stratus
#

All this stuff

grim ice
#

i just code in notepad++

#

ez

#

no joke i actually made a forge mod in notepad

#

and built it and shit

river oracle
#

lol My favorite thing about is intellij is seeing invalidate caches all the time

#

why does it break so much that you need to do that

vagrant stratus
#

Anyways back to cleaning up Aurora so I can get that v5 out lmao

grim ice
#

and intellij is mad slow with indexing large gradle projects btw

#

it took 1 hour once

rough drift
#

Real men use punch cards to make the bytecode

gray merlin
#

Is there any other way to get a Material with non version dependent code, without using XMaterial?

upper vale
#

Why no xmaterial?

gray merlin
#

Doesn't seem to work for lower versions

#

like 1.7.10

#

For anyone that runs into my issue: We can just use Material#getMaterial(String); and use a ternary operator to give it an alternative.

mellow pebble
#

Hi guys i really dont have that much ram to run intellij, 3 minecraft servers and minecraft at the same time so i just want to ask would this code be fine and would it work correctly basically what i think it should do is just connect player to another server on invernotry click event

So this is in onEnabled

Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");

This is in onInventoryClick event

ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF(serverName);
player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
#

i think that it should work properly but i would like to hear other thoughts on this

undone axleBOT
mellow pebble
#

cant run 3 servers on local host

#

intellij and minecraft

#

at the same time

#

that is shit ton of RAM

river oracle
#

run the servers with 2gigs of ram each maybe 1

#

close intellij

#

a proxy you can allocate 512mb of ram

#

for your client you really only need 2 gigs

#

at bear minimum you need 4.5 gigs plus whatever intellij has

vague oracle
#

My intellij uses 4GB 😦

river oracle
#

given if you only have 8 gigs of ram which is unlikely very runnable still

#

I don't use intellij lmao I hate that ide I'm using vscode

real spear
#

Is there some way I can slow natural regeneration for players?

river oracle
real spear
river oracle
vague oracle
#

It only used to use 1 but then an update to either windows or IntelliJ fucked it

#

Windows 11

#

Didn’t meant to upgrade

#

Mean

grim ice
#

might as well use notepad

#

u only gain shame with using vscode

river oracle
real spear
grim ice
#

no

#

vscode is a text editor

#

and should be treated as such

dusk flicker
#

imagine using vscode/any ide

#

be a real dev

#

use Notepad

real spear
#

notepad++ = cracked

dusk flicker
#

not ++; just notepad

#

only real experience

real spear
#

lame

dusk flicker
#

its how true devs work

real spear
#

lemme guess you code in C?

dusk flicker
#

no lol

#

programmin in notepad is a very common joke in these chats and online with programms

grim ice
vocal cloud
#

Gotta use VIM

grim ice
#

with notepad++

#

thats one of my coolest achievements

#

my other achievement is spelling achievement right

dusk flicker
#

no i'm a java dev

grim ice
#

u know a c dev from a first glance

dusk flicker
#

^ exactly

real spear
#

ah. fair

grim ice
#

they give a hardcore nerd aura

real spear
grim ice
#

one symptom is that u get the unstoppable urge to call them a nerd

grim ice
#

tbf

#

ive never seen a good use case

#

for c yet

real spear
#

yea.. im stumped

vocal cloud
#

Do you use linux?

real spear
#

not too often. not sure who u were asking

vocal cloud
#

2Hex saying no good use case for c

eternal night
#

someone has to maintain legacy c code bases 🤔

real spear
vocal cloud
#

Windows, Linux, etc all written in c

grim ice
vocal cloud
#

Pretty much all modern OS's are written in C.

grim ice
#

Are you telling me the usual developer

#

contributes to major operating systems

real spear
#

yes 🤓

vocal cloud
#

No but what I am telling you is that there are plenty of C use cases

grim ice
#

pretty sure you can make an operating system with other languages tbf

#

it just wont be as fast

real spear
grim ice
#

one bad thing though

#

it doesnt get updated much

real spear
grim ice
#

since if it did any major updates some code bases would break

#

thats what i heard at least

wet breach
real spear
grim ice
#

imagine writing an os with csharp

#

reminds me of microsoft miserable attempt

real spear
#

linux blows windows out of the water. I wish linux was supported by more games tho

grim ice
#

ths guy on quora

#

"They are usually made with the C#, C, C++, and assembly programming languages. Operating systems allow you to navigate through a computer while creating storage and executing commands. Don't think it is easy to make one."

#

csharp

#

bro 💀

vocal cloud
#

Yeah, on a higher level

#

Windows is loaded with C# code for things like the app store

real spear
#

i like how this went from 2Hex roasting vscode to us talking about OSs

grim ice
vocal cloud
#

Just buy an Jetbrains all products pack

grim ice
#

i guess they only use it for small stuff now

real spear
#

wdym by the change simultaneously? do you mean like a synchronized between players bossbar?

lost matrix
#

For timers always use the observer pattern. Have a fixed timestamp stored and use tasks to view at the timestamp.
You would have a runnable which looks at the timestamp and updates the bossbar accordingly.

#

The timestamp can be lowered or risen resulting in every observer to have an updated value on the next poll.

#

Its not a "true" observer pattern but still the right approach for timers

young knoll
#

If you want the boss bar to show progress too you’ll also need the start timestamp

humble tulip
#

Anyone has code to stop an item from being moved into the top inventory?

#

It can be rearranged on the bottom inv but nit moved to the top

lost matrix
humble tulip
#

What abt clicking the item and then dragging it to the top inv

#

I want the top inv to be usable like storage

#

Just wanna blacklist items

lost matrix
#

This is automatically cancelled by not allowing top inv interactions

lost matrix
humble tulip
#

Yep

#

I'm sure it's been done before and i just wanna copy some code

lost matrix
#

I mean Triumph has storege guis. Not sure if they support blackslist

obtuse meadow
#

Hi, people. Does any one knows how to get the ItemMeta from the ItemFrame ItemStack? I need to get the invisible item frame but they have a custom EntityTag to make it invisble... I was searching from something like the SpawnEggMeta meta... Thanks 😄

lost matrix
shadow zinc
obtuse meadow
desert frigate
#

whats the best way to disable movement on a entity/player ? PlayerMoveEvent is glitchy, slowness doesnt work great either cause they can jump, and disabling AI wont work cause it must work for players too

lost matrix
#
    ItemFrame frame = ...;
    ItemMeta meta = frame.getItem().getItemMeta();
obtuse meadow
#

like the command 'give @p item_frame{EntityTag:{Invisible:1}}'

tall dragon
lost matrix
#

Ok so you want the ItemStack which places an invisible ItemFrame when placed.

shadow zinc
#

And for all my classes in my api, do I need to define their methods in an inteface and implement it for my class.

lost matrix
#

Let me think if there is a way without using spigot unsafe methods

obtuse meadow
lost matrix
#

It would have to be something like an EntityItemMeta. It would also apply to ArmorStands

obtuse meadow
#

maybe with PersistentDataHolder?

lost matrix
# obtuse meadow maybe with PersistentDataHolder?

I mean you can do it via the PersistentDataHolder but then you would have to implement additional logic.
If you want vanilla behaveior then something like this is needed

    ItemStack itemStack = new ItemStack(Material.ITEM_FRAME);
    Bukkit.getUnsafe().modifyItemStack(itemStack, "{EntityTag:{Invisible:1}}");
young knoll
#

Is there not a meta type for that

#

Similar to BlockStateMeta?

lost matrix
#

I didnt find any that would fit. It would have to be something like EntityItemMeta

#

Same for ArmorStands

vague oracle
lost matrix
#

Yeah just set the movement speed to 0 and give them jump 250

obtuse meadow
young knoll
#

Interesting

#

Didn’t know you could turn command language into an ItemStack that easily

obtuse meadow
quaint mantle
#

wtf

#

why is there an nbt api

#

oh they're all deprecated

eternal night
#

mostly so you can serialise

#

it isn't as much nbt API more snbt from and to

lost matrix
#

But i wonder why there is no ItemMeta regarding the spawning of Entities by now. There are a few types like ItemFrames, ArmorStands and EndCrystals who would benefit from that.

eternal night
#

because spigot does not know a difference between an alive and ticking entity and purely its data

lost matrix
#

Well CraftBukkit just wraps the NMS Entity which can as well not be spawned

eternal night
#

Well, still a "bad" representation of an entities data

#

preferably all the persistent changes to an entity would be in some form of data attachment

#

interface wise

lost matrix
#

Yeah the only way im currently seeing is deserializing the entity, changing it and serializing it again...

#

So we would have something like EntitiyData > ArmorStandData. Eh...

eternal night
#

idk

#

all a pretty ugly system

#

tho well

#

if I can get a spawnEggMeta.setSpawnedMob(Zombie.class, z -> z.customName(Component.text("He"))

#

that would be kinda nice

modern fog
#

I'm Italian and I'm translating this message, I wanted to ask if you can refund a plugin purchased for a server but it doesn't work for 1.19, can you help me?

lost matrix
lost matrix
eternal night
#

the server would pass in a mocked/whatever ref from a zombie's data interface

#

which I can edit

lost matrix
#

Ah i see. Yes this could work then. But then there is not much of a reason to use Consumer. Could as well return the object for editing it.

eternal night
#

Hmm

lost matrix
#

Unless you want to encapsulate it

eternal night
#

I guess if its a builder

#

actually does not matter

lost matrix
eternal night
#

you are right, probs returning it might be nicer

#

or maybe just build the data attachment

#

so people don't think they can edit it later

lost matrix
#

For me the consumer implied that the method would be invoked when the mob is actually spawned instead of right now

eternal night
#

yea

#

I think returning is better

modern fog
eternal night
#

tho you'd have to also actively return it to the meta

desert frigate
#

if i gave over 100 then they jump to the moons

eternal night
#

else you'll get like

final ZombieData zombieData = meta.setSpawendMob(Zombie.class);
// 5 ticks later
// heh I am just gonna edit this real quick
zombieData.customName(Component.text("the future is now old man"));
lost matrix
#

Yeah this makes sense

eternal night
#

so would probably be best to instead like

final ZombieData data = Bukkit.createEntityData(ZombieData.class);
zombieData.customName(Component.text("the future is now old man"));

meta.setMobData(data);
#

or have some re-exposed ZombieData.plain()

#

I must say I have fallen a bit too much for the static constructor-likes

#

damn you adventure

lost matrix
waxen plinth
#

EntityData?

lost matrix
lost matrix
#

Especially because everything has a static constructor method for anything else it seems...

eternal night
#

I mean it works pretty well. I really have not ran into many issues when simply moving pure function logic into a static method

#

like OO wise

waxen plinth
#

Static constructors are different

quiet ice
#

Static constructors?

waxen plinth
#

Unless the type has no children it should generally be a regular constructor

waxen plinth
eternal night
#

I mean, the reason you have them as static is because the implementation is not public

eternal night
#

you keep it package private and completely abstract the entire implementation away

#

so with your static constructor in the interface you basically say "look here is my known implementations of this interface, but feel free to create your own implementations"

lost matrix
#

Something that would not work in kotlin because for some reason it doesnt have protected as an access modifier.
Just wanted to throw that in because it sparked a bit of rage in me recently.

eternal night
#

had to sorry

#

I think that is part of my paper triage requirements

lost matrix
#

lul

eternal night
#

but why protected ?

#

why would you need protected 🤔

#

or is the default kotlin modifier public

quiet ice
#

Why would you Not Not need protected?

lost matrix
#

default mod is public

eternal night
#

protected is pretty meh

#

well tbh inheritance is pretty meh

#

ah

#

so you don't get package private in kotlin ?

lost matrix
#

Nope

eternal night
#

like ```java
final class PackagePrivateImpl implements PackgePublicInterface {
}

#

rip

#

kotlin moment I guess

quiet ice
#

Package private on the other Hand makes Sense to Not exist

eternal night
#

I mean, use java 9 modules then

#

to actively prevent access to classes you don't want visible

tender shard
#

you defined "inv1" in this line

#

but obviously "inventory" != "inv1"

#

I asked you to send the full class

#

/shrug if you don't, only javac can tell

#

¯_(ツ)_/¯

gray merlin
#

I'D BEEN TRYING TO FIND THAT FOR SO LONG

torn shuttle
#

hey remind me, I can give a living entity a team to use a bar under their display name right?

#

or was that a fever dream

lost matrix
#

I believe that this is only possible for players, no?

torn shuttle
#

that's what I was trying to remember

#

I mean I can just cheat with armorstands, it's just a bit lame is all

torn shuttle
#

huh paper does it, interesting

#

well guess I'll do another feature split or smth

drowsy helm
#

They do?

#

Is it just armourstand spoofing

torn shuttle
#

I mean either they do or they have found a very creative way of pranking me

drowsy helm
#

Interesting might have to try that

young knoll
#

You should 100% be able to put them on a team, that’s how the glowing effect gets coloured

#

But I don’t think anything will display below their name

torn shuttle
#

about to find out actually

#

after i do 10 waves of my tower defense game lol

#

k yeah no

#

not displaying

#

or maybe I just did it wrong

humble tulip
#

map

lost matrix
#

map

humble tulip
#

Map<UUID,Integer>

lost matrix
#

Map<UUID, Integer>

#

eh

humble tulip
#

lmfao

lost matrix
#

Or Object2IntMap<UUID>

#

You can also store the number right in the PersistentDataContainer of a player. This way its persistent through restarts and relogs.

worldly ingot
#

FastUtil isn't exposed in Bukkit

lost matrix
#

Ah

drowsy helm
#

anyone know how i am able to fix this? I am compiling a plugin which depends on another api which uses a class which extends a moj map class. I am still remapping it in the pom but it doesn't want to compile

#

To make it more clear;
I'm using this class in my plugin

       addEntityType(ViciousWolfEntity.class);```
which is from an api which extends the moj map Wolf class
arctic moth
#

i did a thing

drowsy helm
#

looks like if i import non remapped spigot it works but it's not ideal

arctic moth
#

i think i just slightly broke the lighting engine

#

test server

young knoll
#

What on earth have you done

arctic moth
#

very top secret scientific procedures

#

(i just made it so every time an entity dies a tnt spawns but apparently tnt exploding is an entitydeathevent)

#

not sure what it has to do with the lighting engine though

#

tbh ive had worse happen

#

you dont want to know what happened with falling blocks

#

ill go find the video

young knoll
#

EntityDeathEvent only works for living entities

#

So that can’t be it

arctic moth
#

well its spawning tnt every time it explodes

#

why do i have 142 pages of messages containing "tps" in this channel

#

heres one thing that happened when i was doing something i dont remember what i did to make that happen

#

i think this was the video

#

and no i didnt apply any vectors

#

actually yes i did

#

they were normalized though

#

i actually dont think i fixed that bug

#

i basically just applied about 4 million vectors to a falling block per tick

#

it was supposed to be a custom kb thingy but i spammed tnt

tender shard
#

or did you already find any fix?

drowsy helm
#

i just used the non moj map import on the plugin and it works

#

but i dont really like doing that

tender shard
#

yeah no

#

that's not a proper fix

#

wait

#

lemme searxh my forums post about a similar thing

drowsy helm
#

sweet thankyou

tender shard
#

I had to switch to using the eclipse compiler in maven

#

I still have no clue why this happened

drowsy helm
#

oh so it's just a intellij thing then?

tender shard
#

no

#

it's a problem with the maven compiler

#

or with the compiler that mojang used to compile this class

drowsy helm
#

oh gotcha

#

tyvm

tender shard
#

just try it, no idea if it helps you too

arctic moth
#

Lol the bug I reported earlier today is out to get me

sharp gate
#

How do I set the CanPlaceOn and CanBreak tags within ItemMeta in 1.19?

#

Specifically, I'm having trouble making the NBTTagList

tender shard
#

so yeha, actually changing the NBT tags

#

what issues are you having with the NBTTagList?

#

paper has API for this

#

spigot doesn't seem to have one

torn shuttle
#

my life is a lie

tender shard
#

how so

torn shuttle
#

does inventoryopeneven not trigger when a player opens their own inventory

tender shard
#

nope

torn shuttle
#

lies and deceit

tender shard
#

it's been like this for at least 4 or 5 years

torn shuttle
#

is there a dedicated event ?

tender shard
#

it used to be possible to detect it with an advancement

#

in 1.13+, you simply CANNOT detect it AT ALL

#

there is NO WAY

#

sad but true

torn shuttle
#

that is the stupidest thing I have ever heard

atomic swift
#

how long are player uuids

torn shuttle
#

and I'm currently watching a video of a guy who built robot legs for his snake

sharp gate
tender shard
#

32 chars, or 36 if you take account eh dashes

atomic swift
#

ok thx

tender shard
#

then you can just do sth like new TagList();

#

ListTag() *

vital sandal
#

is it possible to rotate a particle ? for example sweep attack

sharp gate
#

It was my understanding that using the mojmaps would mean that I would have to disable them whenever I want to build the plugin. Is that thecase?

sharp gate
#

gradle

tender shard
#

oh yeah then you're a bit fucked

#

there is no proper remapping plugin for spigot + gradle

#

howeeeeeever

#

papermc uses gradle and you could use paperweight instead, which is basically paper's version of spigot's "remapping nms" thing

#

but I have no clue about it. all I can tell you is to either use maven, or take a look at paperweight

sharp gate
#

Yeah, this is the problem I ran into originally when I wanted to use mojmaps. Thanks for the paperweight tip, I'll take a look at that.

tender shard
#

np!

#

(there's a third solution)

#

which is to simply compile your stuff with gradle, and then add a task that runs spigot's "specialsource" .jar manually. It's probably just one line to add to your gradle file but it's a bit of a dirty hack

#

and I also have no idea how this would look in gradle syntax. so yeah, I guess "paperweight" is the solution to go. Might wanna ping LynxPlay when he's online, I'm sure he can explain it to you in like 2 sentences

drowsy helm
#

eclipse compiler worked, thanks alex

tender shard
#

I really havent understood what the issue is

#

but still, nice that my workaround worked lol

drowsy helm
#

in your usecase were you using another api which used moj mappings?

tender shard
#

no, it was back in 1.16

drowsy helm
#

ah

tender shard
#

mojang mappings didnt exist back then

#

and I only had this problem in one tiny inner class

#

PacketPlayerInfo...SomeInnerClass

drowsy helm
#

gotcha

#

i think my compiler was trying to get the class after it was remapped

tender shard
#

still a mistery to me

worldly ingot
worldly ingot
#

Though I'm kind of glad it didn't because if we introduce ItemType and BlockType in the future, I'd rather have used those types instead of Keyed

drowsy helm
#

wait you still have to pr stuff choco?

#

i thought you could just add it

worldly ingot
#

What? Yeah. I don't have push access lol

tender shard
#

I am 100% for another breaking change

#

replace Material with Block and Item

#

well, not BLock, but BLockType, like you mentioned

worldly ingot
#

#660 has it. Just waiting on md's word for it to get merged lol

#

Will open up a lot of avenues for PRs

tender shard
#

I'm still waiting for a reply from md_5 on tinder

drowsy helm
#

pretty weird that we dont have it already

worldly ingot
#

I can only imagine at this point he's waiting until 1.20

vital sandal
#

how can pp create new particle like this ? https://www.youtube.com/watch?v=B3RhIKwv2fk&t=69s

The Abyssion Pack is on sale only on mcmodels:
https://mcmodels.net/model/abyssion-skills-equipment/
Requires MythicMobs, ModelEngine, MythicLib, MMOcore, and MMOitems

Check out my other products: https://mcmodels.net/vendors/samus2002s-store/
Join our discord community: https://discord.gg/ggvbhjFZC3

===========================================...

▶ Play video
drowsy helm
#

the one on the ground or the slash effect?

tender shard
drowsy helm
#

fine

young knoll
#

You can make custom effects with fonts and item models

#

And armor stands

vital sandal
#

splash one

tender shard
drowsy helm
vital sandal
#

i used to think about that but item animation is random

drowsy helm
#

ah yeah its delayed isnt it

#

pretty sure itemstacks are your only option tho

#

unicode characters wouldnt be able to do that

#

and i dont think particle effects can either

vital sandal
#

particle effect can but u cant rotate the effect

young knoll
#

Then probably just start with a static item

#

Then switch to the animated one after a delay

drowsy helm
#

you can try manually animate the item

#

have a diff texture each tick

tender shard
#

choco are you still here?

vital sandal
#

i got it now

#

create multiple texture for each frames and play it :>

#

painful :d

tender shard
#

particles are sprites

#

they don't have any orientation

#

just wanted to mention this again 😛

vital sandal
#

i mean the item^

tender shard
#

oh ok I thought you were talking about particles

drowsy helm
#

the maven compiler doesnt work with lombok 😵

torn shuttle
#

is there a way to get what item slot a player is currently on?

drowsy helm
#

player.getInventory().getHeldItemSlot()

#

as in the hotbar?

torn shuttle
#

yeah

#

that doesn't seem to be a method?

drowsy helm
#

yeah getHeldItemSlot

#

wait maybe its just a paper thing

torn shuttle
#

oh wait

tender shard
torn shuttle
#

nvm got it, I was getting it from an inventory in an event needed to get it from the player

tender shard
#

there's also InventoryClickEvent#getHotbarSlot() or similar

#

but that one is what they "swapped" or "shift-clicked" or whatever, and might be -1 if they didnt use the hotbar in the click event

drowsy helm
#

so many fucking modules

tender shard
#

damn whats that

worldly ingot
#

ME

#

Obviously

drowsy helm
#

yeah. ME

tender shard
drowsy helm
#

lol it's for a rpg server

worldly ingot
#

How could you not see that silly

tender shard
#

the post is for 1.16 but it's still valid for some classes even in 1.19 remapped

#

some classes are just "broken" using the normal compiler in maven

#

and since you always know everything, I thought maybe you know about this too

tender shard
# drowsy helm yeah. ME

I just do a huge "core" library and let maven's "minimizeJar" thing handle about reducing unused stuff

worldly ingot
#

First time I've seen that. Though if it's any consolation, we use the Eclipse compiler for Bukkit too

drowsy helm
#

yeah thats what i first did but i'm trying to make it modular

tender shard
worldly ingot
#

Something about not actually requiring a JDK to be installed I think

tender shard
#

hmmm

worldly ingot
#

Yeah, doesn't need a JDK

tender shard
#

well I had this problem with this class mentioned in the post, and I didnt find a solution for AGES

drowsy helm
#

why would they need that though

tender shard
#

with AGES, I mean like 3 or 4 weeks

#

then I found some random SO post

#

and it worked

#

very weird, specific problem

worldly ingot
#

Might have something to do with nullability annotations on that internal class and an instrumenter they compiled with

#

I'd try rebuilding in a fresh BuildTools directory or something and try again

torn shuttle
#

you can track interactions in a player's own inventory right?

#

or is that also not possible?

drowsy helm
#

yeah you can

#

just not InventoryOpen

worldly ingot
#

Ah, tell you what Alex. I found a ForgeGradle bug from 2018 detailing this exact issue

#

It's a bug with the obfuscator Mojang is using, ProGuard, and Fernflower's decompiling of it

#

The Eclipse compiler may be a little more lenient on those annotation errors

tender shard
#

wow that's so weird

#

how did you find this?

worldly ingot
#

Google-fu

tender shard
#

weird, maybe my googling skills were too bad back in the days

#

"cannot access ..." however is also a very shitty error message lol

#

anyway, it'S 6.30am. good night everyone :3

drowsy helm
#

gn

granite burrow
#

Is there anyway for a plugin to change the message sent to console when the player is kicked via Player#kickPlayer(reason)

mighty pier
#

#setkickreason

#

or smt

winged spindle
#

Hey,
I want to spawn a particle at a block location.
How do I do that?

winged spindle
#

thx

granite burrow
quaint mantle
#

how would i make time remaining on a int or whatever

#

idc

#

formatted as 2m 1s

dim palm
quaint mantle
#

well how would i do it

#

idc how

#

i just need it to show time remaining

dim palm
#

you should use long

#

theres a class to format that

quaint mantle
#

oh?

dim palm
#

let me see if u found it

#

i *

quaint mantle
dim palm
#

np

granite burrow
#

That works, however, it also changes the player's message. I want to just change what console is sent :/

opal juniper
#

then you will have to dig into the packets

amber bronze
drowsy helm
#

I wonder how wynn does playerghosts so efficiently

#

cant imagine sending player data for 1k players each tick being super efficient

quaint mantle
#

im guessing this is a bad idea

#

but

#

im using runnables for a timer

#

should i use while loop instead?

drowsy helm
#

no runnables are the better option

#

depends on your context though

quaint mantle
#

its just every 1 second runnable

#

i dont think it would be that bad

drowsy helm
#

how would you do that with a while loop though

#

without pausing the main thread

quaint mantle
#
            synchronized (imagine) {
                while (imagine.get(plr.getUniqueId()) < 0) {
                    try {
                        imagine.wait(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
            }```
#

that how

drowsy helm
#

that pauses the main thread

quaint mantle
#

dat dumb

#

then runnable it is

#

lmao

drowsy helm
#

exactly what the runTaskTimer is made for

quaint mantle
#
           new BukkitRunnable() {
                @Override
                public void run() {
                    imagine.put(plr.getUniqueId(), imagine.get(plr.getUniqueId()) - 1000L);
                    Other.broadcastMiniMessaage(Other.makeMiniMessage(Other.formatTimeMillis(imagine.get(plr.getUniqueId()))));
                    if (imagine.get(plr.getUniqueId()) < 0) {
                        imagine.remove(plr.getUniqueId());
                        this.cancel();
                    }
                }
            }.runTaskTimerAsynchronously(TestingPaperNMS.plugin, 20, 20);``` ik isn't the best code, first time doing timer
#

mostly for testing

#

works fine tho

dim palm
#

i have a weird question: How does custom events works and how it gets called lol

drowsy helm
#

the same as regular events

quaint mantle
#

could do that

drowsy helm
#
public class MyEvent extends Event{

}```
 then call it
quaint mantle
#

^

rotund ravine
drowsy helm
#

yeah im just showing all you need to do is extend it

quaint mantle
#
public class ServerBrodcastEvent extends Event implements Cancellable {
    private String message;
    private static final HandlerList HANDLERS_LIST = new HandlerList();
    private boolean isCancelled;

    public ServerBrodcastEvent(String message){
        this.message = message;
        this.isCancelled = false;
    }

    @Override
    public boolean isCancelled() {
        return isCancelled;
    }

    @Override
    public void setCancelled(boolean cancelled) {
        this.isCancelled = cancelled;
    }

    @Override
    public HandlerList getHandlers() {
        return HANDLERS_LIST;
    }

    public static HandlerList getHandlerList() {
        return HANDLERS_LIST;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}```
ornate mantle
#

kinda vague question, but is there a way to make a sheep entity appear as a zombie using packets?

#

if yes, what packet is it?

drowsy helm
#

you can hide the sheep and spawn a zombie with packets

#

can't just change the entity though

ornate mantle
#

yeah but the player only sees a sheep because the server tells the player there's a sheep there

#

can i lie to the player's face by telling them there's a zombie there?

drowsy helm
ornate mantle
#

so i have to despawn the sheep with client side packets

#

and spawn a zombie using client side packets

drowsy helm
#

yep

ornate mantle
#

and send velocity packets for moving it?

drowsy helm
#

then just teleport it accordingly

#

nah teleport packet

ornate mantle
#

bruh

drowsy helm
#

not velocity

#

well ig you could use velocity

#

but teleport is easier

ornate mantle
#

if i do this for all sheep in the world

#

would this impact the server quality?

drowsy helm
#

not really

ornate mantle
#

oh damn

drowsy helm
#

if you do it efficiently

ornate mantle
#

yeah nvm

drowsy helm
#

may i ask what are you trying to do

ornate mantle
#

im a dumbass

#

instead of replacing sheep with zombie

#

im trying to replace hostile entities with players

#

when i tried this before

drowsy helm
#

same ai though?

ornate mantle
#

it lagged the server after i created 6 of these

#

yep

#

i dont wanna do pathfinders and shit like sentinels and terminatorplus did

#

i just want a simple player with the brain of a zombie

drowsy helm
#

for my npcs i spawn a human and use a hidden zo mbie for pathfinding

#

you could do something similar

ornate mantle
#

yeah thats what i did

#

teleport packets via a runnable

#

broke server after 6

drowsy helm
#

mustve been doing it weird

ornate mantle
#

can i see your thing

#

if u dont mind

drowsy helm
#

under NDA sorry

ornate mantle
#

ah

#

did you use a bukkitrunnable

#

or is that under the NDA aswell

#

idk how these legal docs work

drowsy helm
#

yeah every tick

#

i can tell you how it works

#

just cant show code

ornate mantle
#

alright

drowsy helm
#

basically i keep track of every entity, which has an onTick method

#

the npcs have a child called NpcGhost or some shit

#

forgot what i called it

#

and i just tp the npc each tick to the zombie

ornate mantle
#

ontick runnable starts on creaturspawnevent?

#

CreatureSpawnEvent

drowsy helm
#

in your case yeah, i have a custom entity manager so its a bit diff

ornate mantle
#

alr

drowsy helm
#

well actually no

#

its one runnable

ornate mantle
#

huh

drowsy helm
#

which iterates through a collection of entities

#

one runnable, multiple entities

#

rather than one runnable per entity

ornate mantle
#

so thats why your server didnt shit itself

drowsy helm
#

yeah probs lol

#

good idea to limit your runnables

#

so far i haven't run into any performance issues

#

did a profiler for 1 hour with 200+ npcs and stayed at 20tps

ornate mantle
#

so i create an ontick method

#

which does checks for movement

drowsy helm
#

dont need to check

#

just tp

ornate mantle
#

and create a central runnable

drowsy helm
#

yeah

ornate mantle
#

yeah

#

and every time an entity is spawned

#

wait no

#

i put the entity instances inside a collection

drowsy helm
#

yep exactly

ornate mantle
#

parse through collection every tick

#

and move?

drowsy helm
#

yep

ornate mantle
#

are you sure this wont shit a server

drowsy helm
#

yeah, it wont

ornate mantle
#

swear on mashed potatoes

drowsy helm
#

just keep track of which entities are unloaded

#

and remove them

#

then add back on chunk load

ornate mantle
#

alr

drowsy helm
#

I swear on mashed potatoes

#

lol

ornate mantle
#

wait

#

wont the packet entity load a chunk?

drowsy helm
#

no

ornate mantle
#

alr

drowsy helm
#

Just make sure:
-registering/unregistering entities on chunk load/unload
-rehide the entity on chunk load

#

few things to keep track of, but it's robust

ornate mantle
#

this is for a copy of hypixel dungeons

#

so i dont think i'll be unloading

#

if your enemies despawn then it kinda beats the purpose

drowsy helm
#

it's more if it does happen

#

which it will

#

just prevents errors

ornate mantle
#

whats more

valid sorrel
ornate mantle
#

how do i set an EntityZombie's equipment?

chrome beacon
#

nms?

#

If so what version

ornate mantle
#

1.8.8

#

:D

#

i love myself

#

i do not have suicidal tendencies

#

i tried using getbukkitentity

chrome beacon
#

Can't remember code from 7 years ago

ornate mantle
#

no one can

chrome beacon
#

You'll have to decompile and look yourself

ornate mantle
#

the intellij plugin development addon doesnt even support 1.8.8 💀

#

had to change it myself

reef lagoon
#

Is there a way I can use .addItem on player's open inventory

chrome beacon
#

player.getOpenInventory().addItem()

#

?

reef lagoon
#

there's only setItem