#help-development

1 messages · Page 39 of 1

carmine nacelle
#

Idk why its being a hoe

worldly ingot
#

EntityBee bee = ((CraftBee) bee).getHandle();

#

TagCompound nbt = bee.getOrCreateTag()

#

(or something similar to that. Again, this depends on the mappings you're using)

carmine nacelle
#

Using mojang maps

worldly ingot
#

So instead of EntityBee it's probably just Bee

carmine nacelle
#
    public String getBeeUUIDFromNBT(Entity bee) {
        EntityBee beeEntity = ((CraftBee)bee).getHandle();

        if(beeEntity.gett)
    }

Its telling me to change EntityBee to just Bee

worldly ingot
#

Yeah, Mojang's mappings don't prefix entities with Entity

#

It's just Bee

#

EntityBee is a CraftBukkit mapping

carmine nacelle
worldly ingot
#

Might just be getTag()

carmine nacelle
#

nope lol thats getTags and returns a map of strings

worldly ingot
carmine nacelle
#

i hate nms

echo basalt
#

seems like mobs dont store nbt on 1.19

#

they just serialize their internal data to an nbt tag on demand

near night
#

pls help it works on my main pc btw

echo basalt
carmine nacelle
#

Bruh..

worldly ingot
#

Yeah it's just got save/load methods

echo basalt
#

I already told you to override saveWithoutId and add your custom tags

carmine nacelle
echo basalt
#

hm

carmine nacelle
#

thats fine now

echo basalt
#

you're trying to load now?

carmine nacelle
#

this is where I need to check if it should be custom when it spawns

#

yup

#

So basically...

#
    @Override
    public void load(CompoundTag nbt) {
        super.load(nbt);

        String beeUUID = nbt.getString("bee-uuid");

        this.originalBeeUUID = UUID.fromString(beeUUID);
    }
#

I need to get this value but outside of CustomBee

#

because its not yet a CustomBee

echo basalt
#

uhhhhhh

#

you could

carmine nacelle
#

Where do you have that at?

echo basalt
#

register your custom entity type

carmine nacelle
#

I am

echo basalt
carmine nacelle
#

Oh its core

#
    public static void registerCustomBee() {
        String typeName = "custom_bee";
        EntityType.Builder<Entity> builder = EntityType.Builder.of(CustomBee::new, MobCategory.CREATURE)
                .sized(0.7F, 0.6F)
                .clientTrackingRange(8);
        Registry.register(Registry.ENTITY_TYPE, typeName, builder.build(typeName));
    }
echo basalt
#

but honestly I'd just do fancy stuff like EntitiesLoadEvent and CreatureSpawnEvent

carmine nacelle
#

im registering this onLoad

echo basalt
#

uhhhh

#

okay

near night
#

i have know idea why this is happening and cant test why my main pc is getting fixed

carmine nacelle
#

this is so weird mannn.. any other ideas?

terse panther
#

quick question, If I set to the main hand an item to a mob when it spawn, when the people kill the mob always will drop the item?

karmic sorrel
#

hey i'm using SpiGUI and i need to know how to ask the player a question in chat after clicking a button (e.g. click Rename and then you type the name in chat)

carmine nacelle
karmic sorrel
#

wha

#

im kinda new to java please explain

#

ik what a hashmap is

#

but i dont understand how that helps accompolish this task

buoyant viper
#

?learnjava

undone axleBOT
carmine nacelle
#

well its probably a "bad solution" according to everyone else here even though its async (thread safe) and works well

ornate patio
#

How can I send a fake invisible, invulnerable, marker, named armor stand to a player either with nms or protocollib

near night
#

bump

karmic sorrel
buoyant viper
#

oh im just annoying on purpose

carmine nacelle
#

do u know what hashmaps are @karmic sorrel

buoyant viper
carmine nacelle
#

oh

karmic sorrel
#

no im just annoyed because i was told by multible people "theres no point going to spigotmc discord they will just tell u to learn java and not actually help" and i was like yeah nah thats not gunna happen right

carmine nacelle
#

nah it 100% does

buoyant viper
#

i actually misread it at first and thought it said "idk what hashmaps are" tbh

karmic sorrel
#

no but how is learning the entirety of java when i already know enough to get by and make this project going to help with asking a question on gui click?

#

i genuinely dont understand that

buoyant viper
#

don worry abt it

#

n e ways

#

they said to use a hashmap so that u can add them (the player) to some sort of registry and listen to their chat events id imagine

karmic sorrel
#

ah ic

#

well i made the hashmap with a bukkitrunnable

buoyant viper
#

id say use a Set but a Map would probably work better for a timed event

karmic sorrel
#

idk how the fuck to make a bukkitrunnable cause i havent made a runnable in forever but

karmic sorrel
carmine nacelle
#

you definitely wanna give them a time limit

#

otherwise it will run indefinitely

karmic sorrel
#

do i just make a class that implements bukkitrunnable?

buoyant viper
#

a bukkit runnable + just a Set would probably work pretty well

buoyant viper
#

just yourPlugin.getServer().getScheduler().runTask()

karmic sorrel
#

ah ic ok

carmine nacelle
#

heres something i use

#

i know it could be better

#

made this a while ago

karmic sorrel
#

ah ic okok

#

uuh

carmine nacelle
#

I have a private HashMap<UUID, BukkitTask> playerNamingBeeTask;

karmic sorrel
#

so in my click listener i make the bukkit scheduler run the task

buoyant viper
carmine nacelle
#

I mean I definitely could if I made another map with the countdown time

buoyant viper
#

could track that with a map or a custom playerdata object

carmine nacelle
#

or a custom object

#

yeah

#

Just working on making it work before making it sexy

buoyant viper
#

xd

#

ye

buoyant viper
carmine nacelle
#

Then if you wanna cancel it, just call cancel()

karmic sorrel
#

ye icic from the this.cancel call

carmine nacelle
karmic sorrel
#

just editing it rn

#

how do i get a player from HumanEntity?

#

looking rn and i cant figure it out

carmine nacelle
#

why do you want humanentity

karmic sorrel
#

no i dont want a humanentity

carmine nacelle
#

then just use Player

karmic sorrel
#

and its what event.getWhoClicked returns

karmic sorrel
carmine nacelle
#

oh

karmic sorrel
#

ye

carmine nacelle
#

if event.getWhoClicked() instanceof Player

#

then cast to player

karmic sorrel
#

ah okok

karmic sorrel
#

i dont see why they dont just return player but

carmine nacelle
#

Yeah idk

karmic sorrel
#

bruh i dont understand how to start the bukkitrunnable from ur code

#

can i just cast it? idk

#

cause ur code makes a new bukkittask from a bukkitrunnable

#

and to add to scheduler i need a bukkitrunnable

#

and im assuming i can just cast it but idk

carmine nacelle
#

BukkitTask namingHiveTask = new BukkitRunnable(){
Creates it

#

}.runTaskTimer(this.cadiaBees, 0L, 20L); runs it every tick

karmic sorrel
#

yes no i see that

#

0.0

#

so i just need to run the method

#

thats why it was void lmao

carmine nacelle
#

sry not tick, second

#

20 ticks = 1 sec

#

ye

karmic sorrel
#

i feel dumb now lmao sorry

carmine nacelle
karmic sorrel
#

tyty

#

ew 1.19.1

carmine nacelle
#

yeahhh

atomic violet
#

ive got this working if stone is in every slot, but i want it to run if theres nothing in those slots, and checking for air in those slots didnt work

karmic sorrel
#

i mean should be same in most versions but yeh

carmine nacelle
#

It is

atomic violet
carmine nacelle
#

== null or type = air

atomic violet
carmine nacelle
#
        if (event.getCurrentItem() == null || !event.getCurrentItem().hasItemMeta() || !event.getCurrentItem().getItemMeta().hasDisplayName()) {
            return;
        }
ornate patio
#

But air

atomic violet
#

i tried replacing stone with air and it didnt work

karmic sorrel
#

hey can i make an event in a bukkittask?

ornate patio
#

And then you would use itemStack.getType().isAir() to check if it air

carmine nacelle
#

if it is, return the bukkittask and cancel it or whatever

atomic violet
#

no i mean making it Material.AIR instead of Material.STONE but it said it was null so it didnt run the event

#

so im trying null

ornate patio
#

alright

#

again I’m not 100% sure tho

atomic violet
#

im probably doing this in a very inefficient way but im inexperienced and it was the only way i found that worked, but yeah im doing if (c1.getType() == null) for every chest slot, and in the server console, it says it couldnt pass the event cause "c1 is null"

#

but im checking for that

#

so idk why its not passing the event

carmine nacelle
#

what is c1

atomic violet
#

chest slot 1

carmine nacelle
#

the type wont be null

#

the item itself would be

atomic violet
#

it works when i replace "null" with Material.STONE

#

oh

#

so then how do i check if the slot is empty

#

actually

carmine nacelle
#

if c1 == null

atomic violet
#

ItemStack c1 = e.getInventory().getItem(0);

#

thats what im doing for every slot

#

0-26 for all 27 slots

#

with c1-c27

carmine nacelle
#

yep

#

if c1 == null

atomic violet
#

not in ()?

#

or "if (c1 == null)"

carmine nacelle
#

well yea but im not gonna type the WHOLE thing in the middle of a game of valorant lol

atomic violet
#

lmao makes sense, thanks

vocal cloud
#

It's called pseudo code lmfao

carmine nacelle
#

mikeeee

#

do u know nbt stuff

#

in 1.19

atomic violet
#

now its just passing the event regardless of whether theres items in the chest or not

carmine nacelle
#

we need a chunk of code not just 1 line

atomic violet
#

alr ill send my whole event handler

carmine nacelle
#

?paste

undone axleBOT
vocal cloud
carmine nacelle
#

Well sadly it doesnt work in this use case

#

sooo i have no choice

vocal cloud
#

Which use-case

carmine nacelle
#

Bee exits hive and spawns an entirely different entity

#

only caries nbt

atomic violet
vocal cloud
#

This again lol

carmine nacelle
#

this still

atomic violet
#

be prepared, its probs very bad

vocal cloud
#

What the hell

#

Is that

atomic violet
#

i told you :/

vocal cloud
#

@quaint mantle Are you capable of pinning things?

carmine nacelle
#

holy fuck...

vocal cloud
#

I want that masterpiece on my wall

karmic sorrel
carmine nacelle
#
                for(int i = 0; i < inventory.getContents().size(); i++) {
                    
                }
vocal cloud
karmic sorrel
#

0.0 nvm for other dude sorry lmao

quaint mantle
#

What happened

carmine nacelle
quaint mantle
vocal cloud
atomic violet
#

lmao i just realized that i have two of the location stuff running

atomic violet
#

ill delete the second one, and ill also look into for loops

quaint mantle
#

No its a while loop

carmine nacelle
#

👀

atomic violet
#

lmao ill take that as a yes

river oracle
#

just copy and paste sometimes its actually faster than looping if you copy and paste fast enough

vocal cloud
#

Honestly, I think most people have been through the pre-for-loop phase of coding. Honestly that nested if is some dedication

atomic violet
#

XD i mean it works if i am checking for an item that isnt air

#

just not air for some reason, but ill look into loops

vocal cloud
#

It's another work of art added to my collection

quaint mantle
#

Rate the pfp

karmic sorrel
#

best

karmic sorrel
#

lmao imagine not allowing users to embed

carmine nacelle
#

@quaint mantle do you know nbt stuff lol

river oracle
quaint mantle
#

imagine not being verified

quaint mantle
river oracle
#

god thank you

karmic sorrel
#

imagine knowing how spigot works

river oracle
#

I'm glad your back

river oracle
karmic sorrel
#

nah

#

imagine knowing how it works ngl

wise mesa
#

so with special source am I supposed to use the -remapped-obf.jar or -remapped.jar

eternal oxide
#

neither really, you should be using maven

carmine nacelle
eternal oxide
#

I know

carmine nacelle
#

if only 7smile7 or imillusion were on...

eternal oxide
#

I just told him, he should use neither jar, he should use maven to manage the dependencies.

atomic violet
atomic violet
#

alr thats a lot simpler

carmine nacelle
#

if(inventory.get(i) == null

atomic violet
#

jesus if only i knew 💀

carmine nacelle
#

lol

carmine nacelle
#

Bruh what the fuck

#

it stays in the hive for 2 minutes btw

#

my guy

#

deadass it was not working

vocal cloud
#

Deadass you're doing it wrong™️

carmine nacelle
vocal cloud
#

That really shouldn't matter lmfao

carmine nacelle
vocal cloud
#

You're doing something wrong then™️

carmine nacelle
#

Pretty hard to fuck this up so something aint working like its supposed to.

boreal seal
#

what i done wrong here?

carmine nacelle
#

it has the key when it enters.

#

when it exits, nothing.

boreal seal
#

each time i call an hashmap it causes an nullerror

sharp flare
#

Bro the hashmap is uninitialized

#

Are you using inner classes there?

boreal seal
#

what do you mean by inner?

carmine nacelle
#

Thats my entity spawning.

lost matrix
boreal seal
#

i send the whole code

#

i already got the answer too

boreal seal
sharp flare
#

You deleted it, though others can still help you correcting the code u sent

boreal seal
#

nah

sharp flare
#

They are not well done

boreal seal
#

= new map..

sharp flare
#

Public instance variables, etc

boreal seal
#
    }
    public HashMap<Player, Integer> Users = new HashMap<>();

    public HashMap<Player, Double> X = new HashMap<>();

    public HashMap<Player, Double> Y = new HashMap<>();
#

it would be enough i think

carmine nacelle
#

dont

#

put

#

players

boreal seal
#

i forgot about doing it

carmine nacelle
#

in

#

hashmaps

boreal seal
#

so how should i do it?

carmine nacelle
#

uuid

boreal seal
#

what uuid?

carmine nacelle
#

player uuid

boreal seal
#

i just use player object

sharp flare
#

Player object changes every rejoin wanna use a uuid

carmine nacelle
#

im aware

boreal seal
#

the player is removed from maps once he leave

#

its not a data storage

#

its just sending the player how many blocks he passed in a second

sharp flare
#

You will face issues still

boreal seal
#

what kind of issues i remove him on every event

#

he leaves and kicks

#

no data leaks

sharp flare
#

Oh boi

lost matrix
compact haven
#

the whole reason memory leaks happen is because you didn't account for something in your code

#

you can't say there's no data leaks just because you remove them from the map in 2 situations, that's not how that works

boreal seal
#

i either loop

#

if the are online if not

#

ill add them to list and remove them from maps manually.

compact haven
#

🐳

boreal seal
#

sounds fine?

compact haven
#

it's just practice to use UUID

sharp flare
#

His choice though, if he prefers bad practice so be it

vocal cloud
carmine nacelle
#

        pdcManager.setBeeUUID(customBee.getBukkitEntity(), bee.getUniqueId());
        Bukkit.broadcastMessage("UUID set to: " + pdcManager.getBeeUUID(customBee.getBukkitEntity()));
#

This is my check after setting

#

it works at this point

#

It also works when it enters

#

Its the CustomBee/nms stuff causing the issue.

#

This is with a bee spawned through a spawn egg

#

then I hit it and set the value and got it when it exited (works)

vocal cloud
#

Send the custom bee class

carmine nacelle
#

?paste

undone axleBOT
carmine nacelle
placid fog
#
        at me.blenkc.farmingplugin.Hoe.OnTill(Hoe.java:27) ~[FarmingPlugin-1.0-SNAPSHOT.jar:?]
```how do  i get rid of this error
vocal cloud
carmine nacelle
#

1.19.1

#

Using mojang mappings

vocal cloud
#

Ugh

lost matrix
carmine nacelle
#

ily mike

#

❤️

river oracle
rain mason
#

i doubt you can, but is there a way to play an audio from an URL?

lost matrix
rain mason
placid fog
#

bruh i still don't get it though im getting this error when im holding something

lost matrix
lost matrix
rain mason
placid fog
#

is this right?

lost matrix
carmine nacelle
#

hoping mike is trying to figure out my entity issue

vocal cloud
#

Yeah, I've got to setup NMS with mojmaps

carmine nacelle
#

ppreciate it

lost matrix
vocal cloud
#

I had some weird asf error.

#

I'm working on a plugin to handle this stuff for gradle but this is killing me ngl

carmine nacelle
#

@vocal cloud need my pom?

vocal cloud
#

Not a pom issue, it's a maven issue

carmine nacelle
#

ah

#

@vocal cloud its 2:23 am i gotta be up for work at 7, i gotta get to bed :/ I appreciate the help and looking into this I hope we can figure it out. If you manage to figure it out, feel free to msg me ill respond when im able to get to it

ornate patio
#

Nms entitys' setCustomName take in a Component argument

#

anyone know how to get an instance of one of these? (a Component)

torn shuttle
#

quick q if I have a location with a pitch and yaw and I want to set the direction to be "looking" towards the pitch and yaw I set is there a quick api way of doing that or am I stuck doing fun math

lost matrix
torn shuttle
#

yeah but I don't have a vector

#

just a pitch and yaw

lost matrix
torn shuttle
#

ok but I need to set the direction

#

setting the pitch and yaw doesn't do that

lost matrix
#

then Location#setDirection(Vector)

torn shuttle
#

ok so the answer is no then

lost matrix
#

The answer is yes

#

If you want to set a direction then you call setDirection and
if you want to set pitch/yaw then you call setPitch/Yaw

#

All of them change the effective direction of the location

torn shuttle
#

setting pitch and yaw doesn't modify #getDirection() which is my issue, guess I'll just go do some math then

lost matrix
carmine nacelle
#

Pitch and yaw will do the same thing.

#

Pitch is up and down yaw is left right

torn shuttle
#

I am generating a location from text, for which I have everything but the direction vector. Setting the pitch and yaw doesn't seem to have affected the #getDIrection vector you get from the location

lost matrix
#

Im guessing that you forgot to reapply the Location to your origin because you are always dealing with copies of Location

rain mason
#

how to create a villager trading inventory? InventoryType.VILLAGER or something like that doesnt exist

untold stirrup
#

spigot software support resource pack on bedrock ?

untold stirrup
#
  • there plugin can be multiprotocoles ?
untold stirrup
rain mason
#

yeah join their discord server

#

they have a faq for bedrock resourcepacks

untold stirrup
rain mason
quaint mantle
#
PlayerInteractEvent - check if player clicked a left click
if (customitem != iteminhand) {
return;
} else {
//code
you will need get player direction vector
after wards you calculate the location you get from the vector.
List<Entity> nearbyEntities = (List<Entity>) you get nearby entites using World.getnearbyentites(location,location.location0)
Now you loop the list
and check if entity == enderman {
using Velocity you would throw them towards the location
you used to calculate the radius from.
} else {
goodevent.add(location,int)...
make another method to loop thru every 20 ticks
if it contains a value just make the cylinder of armorstands
appear using a cylinder (loop a cylinder you can be creative here.)
so if int = 10 > spawn...```
#

what da fluff

rain mason
#

what's that supposed to be

quaint mantle
#

some guy said this helps to make gryo wand

rain mason
#

that's not how java works

#

they just explained how to do it

#

not spoonfed you the code

quaint mantle
#

OH

#

lol

ornate patio
#

I've been at this problem for so long, this is my fourth day

#

I'm so close

#

I'm trying to make custom titles above player heads

#

My strategy right now is constantly teleporting named invisible armor stands above a player

#

They're not real armor stands, but fake client side ones sent using packets

#

And I've got everything working, so that the armor stand "spawns" in, "teleports", and gets "removed" correctly (I use quotation marks because the armor stands don't exist, I'm just sending packets to players)

#

The only issue that remains

#

is that the armor stand's data does not show correctly on the client

#

here's what I mean

#

this is what I'm using to create the armor stand

ServerLevel serverLevel = ((CraftWorld) player.getWorld()).getHandle();
armorStand = new ArmorStand(EntityType.ARMOR_STAND, serverLevel);

Location playerLocation = player.getLocation();
armorStand.setPos(playerLocation.getX(), playerLocation.getY() + ARMOR_STAND_Y_OFFSET, playerLocation.getZ());
armorStand.setCustomNameVisible(true);
armorStand.setNoGravity(true);
armorStand.setInvisible(true);
armorStand.setInvulnerable(true);
armorStand.setMarker(true);

for (Player otherPlayer : Bukkit.getOnlinePlayers()) {
    if (player == otherPlayer) {
        continue;
    }

    sendSpawnArmorStandPacket(otherPlayer, armorStand);
}
#

the armor stand shows up on the client, but it's just a default armor stand (not invisible, no custom name, etc)

#

anyone know why this is the case?

#

btw here is sendSpawnArmorStandPacket

private void sendSpawnArmorStandPacket(Player player, ArmorStand armorStand) {
    ((CraftPlayer) player).getHandle().connection.send(
        new ClientboundAddMobPacket(armorStand)
    );
}
drowsy helm
ornate patio
#

I literally just figured that out as you sent that lmao

drowsy helm
#

not sure what the remapped name is though

ornate patio
#

all I did was add this code to my sendSpawnArmorStandPacket and now it almost works

#
((CraftPlayer) player).getHandle().connection.send(
    new ClientboundSetEntityDataPacket(armorStand.getId(), armorStand.getEntityData(), false)
);
#

just a few more issues I have to fix and hopefully it'll all work

#

YES

#

I GOT IT

#

its finally done

#

holy crap

#

nms is such a pain in the ass

floral pier
#

JPLISAgent.c?

lost matrix
#

What the heck is this error?
Are you doing anything static in NMSTransformer?

floral pier
#

Are you making use of the Java Native Interface..?

#

I have no idea why I never thought of that. It's working?

#

If that's the case someone should make a C/C++ wrapper for Java Edition so then people could write their plugin in C and run it on both Bedrock and JE

lost matrix
floral pier
#

Wait what

lost matrix
#

Exactly

drowsy helm
#

php??

lost matrix
#

Make sure you dont shade in the library you are using.

drowsy helm
#

is that the native minecraft server or some bukkit equivalent in bedrock?

floral pier
#

It's Java Edition with native code. I can't help him :|

#

But Bedrock uses JavaScript for some reason :/

#

Whose idea was that

lost matrix
#

Show the dependencies section

#

asm

floral pier
#

Yeah, you could modify the source

obsidian drift
#

Is there an event for grass spreading?

lost matrix
floral pier
#

I don't think assembly will help with that

lost matrix
#

It think the latter

floral pier
#

Cus you still won't be able to act on the address space of a private object.

#

And with ASM it's really difficult to act on a separate memory segment anyway

#

Maybe hook a .so from your plugin and in the Spigot source and write a wrapper for what you're trying to do in the shared object

#

Cus I have a feeling that if you try changing things from private to public in spigot source you will break the API

shadow zinc
#

How can I manually put my rep inside my .m2 folder?

drowsy helm
#

you mean dependency

#

or the entire repo?

shadow zinc
#

dep

drowsy helm
#

theres a command for it

#

gimmie a sec

#
mvn install:install-file \
   -Dfile=<path-to-file> \
   -DgroupId=<group-id> \
   -DartifactId=<artifact-id> \
   -Dversion=<version> \
   -Dpackaging=<packaging> \
   -DgeneratePom=true```
shadow zinc
#

and dfile is jar?

real blaze
#

say I wanted to make a skeleton 20 fire an arrows in succession from something like 50m away every 5 seconds, are these attributes actually modifiable to make such a custom mob, or do I have to do some odd stuff with scheduling and spawning projectiles

supple elk
#

Does anyone know a way to stop a player from being able to drive a boat using the VehicleMoveEvent?

#

I've been stuck on trying to do this for over a day

#

I have created something unholy

rain mason
#

how would I make a custom villager trading inventory? this is how I did it by spawning an actual villager and editing it's Offers.Recipes NBT data, but how would I do this in spigot?

sharp flare
#

any reason why this mutates the given list of blocks in constructor of the event, when doing a blockExplodeEvent.blockList() call, it returns a different list

#

the docs for the event doesn't help neither

delicate fossil
#

is there a way to make custom crafting recipes from items with nbt? i know that this is not possible wth datapacks so i was wondering if i can use plugins for that

real blaze
sharp flare
#

lemme get my logs..

echo basalt
#

And other plugins can mess with it without cancelling the event

echo basalt
#

Easiest route

sharp flare
#

the original one is the blocks filtered at the top

#

Which i was expecting

echo basalt
#

I'd look at any internals messing with the blocklist tbh

#

But I'm not getting out of bed for that

sharp flare
#

what kind of internals

real blaze
echo basalt
hybrid spoke
echo basalt
#

I just run paperweight and middle-click stuff

hybrid spoke
#

find the path->let the mob move along the path

echo basalt
#

You're killing 90% of the use-case scenarios if you don't make a mob impl

hybrid spoke
#

not really

echo basalt
#

But then again nms will be a pain

#

Specially pre-1.17

hybrid spoke
#

what about GPSs, custom armostand mobs, pathfind to your base, quest systems whatever

real blaze
#

tbh i kinda just wanna make silly bosses out of vanilla mobs

echo basalt
#

Are you able to specify a path width within the api?

hybrid spoke
#

wdym by path width

#

like the max. distance?

echo basalt
#

No like

#

Custom armorstand mobs are usually wider than 1 block

hybrid spoke
#

for that you can make a custom strategy

real blaze
#

uh so, custom mobs?

echo basalt
#

Use nms

hybrid spoke
#

you can modify the pathfinders behaviour by passing in a custom strategy

echo basalt
#

Abstracting custom entities with bukkit schedulers is a very ghetto workaround

dense pine
#

How would i verify votes by a user if i got a nickname and voteDate in yyyy-mm-ddThh:mm:ss+hh:mm
Rn im trying to do something like get today date, vote date and somehow compare them but im not sure how to

echo basalt
real blaze
dense pine
echo basalt
#

It has potential but you need to account for common use-case scenario

echo basalt
hybrid spoke
#

everything else is/will be granted

echo basalt
#

Bukkit's principals are to not expose nms internals or implementation details like pathfinders and direct nbt

echo basalt
#

Do we also need to make a custom strategy for mobs that are 2 blocks tall?

hybrid spoke
#

also a "playerstrategy" is planned including jumps etc.

echo basalt
#

We'd need to modify burch's code to support any height and width then

#

Slimes, for example, would struggle

hybrid spoke
#

most likely, yeah. we cant take every user specific usecase into account. we just provide the baseline which can be expanded if needed

#

and with a custom strategy you can hook into the pathfinder behaviour pretty easily

torn sedge
#

Hello, I have a question but not at all for me, I am in contact with a Dev who makes a Wands plugin, he was able to make wands with shots and particles from ghasts, withers, etc. but he hasn't found any information for the moment to make one with the Warden "Sonic attack", does anyone know where he could have the information on this attack and be able to make a wand with it. Thanks

obsidian drift
#

How can I disable PlayerInteractEvent but also let players be able to shoot bows?

real blaze
obsidian drift
#

But then they can interact with blocks while holding a bow even if they arent shooting

real blaze
#

ah right

echo basalt
real blaze
echo basalt
#

It acts on a similar way to guardians

obsidian drift
#

Then they can't shoot while looking at a block

echo basalt
#

You'd need an invisible warden and an invisible target

real blaze
azure island
#

idk why thats not working, im getting message CraftZombie but effect not working can someone help?

tardy delta
#

Nope

eternal night
#

using the lore to identify items 🙏

azure island
noble lantern
hybrid spoke
#

customname and lore ftw.

eternal night
#

🙏🙏 obviously

hybrid spoke
eternal night
#

🙏

#

It's literally called pray tho

azure island
#

im just dumb i was testing poison on zombie...

eternal night
#

🤔

#

Oh lol

hybrid spoke
#

check it on whatsapp etc.

mental nymph
#

how to get server ip and port on bungeecord when getAddress() is deprecated?

karmic mural
#

I'm trying to access and modify itemmeta of an item but when I try to do so it doesn't work. IntelliJ just doesn't recognize it when I write "meta.setDisplayName" for example.


    ItemMeta meta = item.getItemMeta();``` Am I just missing something?
karmic mural
cunning canopy
#
public void setCageBlocks(Location spawnLocation, Material material) {

        Location block = spawnLocation.clone();

        // Floor
        block.add(0, -1, 0).getBlock().setType(material);

        // Wall 1
        block.add(1, 0, 0).getBlock().setType(material);
        block.add(1, 1, 0).getBlock().setType(material);

        // Wall 2
        block.add(-1, 0, 0).getBlock().setType(material);
        block.add(-1, 1, 0).getBlock().setType(material);

        // Wall 3
        block.add(0, 0, 1).getBlock().setType(material);
        block.add(0, 1, 1).getBlock().setType(material);

        // Wall 4
        block.add(0, 0, -1).getBlock().setType(Material.AIR);
        block.add(0, 1, -1).getBlock().setType(Material.AIR);

        // Top
        block.add(0, 2, 0).getBlock().setType(Material.AIR);
    }
``` this is supposed to create a cage 2 blocks high from the input coordinate instead I get this
dense pine
#

Yo i have a problem and dont know how should i approach it.
Im trying to reward player for voting.
What i can do is make a request and get an Array with list of players and VoteDates
How can i verify votes to make sure people who voted get rewards once per day?

What i tried:

  1. A task every 30 seconds which checks if size of array changed and rewards the newest vote
  • WHY IT DIDNT WORK: After a month votes are removed from website so it would trigger falsely
  1. A command which gets the list of votes and filters only votes newere than 3 hours and then from that list checks if player voted. Then it saves to HashMap that player voted and rewards him.
  • WHY IT DIDNT WORK: After a server restart players can reclaim their rewards

I literally took out a pen and paper to try and figure out a way to verify votes but didnt come up with anything so i count on you guys to have some simple solution i didnt consider/fix one of my solutions or there is a simpler way..

terse raven
karmic mural
karmic mural
terse raven
hybrid spoke
#

you never clone it

eternal oxide
dense pine
#

Would yml do the trick?

eternal oxide
#

yes

cunning canopy
dense pine
#

and what would i save to the file? A player name and date?

eternal oxide
#

yes

#

player UUID

#

not name, names can change

cunning canopy
hybrid spoke
eternal oxide
#

clone copies the location

hybrid spoke
#

its like counting up and wondering why its already 3 and didnt stayed 1

eternal oxide
#

Location#clone().add(...

dense pine
#

i think player names are enough because the website gives names of players and it would make everything simpler

eternal oxide
#

it will break if you use names

dense pine
#

hm?

eternal oxide
#

players can change name at a whim

#

instantly theyare not the one thats in your database

cunning canopy
#

Why would a player teleport not be successful?

terse raven
dense pine
#

A json array with objects
[{"nickname":"Allowsik","createdAt":"2022-08-05T10:46:30+02:00"},{"nickname":"NORBIX","createdAt":"2022-07-26T11:05:03+02:00"}]

eternal oxide
#

store the name if you need it for the website, but store teh UUID as the main key for checking who is who

#

name is just a visual thing

dense pine
#

unfortunately the website doesnt have its own plugin for vote rewards nor API and it only provides an endpoint with json so it complicates things

terse raven
#

yea then just use mojang api or some function that spigot has built in (i think?) to convert the usernames to uuid and save it together with the createdAt

eternal oxide
#

it shoudl never be used to confirm who someone is

terse raven
#

you can just delete the entry once the time period is over

eternal oxide
#

do teh players not vote in game?

#

I assumed the website was just a visual display of the data

dense pine
#

no, they vote on a website

#

im making a custom votifier for this website

eternal oxide
#

how do you ensure a player is who they claim to be?

terse raven
#

you cant harm anyone by voting

dense pine
#

on website they input their name while voting, you can write anything you want there

eternal oxide
#

It sounds like anyone can jump on and cast a vote under any name

dense pine
#

yup

#

but then they cant get reward themselves

terse raven
eternal oxide
#

so player "fred" jumps on and votes under the name "tod". Tod can no longer vote as fred faked his vote

dense pine
#

Yes but Tod gets the rewards then

#

and fred doesnt

#

here is website if you want to look at it

eternal oxide
#

ah I see. its nothing meaningful in teh vote. its a server vote not voting for an outcome

dense pine
#

yeah the votes promote the server on server list so we show up higher

#

main source of new player if you dont advertise

#

so existing players get rewarded for "bumping" the server on the list so we get more players

eternal oxide
#

ah I was thinking it was something like voting for changes or elections kinda thing. Some thign you would need to validate who was who

dense pine
#

i might have not precised it enough hah

eternal oxide
#

In that case, name will do 😉

#

I was way over thinking it

cunning canopy
#

Why would a player teleport fail?

eternal oxide
#

null Location

cunning canopy
#

thanks

dense pine
#

im thinking of using the task every x seconds

#

so players dont have to type command to get reward and they get it automatically

#

but

eternal oxide
#

I'd do it at teh most every minute. no need for shorter really

dense pine
#

would it have impact on performance?

eternal oxide
#

unless you do it async, it could

#

you are accessing data in file/website

#

fetch the data async, then process yoru rewards sync

#

a CompleteableFuture

karmic mural
#

I am using the plugin for IntelliJ that sets up a new plugin for me, so I can just get started coding. But for some reason when I try to access Itemmeta and modify it, it just doesn't recognize it.

Like I'll start to type meta.setDisplayName but nothing pops up, it's just red.

    ItemMeta meta = item.getItemMeta();```
#

So is there anything I can do in terms of troubleshooting here to figure out the cause? Because I have another plugin I have created and I'm literally doing the exact same thing, except here it doesn't work and there it does work

dense pine
#

send the class

quaint mantle
#

worldedit how can I set a size larger than 6-7?

dense pine
#

or a screenshot

dense pine
quaint mantle
terse raven
karmic mural
karmic mural
cunning canopy
#

setting passenger with spacing?

hasty obsidian
#

does anyone know how to give a player hearts

chrome beacon
#

Increase the max health attribute

hasty obsidian
#

how do I set attributes to a player?

cunning canopy
#

any way to punch through a mob

#

like

#

lets say there is a slime

#

and an entity on the other side

#

can you implement a way to get the punch to pass through the slime

glossy venture
#

raycast

dense pine
glossy venture
#

i guess

glossy venture
#

and probably call some nms method to simulate as if you hit the entity behind

#

and cancel original event

pine lake
#

Is it able to save an ItemStack into a json? (String?)

hasty obsidian
#

anyone know how to takeaway a heart when player dies

sacred mountain
#

hey whats the best/most efficient way to loop with a delay?

#

im thinking a runnable but im not sure how to do it if i only want it done a few times

#

should i put a runtasklater in the for loop or should i make a counter and use a schedulesyncrepeating

echo basalt
#

you run the loop for a couple times then cancel it

echo basalt
sacred mountain
#

soo i can use a counter and cancel when that counter reaches a number

echo basalt
#

yeah

sacred mountain
#

aight thanks

rare flicker
#

I'm playing around with armorstands to try and make a flying sword, problem i'm currently having is aligning the sword to the player's direction. so i have two problems :
How do I convert pitch and yaw to an EulerAngle ?
How can i offset a location relative to a player's vision (eg : convert 1 block to the left of the player's camera to an actual usable xyz offset, similar to converting ^ ^ ^ symbols to ~ ~ ~)

