#help-development

1 messages · Page 1272 of 1

brazen badge
#

Hi, I can't understand why after a certain amount of time the craftings I created in my plugin no longer work and I have to do a restart. Can anyone explain me this?

sly topaz
#

because that would reset recipes

sly topaz
sly topaz
# brazen badge yeah

well, that's the only way recipes would stop working, unless something is cancelling the craft event for your recipes in your code or whatever

#

to begin with, are you registering recipes via the Bukkit Recipe API or are you using the PrepareItemCraftEvent to manually detect your recipes?

sly topaz
#

I'd start by creating a MRE to have a more clear idea of where the issue is

torn shuttle
#

don't know how to avoid it from hitting beyond tbh

#

hm

#

does arm swing happen before or after breaking a block

#

after, great

quaint mantle
#

Anyone familiar with a way of creating boss bar for 1.8?

#

I tried using packets but it's causing alot of fps drops

drowsy helm
#

how many times are you sending the packet

quaint mantle
#

Once

#

Oh nevermind, twice

echo basalt
#

pretty sure 1.8 doesn't have a bossbar packet

#

you gotta rely on upside down invisible withers or ender dragons

quaint mantle
#

Ender dragons, yes

echo basalt
#

ender dragons cause lag but are more accurate

quaint mantle
echo basalt
#

withers spawn particles which are often visible

quaint mantle
#

Withers dont work for some reason

echo basalt
#

mandatory

#

?1.8

undone axleBOT
quaint mantle
#

1.8 hater 😔

torn shuttle
#

twice as old as my nephews, whose classmates could be playing minecraft

quaint mantle
#

isn't there any way to tackle this?

torn shuttle
#

you mean aside from updating to 1.21.5?

quaint mantle
#

yes

torn shuttle
#

maybe, last time I worried about 1.8 code was about 10 years ago

quaint mantle
#

🤔

drowsy helm
#

Pretty sure theres a boss bar library with 1.8 support

#

why not use that

quaint mantle
#

api?

#

It doesn't seem to work

#

and it uses wither 😔

torn shuttle
#

hm

#

can armor stands have health

#

as in survive more than a tap

#

sounds like they should right

drowsy helm
#

I believe so

#

doesn't it take 3 hits to kill em?

torn shuttle
#

mh

#

do they just hp?

#

like a living entity?

quaint mantle
#

I'll give it a try with armor stands

#

Wait, how would I do it with armor stands?

#

cause no boss bar

drowsy helm
#

He's not talking about boss bars

quaint mantle
#

oh, mb

torn shuttle
#

hm it does not like doing this

#

guess I'll do it manually

rough ibex
#

Do you genuinely need 1.8

quaint mantle
rough ibex
#

Why do you need 1.8 support

#

that's what I'm asking

quaint mantle
#

I'm being held gun point

rough ibex
#

not good enough of a reason

#

we all make sacrifices, comrade

scarlet shard
#

how can I remove creative menu tabs from the creative menu, e.g. the SpawnEggs tab and the SavedHotbars tab or at least prevent players from accessing them?

young knoll
#

You can’t

#

Not without a mod

#

Creative menu is fully clientside

alpine solar
#

Is it better to use Runnable rather than raw thread?

smoky anchor
#

Y-yes ?
Spawning a new thread means you can't use most of the spigot API functionality.

alpine solar
#

Thread safety?

smoky anchor
#

Idk, but some methods will throw exception if you try to use them off main thread.
I think setting block or spawning entity does that.

pseudo hazel
#

anything that interacts with the spigot api is not thread safe unless explicitly mentioned

ivory sleet
trail cargo
#

What is Particle.BLOCK_CRACK and Particle.ITEM_CRACK and Particle.SMOKE_NORMALin 1.21.4?

worldly ingot
#

BLOCK, ITEM, and SMOKE

true barn
#

Can i turn on tnt duplication on spigot?

eternal night
#

spigot does not disable tnt duplication

true barn
#

Im playing on spigot and I can't duplicate TNT

eternal night
#

What is the output of /version

stuck oar
true barn
#

spigot server with craftserve host, there are some plugins

stuck oar
#

well it will probably be the plugins

#

what plugins are they

#

any anti-dupe / anticheats?

true barn
#

Gsit, Tab, EssentialsX

blazing ocean
pure dagger
#
@EventHandler
    public void onBlockGrow(BlockGrowEvent event) {
        Block block = event.getBlock();
        if (block.getType() == Material.VINE) return;
        UnnaturalBlocks.setUnnatural(block, plugin);
        System.out.println(event.getBlock());
    }

why doesnt it work when i use bonemeal but works if something grows naturally?
setUnnatural just ads pdc key to blocks

eternal oxide
#

Try checking the StructureGrowEvent?

pure dagger
eternal oxide
#

you didn;t specify what you were growing

pure dagger
#

ok so its crops or berries

#

but as i said it only doesnt work with bonemeal

eternal oxide
#

yeah its only for naturally grown

pure dagger
#

but its CALLED but not working

eternal oxide
#

I doubt there is an event for bonemeal other than the interact event

#

the javadoc says its only for naturally grown

pure dagger
#

uhmm

#

so why is it called

eternal oxide
#

then yippee?

pure dagger
#

yippe?

eternal oxide
#

if the event fires using bonemeal, what is yrou issue?

pure dagger
#

then i wanna do the same thin as i do with natural growth

#

its also called when i use bonemeal but wheen i add the pdc to block it doesnt work

eternal oxide
#

the block changes when it grows

pure dagger
#

😭 but it works when naturally

eternal oxide
#

your pdc is probably being overwritten

pure dagger
#

or it doesnt

#

ohhh wait

#

its probably done by CustomBlockData, and not by my event

#

yeah

#

that explains everything

#

so how do i change the actual block

#

do i havr to do a delay

eternal oxide
#

apply it 1 tick after or change teh block and cancel the event

pure dagger
#

thankss

pure dagger
near furnace
#

I did /viewinv hi_rad to get rad's inventory, but if you steal something and try to stack it with the "normal version" from the creative menu it won't stack. Why duke ?

#

I need rad to help me on this inflatable

remote swallow
#

@blazing ocean help him then smh

near furnace
remote swallow
#

im not here what you on about

near furnace
#

come on bruh

remote swallow
#

if i wasnt busy rn i would

near furnace
#

ok i'll just wait for someone who is not busy 🥺

young knoll
#

They probably have some sort of data on them

#

Hold em and type /data get entity @s SelectedItem

