#help-development
1 messages ยท Page 5 of 1
A way to counteract that is allow users a config option for the event priority
Other than that, just store the Player EXP values on player join and when a player gets EXP in a map
right that's what I feared, thanks
I wish there was a way to get the state of an entity a tick before its death
me too
you could get it from the EntityDamageEvent
time to PR Pre events 
by checking if entity health - damage he got is <= to 0, if it is, do the things you would do in the entityDeathEvent
I dont think the player from that event though is a frozen state
it would just be the dead player instance
by doing that you'll get the entity state in the moment he gets damage, and not after its dead
wouldnt the damage event be called before death event
99% sure this is for his plugin, and in his plugin theres mobs that can one shot so on the damage event the entity would be dead already
Why? that event should be triggered 1 tick before death?
oh alr
its mainly just used it you wanna get damages
the actual Player object youll get wont be cloned
iirc Player is immutable so you cant have seperate states of it
yeah cant clone() player which makes sense
that's not what immutable means, but the idea was correct
ohhhh ok i got it
basically you can't even store the instance of a player
close enough
You can, but it's not recommended at all
meaning that you can't store it
you can but its just uncesary ram
getPlayer returns from the map bukkit has of players on the server
you can store the object but not the content because that will still get updated
yep pretty much
you can store the content as well, as long as it is cloned before returned from the Player object or if it's a primitive
have fun with 200mb HashMap at 20 ppl online 
so you can store a Player's health at the time, or their flight state
int and boolean respectively
can even store their name!
well String is immutable kekw
shut the Up
and theyre conection too!
and guaranteed to not change during the lifetime of the object
even better ๐
btw its 4:19 am to me
every class i have has a HashMap<UUID, Player>
That way i can access my Player object whenever i need
its so fast
22:19 get owned
why are you both trolling lmao, this is a serious answer to a serious question(?)
i was playing at 22:19 but programming now at 4:19 am
i take help development very seriously
just normal programmer life
well question was answered ๐
dot dot
wasnt this topic trying to get the player state before death
now i go to die/bed, goodbye to y'all and thanks for the help
it was originally about getting the exp levels before death reliably
so listening EntityDamageEvent and if health - dmg <= 0 ?
hw the fuck u do negative damage
dmg - health
im horrible at math okay
just let me write multithreaded stuff
dont make me do math
that is arguably a more brain intensive thing than math
indeed but i can do that instead of math
if you think that threading is easier than subtraction then you're doing "multithreaded stuff" wrong ๐ฆ
negative
just like ur numbers
my thousands of requests per second on my socket server disagrees
it is rly nice ngl
has auto parsing requests to pojo classes (JSON Requests)
#javaserialization
btw requests are taking 1000 full ms as im thread sleeping in each request
for testing purposes
Yeh it has schema validation too
oh shut up that's clearly to make a tweet "Significantly shortened processing time on backend services by ~700ms"
you know damn well it is too
its still in the code too

i forgot about it until now
no wonder testing was so slow
cries in static ip
most times you can change static ips
i had the same ipv4 for like 10 fucking years
i think i butchered that
192.168 is the regular one
yee
yeah u butchered it
that one
the one at my grandparents is like 192.168.1.254 or some crap
it makes no sense
literally had to ipconfig to find it
it's bullshit
0.1 just looks wrong
its the routers ip
but
we know xd
10.0.0.1 is even weirder
my router decided shit for me
can be 69.69.69.69 if they wanted
i shit on my router
800% OC with DDWRT
u can change it
fried instantly
yee im just lazy
im legit slouched in my chair like the python logo rn
gonna configure my next LAN setup to use this
I believe the IP address in the router is typically hardcoded, I don't actually think it's in configs ๐ค
nah u can change it w stuff like ddwrt
ah ok u mean DIY
yeah
ive only killed one router so far
last time i did something more than port forwarding i bircked my router
and my cable company had to come fix my router
And guess what
i fucked up the settings so bad it wont even power on
how did you fuck it up that bad
was that to my msg or
they said "Weird its like its IP isnt linked to our service" or someshit like that
And he decided it was the companies fault and i didnt have too pay lol
nah that was a reply to burchard
damn
i did something to my NAT
and when i clicked update the entire router was bricked
but yeah lesson learned is if i ever have an overclock option for ddwrt config.... do NOT set it to the highest MHz
(i was like 11)
sucks too, was a good fuckin linksys
WRT54GS model
how tf you remember that
good memory idk
my new diy is a Netgear WNR2000v3
wot
thats my main networks lan addr
the netgear one defaulted to 192.168.1.1
the linksys router was also 192.168.1.1
my netgear is configured to 192.168.0.1 kek
uselessly making me believe 10.0.x.y is somehow modern compared to 192.168.x.y
reject modernity, embrace tradition
pretty much