obsidian drift
#

Does anyone know how to make an entity walk from A to B using NMS?

vivid skiff
#

How can i make detect a player who right click another player with a stick with a specif name and lore?

opal sluice
rare flicker
rare flicker
opal sluice
rare flicker
#

why

#

didnt i think of that

#

oh i remember why

opal sluice
#

because it involves math? xD

rare flicker
#

how do i handle the case where the player is looking straight up or down

vivid skiff
#

I tried but it isn't working, i don't know what i make wrong

rare flicker
rare flicker
vivid skiff
#

It is

rare flicker
#

mind sharing the listener ?

opal sluice
vivid skiff
opal sluice
#

it's just that you have to make your rotation in a 3D space instead of a 2D space

rare flicker
#

from my experience i would get a NaN vector

#

since i'm rotating around the UP vector (0,1,0)

opal sluice
#

change the vector you're rotating against or use math to change the formula for each direction you want based on the starting vector

sacred mountain
#

rotation matrix

eternal night
#

in only the spigot vector api had helper methods for all of this

sacred mountain
#

if you're moving an object with points through 3d space use a matrix

eternal night
real blaze
#

quick question, if I wanted to remove 64 of an item from an inventory regardless of slot, which inventory method is best used?

sacred mountain
#

multiplying them is as easy as 3 loops