near furnace
#
ItemStack offhandStack = inv.getItemInOffHand();
        if (offhandStack.getType() == Material.AIR) {
            offhandStack = new ItemStack(Material.BARRIER);
        }
        GuiItem offhand;
        if (offhandStack.getType() == Material.BARRIER) {
            offhand = ItemBuilder.from(offhandStack)
                    .name(Component.text("Offhand Slot")
                            .color(NamedTextColor.GRAY)
                            .decoration(TextDecoration.ITALIC, false))
                    .asGuiItem(e -> e.setCancelled(true));
        } else offhand = ItemBuilder.from(offhandStack).asGuiItem();```
#

Triumph GUI Library in use

young knoll
#

What

near furnace
# near furnace ```java ItemStack offhandStack = inv.getItemInOffHand(); if (offhandStac...

then,

    private final Gui gui;
    private final Player target;

    public InventoryGUI(Player target) {
        this.target = target;
        gui = Gui.gui()
                .title(Component.text(target.getName() + "'s inventory"))
                .rows(6)
                .create();

        setupInventory();
    }

private void setupInventory() {
    ItemStack offhandStack = inv.getItemInOffHand();
        if (offhandStack.getType() == Material.AIR) {
            offhandStack = new ItemStack(Material.BARRIER);
        }
        GuiItem offhand;
        if (offhandStack.getType() == Material.BARRIER) {
            offhand = ItemBuilder.from(offhandStack)
                    .name(Component.text("Offhand Slot")
                            .color(NamedTextColor.GRAY)
                            .decoration(TextDecoration.ITALIC, false))
                    .asGuiItem(e -> e.setCancelled(true));
        } else offhand = ItemBuilder.from(offhandStack).asGuiItem();


    // set the stuff now
    gui.setItem(5, offhand);
}
young knoll
#

All I said was to hold the item and run a command to see what data it had

#

Thereby telling you why it wouldn’t stack

blazing ocean
near furnace
#

ayyy

#

look

#

but how do I not make the cobblestone have all these data

#

i just wanna be able to open someone else's inventory and steal stuff

remote swallow
#

wild question, when you make your inv are you adding pdc to its items?

young knoll
#

I assume the gui library is adding that

remote swallow
#

if you dont know ur gui lib is adding pdc to items to id them most likely

near furnace
#

my gui lib is adding pdc without telling me?!!!

#

also whats a pdc

blazing ocean
#

?pdc

near furnace
#

no mention of adding pdc to items in docs

near furnace
#

ok how do i avoid adding pdc

blazing ocean
#

why

near furnace
#

because i don't want it to be different

#

inclusivity

#

imagine i steal your diamonds using the /viewinv command, and see that those diamonds are being racist in simple terms

remote swallow
#

go to triumph support is gonna be the best answer

young knoll
#

What

buoyant viper
#

racist diamond be like

#

i hate emerald 🤬

young knoll
#

Meanwhile diamonds used to be called emeralds internally

sly topaz
#

as for that case, what one would usually do is off-load the metadata somewhere else, like the player's pdc instead and have some other way to identify the item

#

but the issue with player pdc is that people often forget to remove it so it gets big really fast

young knoll
#

That’s up to the gui maintainer

blazing ocean
#

who needs cleaning up anyway smh

near furnace
#

eh im not gonna use that stupid library for this then

sly topaz
#

every GUI library either uses slots or PDC to identify items, it all depends on the functionality you're looking for

thorn isle
#

personally i don't see why you'd use pdc for guis, it seems rather silly to me

sly topaz
#

it isn't much of an issue for non-moveable items but when you deal with items that can in fact move around and they got a specific behavior, PDC is pretty much the only sensible choice

#

if duping isn't an issue, you could go for lore-name matching like people used to do but it is usually a problem

thorn isle
#

i suppose, though i can't really contrive a case where you'd want players to be able to pick up and place down the gui elements within the gui to move them

near furnace
#

yes if it was an admin GUI or something where you don't have to take the items then adding pdc is fine I don't care

thorn isle
#

maybe a chess or minigame board or something

near furnace
#

but its a /viewinventory command

sly topaz
#

trade GUIs, or minigames yeah

sly topaz
near furnace
sly topaz
#

you can just open the player's inventory for the command sender

near furnace
thorn isle
#

is there a need to write this yourself in the first place

near furnace
thorn isle
#

there are a bazillion invsee plugins

sly topaz
near furnace
#

it'll be like this

sly topaz
#

but yeah, as vcs mentioned, there's quite a lot of invsee plugins lol

near furnace
sly topaz
#

you could just take an open source one and do your own thing with it, even

near furnace
#

its not bout that, its bout the grind and the power

thorn isle
#

i'm not sure what the cleanest way of doing this actually is

near furnace
#

🤣

thorn isle
#

using inventory click/drag events to determine when slots change is annoying and error prone

near furnace
thorn isle
#

so if i had to do this i'd probably copy over the contents from the inv to the gui every tick

near furnace
near furnace
thorn isle
#

as for stealing items, i'd probably only allow simple left/right clicks to pick/place all/one and reflect the changes manually

sly topaz
#

it wouldn't necessarily be laggy, you could diff the inventories in order to avoid copying it over every time

thorn isle
#

it's not efficient, but it would be fairly cheap

thorn isle
#

you underestimate how much nonsense of this sort the server does every tick

#

e.g. a hopper basically does the same, except it also does item comparisons which is like 10x more expensive

sly topaz
# near furnace do wvat?

take both inventories and compare whether the items in the given slot are still the same material, fairly cheap check

#

if they aren't, then copy the inventory over

near furnace
#

yae

#

/viewinv:

  • compare both inventories every tick (gui & target's actual inv)
    • update gui inventory
  • reflect changes only place or drop
vague swallow
#

Can somebody please tell me why this is not moving the entity?

Entity vehicle = p.getVehicle();
assert vehicle != null;
vehicle.teleport(vehicle.getLocation().add(p.getLocation().getDirection().clone().normalize()));
sly topaz
vague swallow
#

the entity doesn't move a milimetre

near furnace
sly topaz
#

you can improve upon that if it isn't enough at some point as it is a fairly flexible way to go about it

young knoll
sly topaz
thorn isle
eternal oxide
#

assert is ignored at runtime. It just silences your IDE on a null check

vague swallow
thorn isle
#

mojang can't into tick loop

eternal oxide
#

too heavy 🙂

sly topaz
#

it silences it however you don't want to do that, you should properly check if the thing is null

vague swallow
young knoll
#

Probably velocity

#

Or NMS

near furnace
thorn isle
#

if you think about it, velocity is just teleporting with collision checks 🤡

eternal oxide
young knoll
eternal oxide
#

but, it just makes your code explode earlier

sly topaz
young knoll
#

I just suppressing warnings all at the top of every class

#

Duh

near furnace
#

so kids, always use ternary operator or if-else null checks

thorn isle
#

try catch ignore nullpointerexception

young knoll
#

Or just code in an ide that doesn’t show warnings

#

Like notepad!

thorn isle
#

asserts, require non null, and null checks are all distinct and have their different use cases

sly topaz
#

a good case for it is JavaPlugin#getCommand, it is nullable because it can in fact be null if you forget to add the command in question to your plugin.yml, but when you know it is there then you may wrap the getCommand call with Objects#requireNonNull to assert that it is in fact not null

thorn isle
#

though using asserts at all is disfavored by some

worthy yarrow
#

Does kotlin’s precondition.nonNull (or wtv the call is) work the same way under the hood as objects.requireNonNull

sly topaz
thorn isle
#

they're about the same as require non null except that the check is actually disabled by default

sly topaz
thorn isle
#

you have to launch the process with assertions enabled, or call things on your classloader to enable them

near furnace
thorn isle
#

this makes them very useful for internal "micro testing" where you don't want the performance impact of validating all constraints to happen on production, but want to catch exactly where something goes wrong during testing

sly topaz
#

I don't know why you would use precodition.nonNull over the operator

near furnace
#

imagine having to manually do all the identations

#

just imagine trying to code a big project entirely in notepad

worthy yarrow
sly topaz
#

well, it should never be null in the first place if you're using that operator 😛

#

but makes sense

worthy yarrow
#

Preconditions.x( , “something something”)if I remember kotlin syntax but eh

thorn isle
#

a rule of thumb i use is that if the validated thing comes from outside the scope, use exceptions (require non null); if it comes from within the same scope, use assert

#

obviously only works if you actually test your code though

worthy yarrow
#

Yeah that’s fair

worthy yarrow
remote swallow
#

?: is what i think you mean

#

getNullable() ?: "WOAH ITS NULL"

#

if its a method you dont want null in dont accept a Type? only accept a Type

thorn isle
#

without knowing the context or seeing the code, assertions would probably suffice as long as all of the call sites and api points that might be used by "other code" are covered by exceptions, and all the tightly coupled classes are tested with assertions enabled

compact haven
#

typically in Kotlin if you're using !! it's because you've verified it won't be null through some other means, like calling #isPresent() on the Optional then #get()

#

if it is null it'll throw an NPE

#

if you want to throw an error with a message then you'd chain ?. so
someObj?.aField ?: throw IllegalArgumentException("someObj is not nullable for thisMethod(Object)")

worthy yarrow
#

Kotlin has an optional impl? Jeez rad needs to redo his cheat sheet for me kek

#

Or is that just how it’s handled under the hood…

somber scarab
#

how do I get an Iterable of all PotionEffectTypes?

young knoll
#

Registry.EFFECT.iterator

thorn isle
#

could probably include that in the deprecation note to be honest

somber scarab
#

okay.. so lets say I need a random potion effect..

#

how do I get the number of potion effects in the game?

#

so I can pick from them

young knoll
#

You could do Registry.EFFECT.stream().toList()

somber scarab
#

perfect.

#

thanks alot

blazing ocean
#

I think?

worthy yarrow
#

Yeah you probably did, I just thought he meant kotlin has an optional impl

blazing ocean
#

Nope

sly topaz
brazen badge
#

minimal or not minimal that's my code

sly topaz
#

yes, but I mentioned a MRE because it's necessary to pin down what exactly it is that is removing the recipes, you'll have to strip it down of anything that isn't required to reproduce the issue

#

other option is to take a debugger and track where the Recipe object is being cleaned, among other things

#

you could start by doing something simpler like adding a breakpoint to Server#reloadData or the respective internal minecraft method, as well as checking if there's anything cancelling the craft events for your custom recipes for whatever reason

brazen badge
pure dagger
#

what the helllll is that

#

i thought there are 6

thorn isle
#

wait till you hear about SELF

pure dagger
#

yeah i saw it

#

but i was like ok

#

maybe its no face

#

just the block

#

but whats that

#

and there are no descriptions

thorn isle
#

these are mostly used as offset vectors

young knoll
#

They basically are offset vectors

#

But as enum constants

worthy yarrow
#

How would you guys approach wind physics in terms of frisbees? My thought was a rather randomized approach within a scale, ie: wind mph 5-15 where 5 will affect the physics a little bit and 15 a lot... that being said, I want to emulate a more realistic system that will take into account say a frisbee's thrown speed as well it's weight and apply changes to the base physics this way. I'm just a bit concerned on what the algo impl will look like such as that it returns weird physics manipulations... the system should always be dynamic in that the wind speed / direction is always changing. I run the physics manipulations currently in a task every tick so I think the wind impact must be as small as possible

ivory sleet
#

how accurate do u need winds to be?

#

could u have a set vector field per chunk?

#

for example

worthy yarrow
#

Well like, I can't be having the frisbees thrown left and right wildly

worthy yarrow
ivory sleet
#

i mean wind is a vector field no?

#

but u could make that vector field per chunk, so one chunk has the same wind vector

#

mostly because chunks are soooo easy to calculate

#

since u just get xz position and then bitshift

worthy yarrow
#

yeah hmm

young knoll
#

Just implement a fully functional air current system

worthy yarrow
#

Here's another thing though, wind tends to be a bit crazier at higher altitudes so considering this and the way a frisbee can be thrown, there will have to be Y levels attached to the wind vector as well

ivory sleet
#

i mean yea thats fine

#

u can also transform depending on y axis alone

worthy yarrow
#

Yeah but to do this smoothly is also an issue

ivory sleet
#

how so?

#

i mean sure, u're limited to the tick speed of minecraft

young knoll
#

Just pull a Wii sports

#

Direction, speed

#

Done

ivory sleet
#

I think whats most performance impacting on ur stuff is how many times u run sqrt w length + normalize

worthy yarrow
#

It's hard to explain... a frisbee may be thrown low and flat which usually results in minimal wind impact right? On the other hand, you may throw a frisbee high and angled in which the wind can really do anything mid flight... I'm basing this off irl experience... so with that I feel like the smoothness of the manipulations are going to be detrimentally affected by the initial throw mechanic and it's returned vectors for the throw itself without a genuine wind system impl or air current system like coll said

ivory sleet
#

oh its centrifugal force?

#

or like self rotation force

worthy yarrow
#

Well that also depends, on a forehand throw, your frisbee is usually spinning faster than say a backhand, this in regards to the wind would also make an impact

ivory sleet
#

i mean yea

sullen marlin
worthy yarrow
#

Well neither of these are implemented yet so I guess it could be...

sullen marlin
#

I'd start with the Wii sports approach like Jish said

worthy yarrow
sullen marlin
#

And then just update it to different vectors per location

worthy yarrow
#

Well I also wanted to try and design the wind system around the terrain of an arena or course as well...

#

Maybe there are a lot of "wooded" holes on this course so even if the wind speed is high you wouldn't be affected by it as much since you're surrounded by a lot of trees as an example

buoyant viper
worthy yarrow
#

Man I just integrated my course gen with native objects... I don't need to be crashing the server more with universe sims kek

buoyant viper
#

a little particle physics never hurt anybody

worthy yarrow
#

Man I'm so over physics but still need to write so much more out

#

Been doing this shit for like 6 months

#

And I've only accounted for two throw types out of like 13 total

#

Maybe one day I'll write a physics engine for frisbees so I don't have to rely on rather hardcoded systems

nova notch
#

you really like frisbees to put this much effort into this

worthy yarrow
#

I mean I love disc golfing which is what I'm implementing right now

nova notch
#

i have an idea

#

just say that its not a very windy day

worthy yarrow
#

kek

#

That's basically the point I'm at right now

#

Only with slight random deviations involving the throw mechanic and initial vectors

dawn flower
#

why does meta.addItemFlags(ItemFlag.values()) not hide attributes?

dawn flower
#

yeah but that shouldn't make a difference i assume

slender elbow
#

:Clueless:

rotund ravine
#

Also are u setting the meta back properly

dawn flower
#

yep

sullen marlin
#

?whereami

dawn flower
#

ok fair enough

young knoll
#

Just replace Bart with md_5

nocturne aspen
#

hello how i can install soul link plugins pls

sullen marlin
#

Download jar, put in plugins folder

torn shuttle
#

hello ga-ga-ga-ga-ga-gamers

#

I doubt it's the case but is there a field in materials or blocks to see if they're supposed to be opaque or not

echo basalt
#

isOccluding

#

uh

torn shuttle
#

oh cool

echo basalt
#

then we have isSolid

torn shuttle
#

glass is solid tho

echo basalt
#

yeah

#

should be occluding as well

torn shuttle
#

just wanted an easy out to see my beautiful custom models through a nice glass display case

echo basalt
#

there was an isTransparent

#

at some point

#

deprecated rn

#

might be a paper moment

torn shuttle
#

I'm not too stressed about accuracy here

echo basalt
#

isOccluding returns false

#

I'm usually the kind of guy to just look up by keywords

#

so words like "GLASS", "FENCE", "GRASS", "POTTED", "BARRIER"

torn shuttle
#

well I just might have to

#

was just checking if there was an easy fix first

torn shuttle
#

hm is using 7.5% of a tick for custom models good enough

#

I feel like it's fine

echo basalt
#

no

torn shuttle
#

alright I optimized it and now it's using 15% of the tick

#

an interesting magic trick

#

how did I even do that

random compass
#

i am currently coding a snail into mc using armadillos. can anyone tell me how to force armadillos to stop curling up?

random compass
torn shuttle
#

you don't have to apologize, but I forgive you

random compass
#

thanks

random compass
#

i was gonna use that for pathfinding but i didnt realise i would have to do that for curling as well

mortal vortex
#

The Armadillo curling up is a result of a "threat", this is apart of BehaviorController

#

but, would "EntityPoseChangeEvent" work ? have u tried

random compass
#

would love a recommendation on a better mob to do this with

jagged thicket
#

see this pr @random compass

#

u can freeze with this method in nms

torn shuttle
mortal vortex
#

yeah and what do u mean by "snail"

#

how do armadillos even look like snails

random compass
#

ive made a texture pack

torn shuttle
#

just make a model

random compass
#

i wouldnt even know where to start

torn shuttle
#

the one I posted there took maybe 10 minutes

torn shuttle
#

knock yourself out

rotund ravine
torn shuttle
random compass
#

thanks. bbbut would you mind explaining how custom model works?

#

i am extremely new to this

torn shuttle
#

you use a nondescript custom model plugin and find a nondescript way of hosting the resulting resource pack

#

there might be some dev gigachads out there that have made free tools that handle both of these things

random compass
#

i see

torn shuttle
random compass
#

those look crazy good

torn shuttle
#

I should use a real timings solution, I'm getting some really weird data out of this

random compass
torn shuttle
#

not free and not updated for 1.21.5 and not open source but yes absolutely it should

random compass
#

ok, ill try find a free one

torn shuttle
#

freeminecraftmodels

blazing ocean
#

magma it's ad time

torn shuttle
#

mods ain't going to like this one

#

but hey it's not like it's selling anything

blazing ocean
#

i mean you could sell it

torn shuttle
#

then it wouldn't be free dumdum

blazing ocean
#

it can still be free as in freedom

torn shuttle
#

MURIKA Minecraft Models

#

guns, flags and dollar bills

blazing ocean
#

GPL allows you to sell your product

torn shuttle
#

tbf didn't say it was gpl holding me back

sullen marlin
#

Magma you have my permission to advertise your model plugin in this channel for the next 2 minutes

#

You do have one, right

torn shuttle
#

aaaaaaaand screenshotted

blazing ocean
#

what's a plugin

torn shuttle
#

alright cool

#

@random compass freeminecraftmodels + resourcepackmanager

#

if you want to test the new freeminecrafmodels plugin lmk, I was about to release it with what is basically a full remake

torn shuttle
#

it better be

#

I spent a lot of time making it to

rotund ravine
torn shuttle
#

I shall advertise my plugin every day from 6:20 to 6:22 am henceforth

blazing ocean
#

smart

torn shuttle
#

ghost if you want the early access just go join my plugin discord and I'll send it there

#

I'll also tell you how to use the api there

random compass
#

what are the steps to implementing a custom model? i download a model plugin and pack manager, then upload the bb model, and then my plugin should control the behaviour?

torn shuttle
#

yeah basically you just tell fmm to disguise an entity and then it's up to you what hte entity does

random compass
#

wheres a link to your server?

torn shuttle
#

on my spigot pages

#

the fmm one / the rspm one

random compass
#

bros actually famous

torn shuttle
#

so famous I paid to have my name not be my name

sullen marlin
#

He's legit the coolest guy in this server

torn shuttle
#

not the hottest
😢

random compass
#

nvm i found what to do

blazing ocean
tawdry echo
#

?mappings

undone axleBOT
somber scarab
#

im making a plugin for a YouTube video

#

oops wrong channel

scarlet shard
#

do you guys think this plugin can handle a large player base (like 2000 avg players), the problem im having is that its using MySQL instead of PostgreSQL:

https://battlepass.advancedplugins.net/

whats your opinion on that?

blazing ocean
#

why are you trying to get 2000 players on a single server

#

don't try that

scarlet shard
#

but 2000 avg players

sullen marlin
#

most plugins use mysql not postgres

#

how exactly is mysql a problem

blazing ocean
#

^ not using pg doesn't mean it'll be slower

scarlet shard
blazing ocean
#

I mean you don't really need postgres

scarlet shard
blazing ocean
#

yes

scarlet shard
#

thanks!

blazing ocean
#

For most workloads, the performance between Postgres and MySQL is comparable with at most 30% variations

rough drift
blazing ocean
#

ew mongo

mortal vortex
#

pov nosql

cold elk
#

hey guys anyone know a plugin that would allow me to make a redeemable item that would randomly give you another item from a list. so for an example youd get like a "lucky egg" that would pick a random spawn egg from a list (of all the spawn eggs)

mellow edge
#

It depends on the design

cold elk
#

i mean really any design. i was just thinking something like really simple where it just removes the redeem and gives you a random egg (or ofc other item) from a list of items

#

but anything rly

mellow edge
#

If you want all the magic to happen in the inventory you need a PlayerInteractEvent. If you want a custom item use a resource pack along with the plugin. On click simply change the slot to the wanted ItemStack

cold elk
#

ah alright ty

unkempt pilot
#

hi guys I need help I tried making a system where it would give me the custom items

#

but it didn't gave me the custom item

vast ledge
#

Information 100

unkempt pilot
#

no errors but it didn't give me the item

vast ledge
#

Debug why logging

#

Log the playername

#

Log the itemstack

#

Log what the user entered

unkempt pilot
#

ok ok I'll try

somber scarab
#

how do I detect if the player is not afk?

(in detail)
I am making a stupid effect that will put you in creative mode every 20 seconds
And I want to put the player back in survival as soon as they try to do anything

#

so that they don't actually abuse it

vast ledge
#

Check player move event, player interact, inventory change

somber scarab
#

but InventoyOpenEvent is not really working?

somber scarab
vast ledge
#

Inventory events are kinda cursed in creative

vast ledge
somber scarab
vast ledge
somber scarab
#

ahhh

mortal vortex
rotund ravine
#

Hover over the args.length == 2 and see what it says

unkempt pilot
#

oh yea you're right

#

thanks

#

it said that it was always false

mortal vortex
mortal vortex
#

you’re not exiting that initial “if args length is 1”

#

you’re checking args.length == 2, in a block where it’s already established to be 1

#

does that make sense?

#

basically what I’m saying is. That if statement that checks if args has a length of 2, is being performed in the if statement checking if its 1. Something cannot be 1 and 2 at the same time. If it is 1 then it cannot be 2. Meaning that portion of code will always be false if it’s there, not only false but redundant.

unkempt pilot
#

ohh so that's why when I removed it, it works

#

thanks! It works now

worldly ingot
brazen badge
silent slate
#

Hey, ive been using DevNatan's Inventory Api but i keep getting errors that the viewframe doesnt have a owner.

When i use viewFrame.create(plugin) the returned viewFrame really doesnt have a plugin (owner) attached to it. It has a private constructor, but i cannot initialise a viewFram instance cause its private. So how to fix this?

eternal oxide
#

get the plugin instance from Bukkit

#

unless its your plugin

rotund ravine
ashen wren
#

Why is the InventoryCloseEvent triggered if i right click a block? Its only if i right click a block

chrome beacon
#

Are you sure you're listening to the right event?

#

also are you trying to detect the player inventory closing?

pure dagger
#

how to make an npc

chrome beacon
#

Use Citizens

pure dagger
#

if i wanted to do it myself id need to use nms?

chrome beacon
#

yes

thorn isle
#

either that or protocollib or libsdisguises

#

i recommend libsdisguises if you for whatever reason don't want to depend on citizens for it

#

rawdogging it with protocollib is going to be marginally more stable than nms but far more annoying and troublesome to make work

pure dagger
#

citizens is free?

slender elbow
#

yes

pure dagger
#

where do i go

#

github?

slender elbow
#

read the description

#

like, the very first sentence

stuck oar
ashen wren
# stuck oar can you send the class?
package eltown.api.invgui.listener;

import eltown.api.invgui.InventoryGuiHandler;
import eltown.api.invgui.components.InventoryGui;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.inventory.Inventory;

public class InventoryGuiListener implements Listener {


    @EventHandler
    public void on(InventoryCloseEvent event) {
        if(event.getPlayer() instanceof Player player && InventoryGuiHandler.guiPending.get(player.getName()) != null) {
            InventoryGui inventoryGui = InventoryGuiHandler.guiPending.get(player.getName());
            inventoryGui.setClosed(player);

            InventoryGuiHandler.guiPending.remove(player.getName());
        }
    }
}
stuck oar
#

can you send the rightclickevent class too

ashen wren
# stuck oar can you send the rightclickevent class too
    @EventHandler
    public void on(PlayerInteractEvent event) {
        Player player = event.getPlayer();

        InventoryGui.Builder builder = new InventoryGui.Builder("Test", InventorySize.x5);

        for (int i = 0; i <= 8; i++) builder.addElement(new GuiElement(i, new ItemStack(Material.GRAY_STAINED_GLASS_PANE)));

        builder.addElement(new GuiElement(11, new ItemAPI(Material.PAPER)
                .setItemModel("eltown:lobby_compass")
                .setCustomName("§aNavigator").build()), p -> {
            p.sendMessage("Custom Item wurde angeklickt.");
        }).onClose(p -> {
            p.sendMessage("GUI wurde geschlossen");
        });
        builder.build().send(player);
    }```
stuck oar
ashen wren
# stuck oar what is this aimed to do?

This is simply to open a custom GUI for testing when I make any interaction. And when I click left, a UI opens and I can't move items because I forbid it. But if I right click on a block, the GUI also opens, but because the InventoryCloseEvent is strangely triggered, I can move the items, which should not be the case. I have not closed the inventory, but it is still triggered.

stuck oar
#

open the inventory a tick later

#

or try cancelling the interact event

#

minecraft tries to trigger a blocks default interaction from right clicking

ashen wren
stuck oar
#

open the gui a tick later

#

using bukkits scheduler

ashen wren
stuck oar
#

uhh

slender elbow
#

and what is the inventory involved in the close event?

stuck oar
ashen wren
ashen wren
stuck oar
stuck oar
#

he has a class called InventoryGui

slender elbow
#

would be nice to see how exactly onClose works under the hood

#

iirc when you open an inventory the player's own inventory "closes"

#

which is why i ask what i ask

ashen wren
#

I want to try something for a moment

#

Ok i fix it

#

I have now queried the Reason in the InventoryCloseEvent. Normally “PLAYER” is used as the reason when I close an inventory. But strangely enough, the right click uses the reason “OPEN_NEW”. So I have now made an if query and said that if the value is not “OPEN_NEW”, it should no longer execute the event. Only with the value “PLAYER”. This way it works, for whatever reason.

chrome beacon
#

The client doesn't tell the server about it opening or closing it's own inventory

#

Only about other inventories like chests

#

or so I remember it... if it works for you, good ig 🤷‍♂️

echo basalt
hard socket
#

how can I prevent the player nametag from changing color while changing the color of team the player's in?

frosty forge
#

hi does someone have good guilds plugins? and can help me upload it to craftserve? - I need it for +/- 25 people

quiet flare
#

?support

undone axleBOT
quiet flare
#

wait not this

#

?services

undone axleBOT
chrome beacon
slender elbow
#

the server needs to know when you close the inventory to drop whatever you have on your cursor, or place back in the inventory what you have in the 2x2 crafting grid and such

chrome beacon
#

I just assumed the client would send drop item packets for that

#

since there are hacked clients that allow you to use those slots as extra inventory

slender elbow
#

yeah all they do is not send the menu close packet

#

which makes for an easy way to check for them too, if you placed items there and you're moving around, then you're cheating :p

rotund ravine
sly topaz
slender elbow
#

i mean, packets are sent serially

thorn isle
#

it's a bit more sensible now with the input packet

#

but previously, you had to account for things like pistons, gravity, water, etc

#

since "player moving" doesn't always mean "player moving"

#

oh yeah that reminds me

#

is the input packet still sent in spectator mode?

#

or do we still have to rely on the vehicle mount + spectate entity trick and listen for the vehicle movement packet?

sly topaz
#

client sends it as soon as its tick method gets called, along with the vehicle move packet

thorn isle
#

nice

sly topaz
#

I assumed the vehicle move packet was sent from the vehicle's tick method and not the client, the more you know

thorn isle
#

i always hated depending on the vehicle move thing because it seemed like a hack that might get changed up any time some intern at mojang feels like refactoring the client tick loop

sly topaz
#

yeah, not a very reliable workaround and kind of annoying to work with honestly

#

well, not unreliable since that's how everyone does it since god knows how long, but definitely can see mojang doing what you said at some point

somber scarab
#

how do you change a player's attributes?
I want to reduce the player's max health

#

I found the Player#registerAttribute() method but I can only set Attribute enums inside? how do I change the player's MAX_HEALTH value

blazing ocean
#

AttributeInstance#addModifier

somber scarab
#

wth..

#

what's the difference between the attribute and the attribute instance?

#

and I need to modify them using an attribute modifier now?

#

RIP
player.setMaxHealth()

blazing ocean
#

Attribute is just the type / ID for the actual attribute, AttributeInstance is the instance of the attribute on an attributable which can be modified

somber scarab
#
        maxHealth.addModifier();
        assignedPlayer.registerAttribute();```
this is what I got so far
#

I need to connect both ends

young knoll
#

You don’t need registerAttribute

somber scarab
#

ah okay.. so it register changes right away

#

but I still need that attributeModifer

blazing ocean
#

use the constructors

somber scarab
#
        AttributeInstance maxHealth = assignedPlayer.getAttribute(Attribute.MAX_HEALTH);
        assert maxHealth != null;
        maxHealth.addModifier(new AttributeModifier(NamespacedKey.fromString("potionMayham:hearts"), -6, AttributeModifier.Operation.ADD_NUMBER));```

I have a feeling this isnt right
#

from the fact that I'm unsure why I need a namespaced key tbf

#

(which Idk what it is yet)

blazing ocean
#

potionMayham
keys need to be all-lowercase

#

otherwise lgtm

somber scarab
#

I understand what namespacekeys are but I don't think I have any registered under my plugin

#

isnt that an issue?

blazing ocean
#

no

#

they're just an identifier for the attribute modifier

somber scarab
#

okay I see

#

oh how do I check if an attribute already has the modifier applied?

#

ah get modifier

upper hazel
#

how spawn particle for player? this harder then i was think

#

i always getting error

#

what the "T data" is arguments in method?

chrome beacon
#

T data depends on the particle being sent

upper hazel
#

bruh

chrome beacon
#

The javadoc tells you what data is for the particle (if it even has one)

blazing ocean
#

if you don't need data, don't pass in data

charred blaze
#

im trying to write a mc bot and im getting this error message

#

Reason: {"translate":"disconnect.genericReason","with":["Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'serverbound/minecraft:hello'"]}

remote swallow
#

are you sending the hello packet properly?

charred blaze
#

do you mean the login start packet?

#

btw for testing purposes i disabled online mode

blazing ocean
remote swallow
blazing ocean
#

I was thinking of writing my own server impl in kotlin with coroutines

#

I'm bored rn so time to do that

remote swallow
#

make it work in compose kekw

blazing ocean
#

I mean, you can already spin up an MC server inside compose

charred blaze
#

im getting 0x00 (disconnection) after login start

blazing ocean
#

it's encryption request

charred blaze
#

thats 0x01 isnt it

blazing ocean
#

it would probably be helpful if you shared your code

charred blaze
blazing ocean
#

still

#

I've been writing nothing but rust for the past week

charred blaze
blazing ocean
#

is this AI-generated

charred blaze
#

yes

#

partly

blazing ocean
#

all of that looks AI-generated to me

charred blaze
#

i gave it base structure from rust-mc-proto examples

alpine urchin
#

rad the ai code checker

#

@blazing ocean

blazing ocean
#

hi retro

alpine urchin
#

how did you identify the ai

charred blaze
#

compared my english level to it

blazing ocean
#

comments + thread::sleep(2s)

charred blaze
#

lol

alpine urchin
#

what are you writing

charred blaze
#

mc bot

alpine urchin
#

you could have used a specific library

charred blaze
#

i am

alpine urchin
#

it starts with P

charred blaze
#

can we stick to sending raw packets

blazing ocean
#

PE does not support rust

charred blaze
#

whats PE

blazing ocean
#

packetevents

#

there's another library you should've used

alpine urchin
blazing ocean
#

rewriting PE in rust

charred blaze
#

any issues in my code?

alpine urchin
#

retrooper if he didn't have PE

#

I'd probably would have been a great philosopher

#

because i'd repeatedly question the meaning of life

charred blaze
#

@blazing ocean r u reading my code

alpine urchin
#

they're not

#

rusty dusty ah code

charred blaze
blazing ocean
#

at what stage are you getting that error, i.e. add debug statements

charred blaze
#

here

#

ill print login response id wait

blazing ocean
#

is that nvchad

charred blaze
charred blaze
#

response packet id is definitely 0x00

blazing ocean
#

(optional field, setting to 0 for offline mode)

#

top ten biggest lies

#

nevermind

#

I cannot read

charred blaze
#

what does this exacly mean?

#

Failed to decode packet 'serverbound/minecraft:hello

blazing ocean
#

that you're writing something wrongly

charred blaze
#

😭 which part tho

blazing ocean
#

have you tried just writing an int instead of a boolean

charred blaze
#

like this

#

nope same error

#

will try varint

#

same error

blazing ocean
#

is there a write_long or something

#

since it's 16 bytes

charred blaze
#

yes there is

#

same error tho

blazing ocean
#

turn on debug mode on the server

charred blaze
#

is that in server properties

blazing ocean
#

it is

charred blaze
#

ok restarting

#

wow now it isnt even printing what it was printing before

#

the hello error

blazing ocean
#

magic

charred blaze
#

ah wait

#

@blazing ocean

blazing ocean
#

no idea what that means I usually just run the server with a debugger attached

blazing ocean
#

I run the server and attach a debugger

charred blaze
#

ok ill try to

tribal wraith
#

If I just have

            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.21.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
as a Maven dependency, is this using Spigot NMS mappings?
#

Or is that a separate thing

blazing ocean
#

it is

#

for mojang mappings:

#

?nms

tribal wraith
#

Is it OK to use mojang mappings in a commercialized server as long as I don't distribute my private plugin?

#

In terms of the eula?

blazing ocean
#

specialsource remaps your plugins back to spigot

tribal wraith
#

Oh poyfect

pure dagger
#

what does this clicktype do

#

i mean in creative its not called, in normal inventory it doesnt work

tribal wraith
#

Sorry to overshadow your question Kmys; on the post you sent rad, does the specialsource maven plugin in the pom.xml automatically remap it back to spigot on jar compile?

worthy yarrow
blazing ocean
#

hi kat

pure dagger
#

like whats the purpose of that click, i get it you can do multiple functions by checking if player clicked right, left or middle

#

but why is it there

remote swallow
#

did you try in survival too

pure dagger
#

yeah, in creative its juts "CREATIVE"

somber scarab
#

is there a way I can make the hp bar look as if it's withered without actually withering the player?

somber scarab
pure dagger
#

why?

somber scarab
# pure dagger why?

I'm making a plugin that rotates custom made "potions" on you.

I'm making an effect that puts you in creative every 30 seconds, but if you do anything, it will set you back to survival.

pure dagger
#

oh okay

somber scarab
#

and other stupid effects like give levitation every 5 seconds

#

its for a video

pure dagger
#

okay

somber scarab
#

wait but I still don't get it

#

I have checks for Inventory Interact Event

#

but they don't call in creative mode sadly

pure dagger
#

it was inventory click

somber scarab
#

Most of these don't call when the player already had their inventory opened.

#

and inventory open event in creative doesnt work

#

idk why

pure dagger
#

i dont know

somber scarab
#

its very screwed in creative

#

that's why I disabled it for now ... you can easily find bugs or cheat your way

eternal oxide
#

Creative is pretty much all client side

pure dagger
#

why inventory interact not click

#

oh..

#

okay

somber scarab
#

like middle mouse doesnt call PlayerInteract

pure dagger
#

nvm

somber scarab
#

event

#

for creative mode

eternal oxide
#

because creative is all client side. The client decides everything and just tells the server the result

pure dagger
#

if i need to let other plugins use commands available in my plugin, do i have to do something? or do they just Bukkit.dispatchCommand("plugin:command") ?

somber scarab
#

idk why I never thought of that

eternal oxide
#

expose an API to access yoru plugin features

somber scarab
#

not all inventories are the same 🏳️‍🌈

pure dagger
#

but what if its by yml

#

you put the command in other plugins yml

eternal oxide
#

what?

pure dagger
#

there is plugin 1 which has a command implemented, and there is plugin 2 which has yml with list of commands, user only writes the commands

#

and plugin 2 executes them, so it can also execute a command from another plugin

#

what do i do

eternal oxide
#

create an API for the implementation

pure dagger
#

but plugin 2 has to add that api ,what if its an already written pluginm

eternal oxide
#

so your second plugin can do java Bukkit.getPlugin("PluginWithImplementation").executeCommand(args...);

pure dagger
#

couldnt it do Bukkit.dispatchCommand("plugin:command") ? and paste there ocmmand from config

eternal oxide
#

dispatch is lazy

pure dagger
#

what does that mean

#

confused

#

im

eternal oxide
#

get manager, then getplugin, if I remember

#

or you can JavaPlugin.getPlugin

pure dagger
#

what now

eternal oxide
#

you have to create the method you want to make available in your first plugin

pure dagger
#

..

#

oh

#

what does that mean thah dispatch is lazy

rotund ravine
#

If you use it, ur lazy

pure dagger
#

yup but if there is already a plugin with a command i cannot implement it myself

#

so then i only have dispathc

pure dagger
eternal oxide
#

yes, dispatch is heavier than accessing teh API directly

#

it goes through all the Bukkit command processing when it doesn't need to.

pure dagger
#

oh okay

vague swallow
#

will Entity#isOnGround() always return true when the entity has gravity, y = 0 and block below the entity is solid?

eternal oxide
#

I believe its undefined as teh client can lie about being on ground

worthy yarrow
rotund ravine
rotund ravine
#

Creative is very clientside though so they can prolly do smth

worthy yarrow
#

Just cancel the event in any case it’s called obviously 🙄

rotund ravine
lilac fjord
#

how can i install itemsadder 3.6.6 i cant install on spigotmc

vague swallow
paper viper
#

Is there any API to append to the Classpath similar to Paper's loader? The library loader doesn't support external repositories, and I have a dependency bundled with a lot of native binaries which is around 700 MB in total for everything. I have my own repository, but I can't use the library loader and I'd prefer not to upload to central.

blazing ocean
vague swallow
young knoll
#

There’s uhh

#

Libby

#

Which does that

blazing ocean
#

doesn't gremlin do that too

paper viper
#

But its only paper supported

#

doesnt support spigot because it uses the loader api so i need to figure something out

sullen marlin
#

bros' dependencies are 10x the size of the server itself

paper viper
#

over 10x more like 15x

#

Lol

paper viper
#

I've tried it and it just sometimes breaks, not sure why

#

It doesn't support redownloading either

sly topaz
#

you could also just try with a more general-purpose runtime library appender, but I doubt it'd work out of the box with Spigot/Paper

paper viper
#

Yeah i tried Spring slim launcher and that doesnt really work

paper viper
#

Maybe I could add a module that injects into classloader using Unsafe

sly topaz
#

it shouldn't be too hard given you can just copy whatever Libby does

paper viper
#

but idk its a bit sketchy to do that

#

Yeah i made my own loader in the past but im surprised there arent really like

#

many options out there

#

another option is to bootstrap

chrome beacon
#

Libby works fine

#

So there's no need for more alternatives ig 🤷‍♂️

sly topaz
#

well, it is ultimately discouraged as well

paper viper
#

That's true, it's an anti design

sly topaz
#

just opens many doors for exploits

slender elbow
#

not if you do it properly

young knoll
#

What on earth are you librarying

blazing ocean
#

the entire northern hemisphere

paper viper
#

/s 💀

buoyant viper
somber scarab
#

I never dabbled with packets before

buoyant viper
#

protocollib or packetevents or NMS idk

#

whatever u choose to use to send a packet tbh

somber scarab
#

well atleast I know its possible now. but I guess i'll keep t for the next project

#

thankss

sullen marlin
#

sendPotionEffect or whatever?

somber scarab
young knoll
#

sendPotionEffectChange I think

buoyant viper
#

oh theres an api method for it?

somber scarab
#

hmmm..

paper viper
#

Yes

somber scarab
#

amazingg

#

thx, and how do I reset it?

somber scarab
#

ah sick

#

thx guys

young knoll
#

Not the best naming

#

But I didn’t have any better ideas

remote swallow
#

sendPotionEffectRemove?

sly topaz
#

or sendFakePotionEffect/removeFakePotionEffect

#

I personally don't see the point in keeping the nomenclature to the point it becomes an absurd name, but it is what it is

lethal mural
#

Hey, I have some test code that is supposed to spawn a Guardian, but it keeps despawning and I don't understand why. I’m not using any other plugins, only my lobby system is running on the server.

player.getWorld().setGameRule(GameRule.DO_MOB_SPAWNING, true);

                Location startLoc = player.getLocation().add(0, 5, 0);
                Guardian guardian = (Guardian) player.getWorld().spawnEntity(startLoc, EntityType.GUARDIAN);

                guardian.setAI(false);
                guardian.setSilent(true);
                guardian.setInvulnerable(true);
                guardian.setGlowing(true);
                guardian.setCustomNameVisible(false);
                guardian.setRemoveWhenFarAway(false);
                guardian.setPersistent(true);

                new BukkitRunnable() {
                    int ticks = 0;

                    @Override
                    public void run() {
                        if (ticks >= 100 || guardian.isDead()) {
                            if (!guardian.isDead()) guardian.remove();
                            cancel();
                            return;
                        }

                        Location currentLoc = guardian.getLocation();
                        Location targetLoc = player.getLocation().add(0, 1, 0);

                        double progress = ticks / 100.0;
                        double newY = startLoc.getY() - (4 * progress);

                        Location newLoc = new Location(currentLoc.getWorld(), player.getLocation().getX(), newY, player.getLocation().getZ(), currentLoc.getYaw(), currentLoc.getPitch());
                        guardian.teleport(newLoc);

                        guardian.getWorld().spawnParticle(Particle.END_ROD, newLoc, 5, 0.3, 0.3, 0.3, 0.01);

                        ticks++;
                    }
                }.runTaskTimer(Lobbysystem.getInstance(), 0L, 1L);```
#

Does anyone know why this might be happening?

sly topaz
lethal mural
#

Yes, I want to make a teleport animation, but it just despawns — it doesn't even stay for a second.

young knoll
#

Is the world in peaceful mode

#

:p

sly topaz
#

I always forget the difficulty level lol

lethal mural
#

my bad

#

thanks

#

He unfortunately still despawns immediately.

#

difficulty is normal now

sly topaz
#

are you sure you set the difficulty on the right world

#

also, try listening to the EntityRemoveEvent and check for the cause

lethal mural
#

yeah

young knoll
#

Changing it in server.properties will only effect new worlds iirc

#

So use the /difficulty command

lethal mural
#

check

#

its works now

#

thanks

narrow gull
#

im making a minigames server, nothin crazy rn but would like some help

narrow gull
drowsy helm
#

This isn't a recruitment page

#

?services

undone axleBOT
tribal wraith
#

I'm using NMS for pathfinding, I know you use

this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, true));