but yeah Linksys WRT54GS (old mainnet, dead), Netgear WNR2000v3 (priv network for my "server" pc and my Wii), and an Arris T16<i dont remember> (current mainnet)

u DONT REMEMBER?
wow
off with ur head
shame hnnh
i never interact with that router much
mostly because its all done through xfinitys dumb ass mobile app
not even the unit itself
10.0.0.1 is an overview page more than a configuration menu
i cant even edit DNS or the wifi ssids from the router iirc
I hate the fact you need to have an internet connection to use the router from my ISP
i actually cant edit the dns at ALL
the fuck?
The configuration is all in the cloud
yeah im locked into whatever comcast/xfinity has
its like 75.75.75.75 75.75.76.76
idk
wot
sorry i remember a lot of random things
it's not even the regulars like 1.1.1.1 or 8.8.8.8
oh yeah the S in WRT54GS stands for Speed or Superspeed btw
its so stupid i love it
nice, glad u remembered that
oh im sorry
SpeedBooster
this thing came out in like '02
i still miss it :(
ive tried to 30-30-30 reset it so many times to see if itll revive it but
my baby is Gone
the Baby
yeah
the other one (and my moca setup for ethernet to my room)
oh dont worry the one i actually use is across the house
So you can hit it when it stops working
netgear is only for wii and spare pc
reminds me of my old networking teacher
my moca setup is fucked up so my wifi is quicker than ethernet
yeah lol i run a 100ft cat6 through my house
i run ethernet through my tv cable
dude was talking about his cisco router and home server for storing a 27tb anime collection
wth
did u guys know the cables used for tvs (coaxial) can transfer (multi-)gigabit speeds?
ohhh coaxal
yeah
was about to say i thought your hdmi cord had a side cable attatched
jokes on u i dont even use hdmi anywhere
my monitor uses DisplayPort
(hdmi isnt compatible with nvidia gsync)
why does that look exactly like the networking equipment my school's server was running
2004 router, works just fine
like not even joking
jesus
probably is
Yup probably is
the "modern cisco-certified computer lab"
I got mine from a server shop when I bought my server. 5 bucks each
running 2004 routers
Probably a newer model than mine
is there even a server shop?
oh yeah even though my linksys is fried i can kinda use it as a switch
No I bought mine from a hipster who runs a server shop
I feel like shipping would be a little pricy
the power is still functional just not the router itself
I'm into running a home server and all but like
I live in some exotic part of a tiny european country
shipping a server from NY was like 400$ last time I checked
Bought a HP DL380 G6 for $600. Came with I think 64GB of ram but he said he'd give me 196 for no extra cost
it's old but it does work.
Not sure what they were using it for
but we had a major power outage and fried one of the 160gb hdd's
๐ฅฒ
that's why RAID exists
Not sure if it was running in RAID or not
just knew that a replacement was 10$ + 40$ shipping
I asked the networking guy if it was worth buying a new drive
man just said "we accept donations"
Literally the first thing I did was run the drives I got in RAID and pull one for fun to pretend I was hot swapping
We might've been running raid? could be a multi-drive failure thing
server was mid-configuration when the electricity guys cut the wrong cable
half the city ran out of power
I stopped running RAID cause I wanted more than 300GB of storage
F
the spigot community seems to have 2 sides
couldnt u just configure for less redundancy
one side is the beginner developer that wants to make a tiny plugin
nerds and Nerds
the other side is the maniac developer that micro-optimizes everything including their home server rig
I hate the RAID controller software ngl
this is just what the beginner turns into later on
I've been doing spigot for like 5 years now
youll get there in time
don't have a home server yet
See I bought an actual server because I'm mentally insane
I'll just add more ram to my desktop PC and run a VM to pretend
everybody has a home server it came free with their PC
I mean with a Ryzen 5 5600x and 32gb of ram it might as well be a home server
I use a 2003 monitor to access it
i have a vnc server
I went to a tech store and found them using the same exact shitty HP monitor I use for discord
I seem to have got fancy everything except for monitors
paid like 20$ second-hand
currently inflating a beach ball rn
i want to die
i forgot how to blow something efficiently
ItemStack beeItem = new ItemStack(Material.BEE_SPAWN_EGG);
ItemMeta beeMeta = beeItem.getItemMeta();
PersistentDataContainer itemPDC = beeMeta.getPersistentDataContainer();
cadiaBees.hivePDCManager.setBeeUUIDOnItem(itemPDC, UUID.fromString(beeUUID));
beeItem.setItemMeta(beeMeta);
Any idea why this isnt storing my value?
Ask some friends for tips on how to blow
its an itemstack in a gui
debian on CRT โค๏ธ
Ignore the failed to mount
windows 10 on CRT

Only monitor that works the server is VGA
its a shame i never volunteered to work IT at my school
mine wasn't volunteered
I'm on a weird programming course (want a free degree yay) and we have to do internships
You can pick a tech-related company
I picked interning at the school
we just deleted teacher accounts off of the windows registry
type of thing
wtf my programming course was using some shitty javascript library to make Pong game
It's a 3 year course that provides an associate's degree
I'm taking a course that I had a JS course where I literally never attended class and got 100% it was too easy
Oh and the HTML course I'd take the teachers code run it through WebStorm, format it properly and hand it in for 100%
then copied it onto like 5 different USB drives and we did entire computer rooms in like 5 minutes
We did a week's worth of work in about 3 hours
Then went to the pool in the afternoon
Or the beach or something
can anyone help me pls :I
Don't you have to set the PDC back onto it? I'm not sure I haven't used Spigot in a while.
?jd-s
shouldnt have to
And you're doing this?
its an itemstack not a block

does anyone know why i get a bow with no lore or color?
lol hypixel clone lookin
man can't even add meta to an item, tryna copy hypixel
I mean that code looks fine to me
its giving me a normal bow bur
did you compile it right lma
I can't see any issues with it
yes
did you restart the server
yes
try again
i just restarted 3 times
decompile the jar and check 
BRUH IM SO STUPID OMG
I WAS SETTING IT AS A STRING AND GETTING AS AN INT ๐คฆโโ๏ธ
spigot dev moment
like that time I made players phase through the floor on a minigame
and dying to the void crashed the server
Oh that reminds me. I need to shut the server in the background of my computer that's stuck in a gradle task
ok its still erroring ๐
any other ideas
Hello all, I have a quick question. How would I be able to give a player a shulker box with items already in it. Cheers : D
Honestly the fact they haven't updated the interface in 10+ years is pretty sad
well if it works
yes
If by works you mean causes endless human suffering
holy shit im ACTUALLY dumb as hell
i spent 2 hrs checking the PDC on the WRONG ITEM
?
I mean he'd still have written the wrong test so it wouldn't have helped xd
The test would fail though
tests only help for updates to the code, assuming those updates aren't meant to change the overall functionality (judged by the test)
well no I do agree with u
everything needs tests
a shame we don't have that power
I'm working on integrating spigot servers into a gradle task to speed up running the thing
Should make running and testing faster
I need someone whos really well knowledgeable about either:
CitizensNPC's way they move entities without an NMS Navigator (Not all entities in mc have a Navigator)
OR
Making a ServerPlayer (remapped NMS's Player) move like an actual player does (Eg taking steps and moving smoothly)
I am NOT wanting to use CitizensNPC's setTarget method, this method applies the citizen's pathfinding, I am using a custom pathing so I already have my point so need my entity to move to, I just need the actual entity to MOVE to these points (I'm fine without using CitizensAPI for this)
I was told in the citizens discord, that using NMS#setDestination on their NPC's allow them to move, but this simply just rotates the NPC and makes him face the target
Any advice on this is greatly appreciated, have been stuck on this for a few days
sorry for spam
Also:
NMS Entity#moveTo Entity#move Entity#travel are all invalid on ServerPlayer, these methods need a navigator and will throw errors if you try using them
Spigot Entity#setVelocity doesnt work on players either while it may work on other things like pigs
Sadly most plugins would need an actual server to test things like item naming and such. But that'd be nice for the people who need to test basic structures 
Unless I'm mistaken it's not an actual server?
Its just bukkit but as an object
how to get victim in EntityDamageByEntityEvent?
bro essentials has an items.json file with 40k lines that just has name -> material abbreviations
wtf is this shit
you know what its for
the i command
so if you use /i dpick
I'm fine with typing the full name
it uses that list lol
to save on 200mb ram
yeah overall not much but they havent updated it in years
which is prolly the reason why
my entire zombies minigame plugin is consuming 30kb
they have like 5k lines just for copper
essentials is like
essentials code is not the best
essentials is me when I wake up in the morning
you forked essentials? im sorry
essentials is me when I wake up in the afternoon
guy legit asked me to remove all getInetAddress references and completely nuke IP lookups
at a code-level
to not leak anyone's ip
https://www.spigotmc.org/threads/entityplayer-serverplayer-navigation.558445/
Why isnt google reccomending me this shit??
bruh
this was 7th page google search btw
those dont work
Does it successfuly Move ServerPlayer's?
not sure, I use it for zombie fakeblock detection
cryy
and removing some stuff like fire checks
ServerPlayers dont have Navigation
you can still call it
So any move, moveTo, travel calls get exceptions
this is called by the navigator
Not sure what the other thing is
it just sets a delta movement
get what?
direct to entity?
it's basically bukkit's Creature
Entity nmsEntity = ...;
if(!(nmsEntity instanceof EntityInsentient insentient))
return;
insentient...
It's like casting an EntityLiving
I'm using mojmappings for this
but you can do without
you're looking for a(EnumMoveType, Vec3D)
what
Vec3d argument
Is this the direct location i want the entity to go? Or is it transformed between 2 distances somehow?
relative pos
The equivalent of what you call setVelocity to
it grabs the current AABB, expands in the vec3d's axis and does checks
and then performs collisions and stuff
fuck me math
alright ill have to play with this a bunch, thank you for this info tho
just subtract 2 points and wrap it to a Vec3
yeah
ohh
something like that
thats ez
yeah sounds like setVelocity method ngl
its how i did it to make shit like a pig go whoosh

but with more details
set it to piston to make sure you crash stuff
i see you learned that the hard way
nah
oh xD
I mean given this is a minigame I deleted piston checks
and fire checks
because zombies can't really walk through lava on a city map
interesting my remappings dont have EntityInsentient
i dont think they walk through lava on any map xD
ill just borrow citizens
oh
imma try this first
then go with that
Update: Yep i know .multiply is on the wrong vector
๐ค
even getting him to move a million blocks is progress 
ahhh ffs
i hate this different remapping citizens does
okay nice
progress
yo wtf
at y73?
oh wow
yeah, i like this

i think this issue is MC auto teleports past 8 blocks iirc
what's your theme?
looks hot
better than mine ๐
ye
yeah that's a protocol thing
you can do some interpolation at your own time
welp I'm going to bed
it's like 6am here
gnight! Thanks for the help too!
bro tf did i do
wym?
do you have 2 theme plugins installed
like ew. tf is this
yep, im uninstalling them rn
you should add a pathfinding goal for finding diamonds
what's the best way to make a region? so if the player is between the region something happens im guessing worldguard?
still trying to figure out the right way to get him moving
Values seem rly finnicky
i do have methods though to get him to pathfind right to them
just cant get him moving properly
WorldGuard would be the fastest way for regions yeah
okay
Hey does anyone know how I could support the output formatting from this site? ChatColor#translateAlternateColorCodes doesnt work: https://rgb.birdflop.com
How do I resolve build errors?
WGRegionEvents is in use.
error: package de.netzkronehd.wgregionevents.events does not exist
import de.netzkronehd.wgregionevents.events.RegionEnterEvent;
hex codes?
like #084CFB
this function supports hex codes
private static final Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");
public static String color(String text) {
for(Matcher match = pattern.matcher(text); match.find(); match = pattern.matcher(text)) {
String color = text.substring(match.start(), match.end());
text = text.replace(color, ChatColor.of(color) + "");
}
return org.bukkit.ChatColor.translateAlternateColorCodes('&', text);
}```
there
anyways
does anyone know the event for a regionleaveevent in worldguard api?
remoev &
thx man u a real one
np
I think its RegionExitEvent..?
na
join their discord
There is none, use WGRegionEvents API
some people of you may know, that you can leftclick a entity in spectator mode to get into it. is this possible with spigot?
like this
got it. its player.setSpectatorTarget
i did that
This, I still cannot understand how tf such big plugin can have so bad api
So bad that people make APIs to fix the original
it isn't bad, just the features that most want are outside of the scope of the plugin
however the author has done a decent job in allowing others being able to hook into it though if you want to extend it
same is true of worldedit
how can I strip and clear any color codes from a message? I used ChatColor#stripColors(); but it doesn't remove the &[letter / number] from the string. Is there a good way to remove that
that's not actually a color code
but to make a long explanation short apply the color code via the api and then strip it
ChatColor.translateAlternateColorCodes('&', string);
Is there a way to see if a player's message contains hex formatting?
I've already done that, it doesnt remove the colors & colors, I found a different way to do it anyways so im good now thanks
How can i override a method of a class im extending, if the method is not abstract?
Is there a way to do that
CitizensNPC has this same method with return value getMoveControl, just wanted to override its return to use my own PlayerMove Control
oh nvm
i had wrong object
ignore me
/whoosh
?paste now
My plugin is meant to listen for redstone activity, cancel it, store it in hashmap and then play it back when its told to
for some reason when it comes to one tick it doubles it
i have no idea why its doing this
cancel the event
dont set the block state to act as the event cancellation (Unless that events not cancellable?)
your making a double loop that way iirc
(Considering redstone turning off fires that event too)
does anyone know how to serialize a player?
sigh
May i ask why
serializing a player would be a redonky amount of data
my IDE lags just showing tab completions for the NMS methods of the player class lol
i mean i have to send a list of Players via Bungeecord messaging channel to another server
Its not cancellable, you can only set a new power
i've been stuck on this for nearly a month now its ridiculous
whatever I try doesn't work, if feels like a bug now
so store the location of the block state you change before you call update() then check again in the event
if its the block you just modified return
so use location instead of blockstate in my hashmap?
Yes but i mean your not even checking the block state in that event
your just putting into a map
and updating a block state
theres no checks inside the actual event to see if the previous block state was even checked
sorry my brain is fried I got covid, im not really following
this event right here
Your simply putting
your not checking if the block you just updated is the one inside this event
so naturally when this runs, its gonna overwrite the previous key set and lead to the weird issue you have now when iterating over the map again later because the value isnt the one you originally though was set, its instead the second time after you called update()
put() overwrites existing keys
putIfAbsent wont
does setting the power in my restore code call the event?
i would assume so as that redstone
lemme check
yeah im gonna assume it fires when a signals turned on/off
its the same thing with BlockPhysicsEvent
you gotta be really careful cause you can get in a loop of updating the previous block you just edited
this one is only a one time loop because the states already 0
so when you call update() it already has the same value (0, off) and stops looping since it didnt actually signal a current change
So all in all: use putIfAbset and use Location not block state for the key
storing the BlockState of the redstone seems pointless, since you know all redstone block in that map are "halted"
so all you need to do is just iterate and power them again
alright, ill give that a go
You honestly could pull this off with just a List of Location of halted redstone blocks
might be a lot easier
and you can just if (list.contains(location)) return;
use location to get the block
yep, its the smoothest option imo
storing BlockState seems a little dirty
unless absolutely neded like say crops
cause they have 0-7 as an Ageable trait, instead of true/false for redstone power
@noble lantern I hope I did it right https://paste.md-5.net/jeqibejiqe.java
because it doesnt work
still doubling the pulse
how do i make an event work on command ( i want to enable and disable on command)
beats me champ, im only level 9
What exactly is "double"
1 tick to 2 ticks
you can use HandlerList#unregisterAll(ListenerInstance)
and then register it back normally
your gonna have to explain better
is it duplicate entries in the map thats causing it twice?
its a hashmap it cant have duplicates
the info for running twice needs to be very percise
hold up
does that make sense?
also its not lagging like that
ubuntu is just bad
also it outputs the hashmap every time and you can see there is only a 0 and 15
isnt it meant to do that
im not a redstone wizard
but that looks like a clock
i might be wrong, im horrible at redstone
does it to it with just a button, redstone and piston?
try testing simple stuff first like that
its meant to do what it was doing before it halted
and thats not extending the pulse
oh is the pulse on that supposed to die out?
sorry im
VERY bad at redstone
but i think thats what you mean
its just meant to keep going around as 1 repeater
when its restored its two repeaters
so something is doubling it
well idk I never had any performance problems. except on my laptop and there sodium also wouldnt help lol
'are you drunk' bruh
I can prove that I'm not drunk
see? only 0.67 permille, that's only a bit over the "you may still drive a car" limit
sahjdhjsad
6-7??
.67???
go to
a fucking hospital
jesus christ
how are you alive
bruh who has a breathalyzer in their house
i do
Germans
i need to see how drunk i am
lol
0.67 is not much. the limit to drive a car is 0.5 and for bicycles its 1.6
in Australia we don't give a fuck
in the USA is 0.08
OHH
lol
yeah thats why i was freakin out 
i thought i was talking with a dead man for a sec
๐
it looks like
then when I restore it there are 2
your giving power to 2 repeaters at once
wait
so then why is the size 15
only like maybe 2 blocks actually have a powered redstone state i think
if a state turns to off you should ditch its instance
cause theres no need to halt it
its off
15 seems like all the repeaters there on screen
all good
its not size
15 is the redstone power
i just 0>power to get true and false
and then when it comes to redstone dust I just set the power
to its original value right
i believe so
cause that can cause issues to if you dont set it back to original
and its like in a block per say
like yours is
cause when its in a clock the signals lowered iirc
(Again i suck at redstone)
so double check that one
they shouldn't be lowered?
considering repeaters repeat the signal to the maximum strength
and im currently only testing the repeaters, not the redstone dust sides
why does enchantment.level.0 keep appearing? here's the code:
ItemStack inHand = target.getInventory().getItemInMainHand();
ItemStack inOffHand = target.getInventory().getItemInOffHand();
Enchantment enchant = Enchantment.getByKey(NamespacedKey.minecraft(enchStr));
if (enchant == null) {
sender.sendMessage(instance.translate("messages.command.invalid.unknown-ench"));
return;
}
Map<Enchantment, Integer> enchants = inHand.getEnchantments();
if (enchants.isEmpty()) {
sender.sendMessage(instance.translate("messages.command.invalid.item-not-enchanted"));
return;
}
if (!target.getInventory().getItemInMainHand().getEnchantments().containsKey(enchant)) {
sender.sendMessage(instance.translate("messages.command.invalid.item-does-not-contain-ench"));
return;
} else {
Economy economy = QuickDisenchant.getEconomy();
double withdraw = instance.getConfig().getDouble("price");
if (economy.has(sender, withdraw)) {
//REMOVE ENCHANT
inHand.removeEnchantment(enchant);
//OFFHAND BOOK CHECK
if(inOffHand.getType().equals(Material.BOOK)){
//ADD TO BOOK
int levels = inHand.getEnchantmentLevel(enchant);
inOffHand.addUnsafeEnchantment(enchant, levels);
}
Looks like you're adding a level 0 enchant
im getting the enchantment from the main hand item, along with it's level int levels = inHand.getEnchantmentLevel(enchant);
it was sharpness 5
ohh wait. i see the issue.
i removed the enchantment first, it seems
I wonder whether negative levels work
mm sharpness -1 gives hp to enemy
mc does a if damage < 0 check iirc
yay!
excuse me, is there any ways that decrease player swim speed....?
does changing theyre normaly spee dnot work
potion effect?
how did you get bytes to show wtf
i think its from f3 + h
nvm it isnt.
a hegg
ahh prollly is
is there other way than potion effect?
was about to say dang i know the storage size of my item stacks im gonna serialize
Depth strider boots
cant just setting player velocity do the trick??
Does setting the players speed like not work lol
You can launch the player but it don't be smooth
oh right.
tried to decrease it with velocity but failed
๐
no
okay, i will try, thank you
how would i run some code constantly until something i sthe same as something else (i.e 2 strings)
run a bukkit timer, if strings are equal cancel timer
How ide do it
While loop is okay if you do it async and use a callback
ok, how
i do something similar in my plugin
?scheduling
Sounds like a bad way to do it
i call a blocking method inside though, so its not constantly looping
its a blockingqueue
there is an article that is pretty much copy and paste by md_5
and i can register an event if it is true, yez?
needs to wait for a NPC to finish navigating before giving the next step, this was older code from a few days ago now
its all done in runnables now
make sure you only registers once in your for loop
i meant
sorry bukkit task***
Cancel the task after registering the event *
so like so?
new BukkitRunnable() {
@Override
public void run() {
if(stringA.equals(stringB)) {
doSomething()
this.cancel(); // <--
return;
}
}
}.runTaskTimer(plugin, 1L * 1L /*<-- the initial delay */, 20L /*<-- the interval */);```
what is 1L in seconds
Yep thats fine, just really depends on how fast you need the result after its set
pretty much asap
then do 1 tick
1s is hardly noticeable
cant get any more asap than that
Couldn't find anything about this. What can I use instead of those two: ```java
team.setNameTagVisibility(NameTagVisibility.ALWAYS);
team.addPlayer(player);
yeah but wont that cause performance issues
depends on what you are doing
you just want a player name to always be visible or entities?
chyecking if a command has been run by looking at a file it writes to when it has been run
Yeah, custom name tag and stuff
Entity#setCustomNameVisible(true)
Will always show a entities name tag
false = only shows on hover to the hovering player
Entity needs a custom name set ofc tho
Thanks!
however
not sure if it works on players
might
try and see
100% perfect for all other entities tho
Players have certain methods cut out
eg a player doesnt have AI
cause well
yeah lol
theres a few others thing the player also doesnt have idk all of them
bot raids be like
as well as things that player has other entities dont
the AI for bots is typically not attatched to the player server sided
its mainly just a pc entering human inputs
so is this correct
new BukkitRunnable() {
private Plugin plugin;
FileReader input;
{
try {
input = new FileReader(Bukkit.getServer().getPluginManager().getPlugin("Heartrows").getDataFolder() + "/status.txt");
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}
@Override
public void run() {
if(input.equals("true")) {
getServer().getPluginManager().registerEvents(new DeathEvent(), this.plugin);
this.cancel(); // <--
return;
}
}
}.runTaskTimer(this, 1L * 1L /*<-- the initial delay */, 20L /*<-- the interval */);
ik lol
it was a joke
whats the issue
whats an NPE
NullPointerException
y
intellij idea suggestions be like
does this look fine?
did you code in C# before this
other than the null warning, make sure to collow java conventions
all variables are camelCased in java
unless
its like a public static
gotcha
you can do like INSTANCE_THINGY if you want to
or just keep it camel
and yeah null check enchantment meta
not all items can have enchants legally
(air)
alright.
@noble lantern this better?
Plugin plugin = this;
new BukkitRunnable() {
FileReader input;
{
try {
input = new FileReader(Bukkit.getServer().getPluginManager().getPlugin("Heartrows").getDataFolder() + "/status.txt");
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}
@Override
public void run() {
if(input.equals("true")) {
getServer().getPluginManager().registerEvents(new DeathEvent(), plugin);
this.cancel(); // <--
return;
}
}
}.runTaskTimer(this, 1L * 1L /*<-- the initial delay */, 20L /*<-- the interval */);```
IDE added assert enchantMeta != null;. look good to you?
ive never used assert
it throws exceptions if its false
AssertionException
how about an if?
seems good, cant exactly go through it line for line rn
try and see
ifs a lot better
its only really checking for "books" tho
that way you can handle null values and alert the player they fucked up somehow
if book doesnt exist in offhand it just skips it - its taking an enchant from item in main hand
if your 100% absolutely certain of this
assert is okay, but generally if is more commonly welcomed as you can handle it and return
ight
So I updated the code a bit but it still doesnt work, im absolutely stumped https://paste.md-5.net/ogagakawug.cs
everything seems to be fine and i see nothing that's exploitable. thanks a ton, burchard.
fun fact
a writable book has no data when new. when adding one letter, it's 17 bytes. when removing it again, its still 14 bytes instead of having no data
whats on the item data?
hmm
so basically just "pages:[]"
If that's what I need, it didn't work
player.setCustomName(Color(prefix) + player.getDisplayName());
player.setCustomNameVisible(true);
To make sure, that we're on the same page. What I was trying to do is setting the name of the player (above his head)
how do I fix the net.minecraft server error?
Cannot resolve symbol 'mojang'
import com.mojang.authlib.properties.Property;
how do I fix dis?
Fix? There is nothing wrong with that
oh missing symbol, you need the import
err dependency
nvm fixed it
<repository>
<id>minecraft-repo</id>
<url>https://libraries.minecraft.net/</url>
</repository>``````xml
<!--Mojang -->
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>3.5.41</version>
<scope>provided</scope>
</dependency>```
thanks man
Players don;t have a respawn point.
import de.ancash.craftinginjector.IRecipe;
If they have a Bed in that world, they respawn there
is there something called as dis ^
or they respawn at teh world spawn
does anyone know why most of those methods take an int instead if the proper type?
e.g. writeChar takes an int, why not a char?
Thats not Minecraft nor Spigot
Somethign German de.ancash
Players do have a spawn point
its acutally an import thing
look
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import de.ancash.craftinginjector.IRecipe;```
um, why is this not exposed in spigot I wonder?
No idea
hm
Ok, In Spigot players don;t have individual spawn points ๐
NMS
does have to do with NBTAPI
or?
all I had to do was search for java de.ancash
does it have an api?
No idea