rare flicker
eternal night
#

but yea before you implement your own rotation matrix, see the four or five methods on the spigot vector

sacred mountain
eternal night
#

for rotation

rare flicker
#

it should be e.getPlayer().getItemInMainHand().getType().equals(Material.STICK)

opal sluice
rare flicker
rare flicker
rare flicker
#

not sure if its the correct answer though

real blaze
opal sluice
#

you can find a lot of videos that explain how to use that matrix and understand the math behind it ^^

rare flicker
rare flicker
#

oh but wait

#

i just understood one thing

#

there isnt any way to get the player relative UP vector is there?

real blaze
opal sluice
rare flicker
#

yaw and pitch?

opal sluice
rare flicker
#

is it really as simple as adding 90 to the pitch?...

rare flicker
#

have an example of where that would fail?

opal sluice
#

if you really want the up vector relative to the player's feet it's not

rare flicker
#

i mean pitch not yaw btw

plan here is
get up vector with pitch + 90
rotate dir by 270 or 90 depending on cw or ccw

opal sluice
#

if you want the up vector relative to his view, then you can just do +90 on the pitch

rare flicker
#

i see

#

thankfully i need the up vector from the camera so i'll be fine

dense pine
#

is it normal to feel that my plugin is a pile of crap even though it works

tardy delta
#