to find the nearest player, how do you make the entity stay a certain distance away + move back and forth between X and Y distance away? Is there a better pathfinding goal for this?

chrome beacon
#

Can always make your own

tribal wraith
#

I don't know how to start with that, I thought of using the block move to goal and controlling, not sure how to implement something like that - could you point me in the direction ?

chrome beacon
#

For staying away you can look at the creeper ai

tribal wraith
#

Creeper always goes as close as possible

chrome beacon
#

They are afraid of cats

tribal wraith
#

I mean staying away in terms of it's X distance away, but still targets the player

chrome beacon
#

Tried looking at the tamed wolf ai

tribal wraith
#

Thx I'll look into that

mortal vortex
#

is there something native in Spigot like that of "sockets"? Being able to send messages to other plugins, wihout nexessarily needing either to depend on eachother

#

kind of like events of your own?

drowsy helm
#

oh, without needing to depend on eachother. Not really

#

you can have a common lib tho

mortal vortex
#

There is no way to like send a signal to another plugin?

#

What im saying is like, have something optional happen in Plugin B, when A sends a signal.

#

thought Bukkit had something like "Channels"

sly topaz
#

you can use the service loader, if anything, but that still depends on there being a common interface as "protocol"

mortal vortex
#

ah okay, so no way to globally beam a signal across the server, and something picks it up?