if it works it works ™️

quiet hearth
glossy scroll
#

…up vector?

dense pine
#

lmao im comparing dates by formatting them to strings xD

floral drum
#

uwu

floral drum
#

might be able to optimize it a bit

#

👀

dense pine
tardy delta
#

fking tabnine

#

piece of shit

dense pine
#

i had tabnine premium and it sucked tbh

tardy delta
#

dont you need money for that? 👉👈

dense pine
#

copilot?

tardy delta
#

uhu

dense pine
#

wasnt it free?

#

ooo they changed it..

tardy delta
dense pine
#

oh nvm im verified student

torn sedge
dense pine
#

i really recomend getting github student pack, you get intellij ultimate + bunch of other crap like free domains, hostings, microsoft azure credits

tardy delta
#

i'm a student too lol but i dont have my college email yet

real blaze
#

so uh, anyone got any idea how to remove an x amount from inventory that matches Item.Material regardless of slot?

#

similar to how the clear command works

real blaze
dense pine
#

probably you need to get inventory and remove item stack

#

Bukkit.getPlayer(player).getInventory().removeItem(new ItemStack(Material.DIAMOND, X));

real blaze
#

does removeItem take into consideration the ItemMeta of the itemstack?

#

because the diamonds in this case will have certain Lore attached

dense pine
#

just create an itemstack with the itemmeta included

#

@real blaze

#

something like that

#

you create a new itemstack, new meta, then set meta to itemstack and remove the item from player

golden kelp
#

Yo guys, gradle is giving me some errors with shading

#

?paste

undone axleBOT
golden kelp
#

Nvm, i didnt reload, :bruh:

echo basalt
#

reload 🤡

real blaze
#

oh wait do i need .clone()

dense pine
#

why do you get the item from inventory

real blaze
dense pine
#

oh

real blaze
#
ItemStack ori = p.getInventory().getItem(p.getInventory().first(Material.DIAMOND)).clone();
                        ori.setAmount(32);
                        p.getInventory().removeItem(ori);

This should be good to go then

dense pine
#

you should also check if player has 32 items of this

real blaze
#
if(p.getInventory().all(Material.DIAMOND).values().stream().mapToInt(o -> o.getAmount()).sum() < 32){
                            p.sendMessage(ChatColor.RED + "You don't have enough diamonds!");
                            return;
                        }
                        ItemStack ori = p.getInventory().getItem(p.getInventory().first(Material.DIAMOND)).clone();
                        ori.setAmount(32);
                        p.getInventory().removeItem(ori);

its checked using this stream nonsense

dense pine
#

can i ask what diffrent meta per player do diamond have?