sly topaz
#

I mean, there's nothing specifically in Spigot for it, but you can just use standard communication protocols like unix sockets, a file with a specific format, pretty much anything really

mortal vortex
sly topaz
#

yes

mortal vortex
#

noice

sly topaz
#

no syntax highlighting in those codeblocks is painful

mortal vortex
#

ahh thank youso much

buoyant viper
mortal vortex
buoyant viper
#

plugin messaging channels?

#

idk

mortal vortex
#

yeah thats what i thought

#

i swore bukkit had that

buoyant viper
#

...

#

they are a bukkit thing

sly topaz
#

I was going to suggest that too, but figured if they want to do plugin-to-plugin communication then the requirement of a player being online might be a limitation they don't want to deal with

#

should've mentioned them still, my bad

mortal vortex
#

Nah I dont want that

#

so props for not bringing it up

sly topaz
#

it's usually not much of an issue since most data is transferred when players are online anyway but it is kind of annoying

sullen marlin
mortal vortex
#

Thanks Legends

potent root
#

could someone help with the addon for crafting and additions? I'm just bad at java and don't understand how to connect electricity to my mod

rotund ravine
#

Huh

#

Like a forge modv

#

Or fabric mod?

potent root
#

forge

rotund ravine
#

Go to their discord then

potent root
#

To craft and additions dis?

rotund ravine
#

Maybe, might be useful since u’d need to hook into their api

potent root
#

I just don't care at all in all places where it can help me in theories to write

tribal wraith
#

I'm using path finding

to make an entity walk to a location, I want them to face backwards while doing it but setting the rotation slows them down drastically and they try to rotate back to their original position walking there - could anyone point me in the right direction for this ?

sly topaz
#

if it is a custom mob, you'd just have to do it in your custom mob class, but if it is a vanilla mob, then you'll have to use some reflection to replace it on the spawned instance

tribal wraith
#

I'm using a custom mob class; how would I override it? I did this:

I don't know what the numbers mean but it doesn't do anything

Also tried this

sly topaz
#

if you have a custom mob, you just have to override getLookControl method and create a custom LookBackwardsControl class or whatever

#

then in the getLookControl if some variable like walkBackwards is set, return LookBackwardsControl, otherwise return the default LookControl instance

#

ideally walkBackwards would actually be something handled at the MoveControl, but overriding one control is already a hassle, so do it in the way you find the most convenient

sly topaz