real blaze
#

the lore tags have the player names on them

#

for uh, reasons

echo basalt
#

@lost matrix is your PersistentBlockAPI something that's production-safe or should I make my own ghetto alternative?

drifting halo
#

cant you just use chunk PDC's?

echo basalt
#

true 🤔

#

I forgot chunks have PDC

drifting halo
#

i mean the api might be easier depending on how they do it

echo basalt
#

I usually don't mess with PDCs as the projects I work on pretty much never ask for pdc

golden kelp
drifting halo
#

"unresponsive" so its probably just massive

echo basalt
#

F12 doesn't work

drifting halo
#

yeah its stuck hah

echo basalt
#

3tb paste or whatever

golden kelp
golden kelp
echo basalt
#

try it and see

#

I might try pasting a 20gb .txt file I got

#

just to see what happens

drifting halo
#

doesnt even load the html tree

echo basalt
#

I mean

#

task manager doesn't report any network usage

golden kelp
echo basalt
#

so their servers are probably crashed

golden kelp
#

20gb TXT?

tardy delta
#

yo is woodcutting one word?

echo basalt
golden kelp
#

i think yes

echo basalt
#

access to a data leak

#

containing like 40M records

golden kelp
#

dayum

#

send link 🔫

echo basalt
#

no

golden kelp
#

me steal your only fans

drifting halo
echo basalt
#

It's a voting database leak

golden kelp
#

wha

echo basalt
#

contains house addresses of tons of people

golden kelp
#

oh

#

thats bad

glossy scroll
#

why do you have it then lol

golden kelp
#

^^

echo basalt
#

some dude dm'd me it

glossy scroll
#

You shouldnt have that

echo basalt
#

and asked me to check if the youtuber I worked with was in there

golden kelp
#

"yo bro, theres this file with addresses of 40m people"

echo basalt
#

so I downloaded it, ran some checks on some clients of mine and warned them if they were there

golden kelp
echo basalt
#

a few

golden kelp
#

same

#

preston, brianna and loverfella (the first two are for forge mods ;()

echo basalt
#

I did work for preston

drifting halo
#

meanwhile i work for 0.05euro/h kekw

glossy scroll
#

Ok but can we go back to the dox file for a sec

golden kelp
sterile token
#

Anyone know if forge/minecraft have an API for setting capes? If yes which one - Thanks

glossy scroll
#

You shouldnt have that lol

echo basalt
#

I made a plugin for preston

golden kelp
#

o nice

zenith saddle
#

[09:54:47 WARN]: Can't keep up! Is the server overloaded? Running 32548ms or 650 ticks behind

echo basalt
#

cybersecurity guy at microsoft

golden kelp
#

i had to make a "big daddy mod" where theres a zombie called big daddy and u revive it

glossy scroll
#

Why him lol

#

You said voting

sterile token
echo basalt
#

he made haveibeenpwned

glossy scroll
#

Ohhh

#

Make sense

sterile token
#

What areu talking?

echo basalt
#

but apparently there were no email addresses

#

so it was not suitable

glossy scroll
#

Well u should delete the file then

echo basalt
#

I might've deleted it already

sterile token
echo basalt
#

I had to make some space for call of duty

dense pine
#

good reason

echo basalt
#

and I only had it on a clean 120gb ssd

sterile token
tardy delta
#

based

tardy delta
#

made 300gigs space for my dualbooted linux

sterile token
echo basalt
#

I wanna get a home server when I move out

#

make all my test networks there

sterile token
tardy delta
#

i'm running my stuff on a pi smh

echo basalt
#

no I live in my parent's house in portugal

tardy delta
#

i hope it doesnt burn my house

sterile token
echo basalt
#

arduino minecraft server when

sterile token
#

Lol not lying arduino is amazing

echo basalt
#

we could make a proxy in arduino and just relay data over the serial port

sterile token
#

Dont swear them

tardy delta
#

i did arduino long ago

#

literally when i was 14 or smth

#

forgot all of it

vocal cloud
#

Not sure you'd have the data space on most Arduinos

sterile token
#

I have been doing arduino since i was 10y

echo basalt
#

and toss a 1tb card

#

or am I tripping

sterile token
golden kelp
real blaze
#

how do i check if an item has durability or not?

tardy delta
echo basalt
sterile token
golden kelp
sterile token
echo basalt
echo basalt
#

it's actually made of 2 hard drives

golden kelp
#

real4life

real blaze
#

eg, differentiate between tools and armour vs blocks

echo basalt
#

that I got from free laptops

#

I once fixed this old dude's laptop

#

in exchange for another broken laptop

#

he only gave me that deal because he had a poker tournament to play that day

tardy delta
#

hehe i scraped the windows licenses of my old laptops

#

got a win education and win 10 home now

echo basalt
#

and I just had to toss the drive on my desktop, backup all data and reinstall windows

#

it had some fucked drivers or something

tardy delta
#

lol

sterile token
#

ImLussion if you where from latam i would paid you a package with 10 sata hard drive between 256gb and 500 gb

#

I have hundred of thems

tardy delta
#

lmao what

echo basalt
#

latam = latin america

#

I mean

sterile token
#

Also my mother shit my father because he has lot of shits and now she has another one (me, who came with more things to home)

#

HAHAHA

echo basalt
#

I can get tons of 60-200gb hard drives

sterile token
echo basalt
#

because I interned at the school's computer lab

#

I managed to grab a sound card with a rare daughterboard

#

and flipped it for 80$

sterile token
#

Because you are working there and they are not your own things

#

😂

echo basalt
#

they were tossing old stuff out

#

like

sterile token
#

tossing?

echo basalt
#

it's not that regulated?

tardy delta
#

the only teacher liking me was my maths teacher

#

:(

echo basalt
#

anything older than 2004 was getting scrapped

#

my job was to test the machine, do some debugging

#

if it worky (even with a ram change or something), good

#

if it doesn't, grab cpu, ram, cables and drives and toss the rest out

tardy delta
#

may i ask how old you are? 👀

echo basalt
#

around 18

tardy delta
#

hmm maybe i've to do such stuff in college too then

echo basalt
#

I'm in what we call a "professional course"

#

meaning you gotta do mandatory unpaid internships and such

echo basalt
#

then getDamage is not 0

echo basalt
#

I ended up redoing all electrical work for the computer lab

tardy delta
#

i can imagine that

echo basalt
#

pulling out power sockets, rewiring them

#

made a separate circuit for the server

tardy delta
#

sounds fun if you know what youre doing lol

echo basalt
#

so that we could turn stuff out in the breaker

#

we barely knew what we were doing

tardy delta
#

AH even better

echo basalt
#

I made a power cable too short and had to rewire the entire wall

#

then we got a new server rack

real blaze
tardy delta
#

lmao

echo basalt
#

and I had to wire like 10 ethernet cables around the entire wall

#

and I made 2 slightly too short

#

had to rip out all the covers from the wall

echo basalt
#

it's the inventory one

tardy delta
#

smh lets remove tabnine

#

piece of shit

echo basalt
#

who tf uses tabnine

#

I use copilot

tardy delta
#

its not free lmao

echo basalt
#

so?

#

I'd rather pay the 10$/mo to not write half the code

tardy delta
#

i just tried tabnine out yesterday

real blaze
#
import org.bukkit.inventory.meta.Damageable;

yep

echo basalt
#

than the 50$/session for therapy

#

after wasting all night trying to figure out why something ain't working

#

when I inverted that one if statement

vocal cloud
#

There's going to be a huge influx of people using copilot to write code and then ask questions why it isn't working properly

echo basalt
#

That's why I instruct my underlings to only start using copilot once they know what they're doing

#

I've been doing spigot for the past 5-6 years, copilot is just a work tool that makes me more productive

tardy delta
#

i had issues with gson yesterday cuz it didnt know what to do with the Location::WeakReference<World> lmao

echo basalt
#

The 10$ it costs me is a lot less than the revenue it brings back

real blaze
#

just to confirm, only items that can take damage have the Damageable interface implemented in their item meta, correct?

sterile token
echo basalt
#

I asked about the legality

#

it's illegal to pay students for "on-the-job training"

real blaze
echo basalt
#

great question

sterile token
#

Atleast here exists some shity society called "gremios" which ne suppouse to help the workers to claim things but they just complain for stupid things

vocal cloud
#

Man, here in Canada internships are all paid. Y'all wack

echo basalt
#

imagine being from a developed and economically-stable country

tardy delta
#

🤓

sterile token
echo basalt
#

it was full-time in our case

vocal cloud
#

In Canada if you work even 10 minutes they have to pay you minimum 3 hours worth of work.

echo basalt
#

and I had to do extra hours because I caught covid

tardy delta
#

we arent paid for anything lmao

echo basalt
#

I'd just bring my laptop and make plugins while the classrooms were busy

#

they tasked us with manually deleting files that were older than a certain date

#

from the student's download folders

sterile token