#help-development
1 messages · Page 29 of 1
got a code example...?
its 3am i gotta be up for work at 7 i just wanna go to bed with SOMETHING 😭
Sure ill write a method. One moment.
I fixed my pom
Data command useful for debugging PDC 🙂
by fixed I mean copied over and slightly modified my correctly setup one.
I made sure to use obfuscated nms until like 1.19 before I took the 10 minutes or so to setup paperweight
tbh its probably better to take a break from working on it when its that tiring since youll probably get demotivated after a whlie
oh i already am
been working on something that should be simple all day.
losing my damn mind
public static String toNbtString(Entity bukkitEntity) {
CompoundTag tag = new CompoundTag();
((CraftEntity) bukkitEntity).getHandle().save(tag);
return tag.getAsString();
}
took my first break yesterday after 2 years of working every single day, felt good
How are you allowed to do this? I where forced to take at least 21 days of vacation each year (public holidays not included).
well I'm a self employed mf
🤔
Ah...
bruh
[03:00:32] [Server thread/INFO]: IN: {AbsorptionAmount:0.0f,Age:-23485,AgeLocked:0b,Air:300s,AngerTime:0,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Attributes:[{Base:0.30000001192092896d,Name:"minecraft:generic.movement_speed"},{Base:10.0d,Name:"minecraft:generic.max_health"}],Brain:{memories:{}},Bukkit.Aware:1b,Bukkit.updateLevel:2,CanPickUpLoot:0b,CannotEnterHiveTicks:0,CropsGrownSincePollination:0,CustomName:'{"extra":[{"text":"Bee"}],"text":""}',CustomNameVisible:1b,DeathTime:0s,FallDistance:0.0f,FallFlying:0b,Fire:-1s,FlowerPos:{X:208,Y:-60,Z:-491},ForcedAge:0,Glowing:1b,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],HasNectar:1b,HasStung:0b,Health:10.0f,HivePos:{X:207,Y:-60,Z:-494},HurtByTimestamp:0,HurtTime:0s,InLove:0,Invulnerable:0b,LeftHanded:0b,Motion:[-0.05289643974896804d,-0.08775135175184261d,-0.0855890298254691d],NoGravity:1b,OnGround:0b,PersistenceRequired:0b,PortalCooldown:0,Pos:[208.14675354944438d,-59.084147664610065d,-491.92242155029095d],Rotation:[133.616f,0.0f],Spigot.ticksLived:516,TicksSincePollination:0,UUID:[I;1514243939,-388348510,-1599515425,2124153910],WorldUUIDLeast:-5526025201707824336L,WorldUUIDMost:4772959422628644230L,id:"minecraft:bee"}
Sure I do have contracts with companies
its not even having my PDC when it enters at this point
But I also do freelance work on top
ServerLevel world = ((CraftWorld) player.getLocation().getWorld()).getHandle();
CustomBee customBee = new CustomBee(player.getLocation(), ColorUtil.color("Bee"), true);
world.tryAddFreshEntityWithPassengers(customBee);
testbee.setBeeUUID(customBee.getBukkitEntity(), customBee.getBukkitEntity().getUniqueId());
is this somehow the wrong way to do it 🙃
We in the US love work
public void setBeeUUID(org.bukkit.entity.Entity bee, UUID uuid) {
NamespacedKey beeUUIDKey = new NamespacedKey(this, "bee-uuid");
bee.getPersistentDataContainer().set(beeUUIDKey, PersistentDataType.STRING, uuid.toString());
}
I love being a wage slave
I was also not allowed to work more than 8 hours a day. If we didnt meet deadlines then it was a sign of failure on the
management level. Really liked that company.
They wanted efficient work > a lot of unproductive work
alright i cant do this anymore today im gonna have a breakdown 🤡 thx for the help guys i might be back tomorrow to cry more
But I'm working every day and spend way too much time worrying about work
First thing I do when I wake up is check discord for any dms
it came to the point where I changed my sleep schedule to match my employer's fucked up sleep schedule
The last mc job i had was really well payed. But it was a nft focused company. And whoever read the last
update knows how that went. Im actually considering just opening my own mc server at this point.
nftworlds paid good man
there are still some companies paying good
I actually have a commission job I'm willing to outsource to top tier devs, pays minimally decent
there really isn't too much requirements in regards to working in the US other then how much you get paid after so many hours worked, also they can't force you to work a triple shift but allowed to do work such hours, but they can have you do a double shift etc. Also it varies between states a bit as well as some states add other things. But really it just comes down to whether or not a company wants to pay for them overtime. Overtime in the US is time and half. Overtime starts after you have worked 8 hours in a day or more then 40 hours in a week. Double time starts after you hit 80 hours if I remember correctly
but the US has such a high GDP thanks to how we work though, so I guess there is an upside to it lmao
I live in portugal
minimum wage means average wage
law says 45h/week @ 4$/hr
sure you get paid time off
but if you make more than 2k/mo you're paying like 52% income tax
We in germany have a max of 40 hrs/week @ min 10$/hr
But getting a tiny 1 room flat where i live is at least 800$ (cold)
well
1 room apartment here is like 600$/mo
basically if you're single you gotta live with your parents
regardless of what job you have (because they all pay the same)
Seems a lot for 4$/hr
Nothing we can do about it
Same here. My dad says i could as well burn my money instead of getting a flat at this point in time.
seems expensive to get your own place in Germany, but that could be due to space being limited as wlel
where I am at right now I can get a 2-3 bedroom house for between $1,200-$1,600 give or take.
Its not due to space limitations. And america currently also has one of the highest housing prices since ww2
Well I wouldn't really say its a problem across all of the US
This is the us. Avg housing price vs avg income. Take a look at the 2006 housing bubble and now.
germany is suffering a bit due to gas and oil prices
How can I edit a players name tag?
you can't really go by the US Avg income charts
it gets skewed when they add in some people making unusual amounts
Because our dumdum politicians believed in globalisation and hoped that russia would not try to warmonger in the 21st century.
then they asked both portugal and spain to lower gas consumption to "allow some" for germany
also housing prices get skewed when you add in states or places in certain states that have always been notorious for high housing prices
2 countries that source their gas from African countries instead of russia
like New York, NY San Francisco, CA some ares in LA, Seattle, WA etc
The statistic cuts off the upper 2.3%
I saw a 700k$ apartment for sale in my city, comments were "dude this is not manhattan"
lol
can the getKeys() method get keys within another config section?
if you mean to get the keys of a inner config section
getKeys takes a boolean as an argument
if i mention it from an outer layer
What do you define as "another config section"?
If you set it to true, it will return keys for the contents of the section too
you need to create a double loop
if you want getKeys() to get the config section of the outer and inner ones
Yes the method takes a boolean that defines if the keys should be traversed deeply or only shallow
got it thanks
In the 1920s you could buy a house with 2.24 annual salaries.
Imagine that. A family house for like 150 - 200k
big oof
how can i create minecraft java bot?
Server or client side?
idk which exactly.
i just want to create program
which can join bot
on any server
is there any toturials?
Def not. This is an advanced topic and you need to know what you are doing.
I only know an api for C# (MineBot) and for JavaScript (Prismarine/Mineflayer)
Then there is Baritone.
There are a couple more https://wiki.vg/Client_List
thx
Nice list. But i see some known trash in here.
???
Anyone here make plugins?
Just use one of the libraries
How come my title stays when I join the server even though I have Player#resetTitle();?
which
I need help from a dev
No this is a development channel. All we do is draw paintings of old penguins.
Oh
No this is pseudocode. Please just use one of the the libs.
man really expecting to be spoonfed a whole ghost client
I should make a youtube tutorial on how to write a minecraft hacked client from scratch
And then there is this guy who seriously just said "Oh" and left, after me telling him that all we do is paint old penguins...
can i use this?
with code examples, tips & tricks and follow-up paid courses
this channel has either really productive days where people ask questions, or really unproductive days where someone is like
Hey how do I do X
insert response here
can you do it for me
- Research the list
- Evaluate your requirements
- Chose a library
make your library
you can just expand an entity's AABB
i dont even know how to connect bot on server
tcp
tcp what?
packets
Is ThErE aNy ToTuRiAlS pLs
Where to start?
Look into TCP
link
No. This is a very advanced topic and you need quite a bit of programming and networking experience.
🤦 🥣
BrUh
Just use "Another Minecraft Chat Client"
any toturials on it?
There is the documentation
At this point why bother specifying exceptions at all?
Implementing an if statement for each packet individually
Pains me a bit
Reminds me of that one spigot class
That handles all player packets
But at least those have methods
Why not use a Map<Class<? extends Packet>, Consumer<? extends Packet>>
Custom Entity models are gonna be much harder than i thought lol
You mean the models itself or the hitbox?
the models
Yes thats quite difficult. Why not use ModelEngine?
Don't you mean the packet class as the key?
Yes
Modelengine is gangsta but the api hurts to see
Ive done custom models in the past. I had no fun with all the quaternions...
Its really labour intensive.
I looked into making my own modelengine but I don't even understand Math.tan much less quaternions or Euler
i made my own game engine a few months ago
I failed trig 🥲
im pretty sure most of the math carries over
mfs throwing every exception known to java 💀
fuck now you're actually gonna make me do it
just say "I got an AOOBE one time, this will solve it and let me debug it easier"
bam
ez
well
edit it in the webpage
wouldnt compile on an ide
so its even a bigger troll 
What's a fast way to update a plugin on a server? Personally I have to stop the server then drag the build of my plugin to the plugins folder then wait for the server to start again. Is there a faster way to do this?
how do i add a standard plugin jar into maven to use as an api from a plugin
You shouldnt need to do that.
Why do you need a jar?
for an api
Doesnt even have a maven repo. Anyways:
mvn install:install-file -Dfile="some/path/to/lib.jar" -DgroupId="some.id" -DartifactId="xyz" -Dversion="1.0.0" -Dpackaging=jar
This installs a jar file into your local maven repo.
After that you can just use the groupId and artifactId you have chosen in your pom
.
Write a shell or batch script. And use the updates folder instead.
Updates folder?
In the bukkit.yml there is an option for update-folder. If you put an updated plugin .jar into the update folder it will automatically update those plugins when the server restarts
Can't I just change the output for maven to the plugins folder then just use reload confirm?
i'm getting The specified file 'C:\Users\User\Documents\Plugins\PEMC-Purgatory\"src\BetterCaptcha.jar"' not exists
but i can see that it much does exist
Take a good look at the path again
reload is not supported. You can do that but expect a lot of bugs.
you have speech marks in yours but okay
where I live you can easily buy houses with some land with that amount
I know but is it possible?
Sure
average salary however is like $60k a year
What would be the command or pom.xml to add the custom output directory?
Like have the output where it normally is but make a copy of the finished.jar?
its better to add a copy command to yoru server startup script
This is more continous integration territory and not really a concern for maven. So a script to copy the files
would be more appropriate.
That is genius Thanks
Yeah
This is my test server start.bat```bat
@echo off
@echo Updating GroupManger...
copy /B/Y P:\eclipse2020-workspace\GroupManager\target\groupmanager.jar plugins
@echo Updating iConomy...
copy /B/Y P:\eclipse2020-workspace\iConomy\target*.jar plugins
@echo Updating AI...
copy /B/Y P:\eclipse2020-workspace\AI-plugin\target\AI.jar plugins
@echo Updating FakePlayer...
copy /B/Y P:\eclipse2020-workspace\FakePlayer\target\FakePlayer.jar plugins
for /f "tokens=" %%a in ('dir spigot.jar /b') do set p=%%a
if defined p (
echo Starting Server... %p%
java -Xms1G -Xmx1G -Dlog4j2.formatMsgNoLookups=true -jar -DIReallyKnowWhatIAmDoingISwear "%p%" nogui
) else (
echo No Spigot found!
)
pause```
em.. I just made the update checker for my plugin, the plugin on start sends request to Github releases and checking current version. Well windows see it as a virus, what can I do to prevent that?
<project>
...
<build>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>copy-file</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>source-files/foo.txt</sourceFile>
<destinationFile>target/destination-folder/foo.txt</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@quaint berry
Wow
I might just add a copy in my run.bat
I may borrow the code above tho
Thanks
lol md5 paste won;t let me paste my buildtools script
"Something went wrong"
is paste broken?
md has changed his a bit
how do i give a potion effect to a player
How do I make my plugin do something every tick?
I want to just check for morning time
are you just looking to see if morning arrives due to sleeping?
That would work if anyone actually slept on my server
So no
I think this would be helpful since I want to check if any player is in a certain biome
?scheduling
runTaskTimer
@Override
public void onEnable() {
getServer().getLogger().log(Level.INFO, "Example has started");
getServer().getPluginManager().registerEvents(new HardModeEvents(), this);
Bukkit.getScheduler().runTaskTimer(this, () -> {
//Do something
},0,2);
}
Would this be correct?
Also
What is the delay and period?
Delay is number of ticks to wait before executing the task, period is ticks to wait between executions of the task
So the Delay would only be used once?
Correct
Delay is a one time wait before starting the cycle of executions, period is the repeated waiting period between each execution
I'm just double checking, A period of 2 would be every tick?
No
1 is every tick
yes
You can run as many as you want
You don’t need a different class
But you can run them in any class
So long as you replace “this” with the instance of your plugin
That would run roughly every second
But they would both run?
Yes
The instance of your plugin
or any other plugin, lol
Yeah just pass in someone else's plugin to really ingrain the definition of dependency
I put my plugin instance and forgot the new 🤦🏻♂️
new 👀
Uh oh
never do new MyPlugin ()
public void everyFiveTicks() {
Bukkit.getScheduler().runTaskTimer(new HardMode(), () -> {
//Do something
},0,1);
}
Oh no
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Another way: JavaPlugin.getProvidingPlugin(TheNameOfTheClassYouAreCurrentlyWritingThisCodeOn.class)
Yeah, but you could just use di which is much better
A bit more decoupled and testable yeah
https://paste.md-5.net/ehuvisoguj.makefile
any reason why this happens while installing nms?
what am I doing wrong D:
fatal: failed to write commit object
what does dat mean
Im not 100% sure but maby portable git thing is fucked
try deleting the portable git folder in the buildtools folder
can you not just declare Main instance;
or is that bad
then try updating portable git
try that yes
if it worked build tools should say smth like cant find portable git startng download
After reading it I still don't get it
You have to pass your plugin instance as a variable
When you construct your class
Notice how you seem to have done it for your listener
Never mind
You didn’t
Uhhhhh
Do you know what a constructor is?
Yes
public A(B myplugin) {
this.myplugininstance = myplugin;
}
public void onEnable() {
new B(this);
}
do it as in the tut he send earlyer
Can you use location#add with negative values?
Yes
Thanks
Does location add change the location or just return the changed location?
Modifies and returns
it mutates teh location
I've seen several people use that so idk
I’ve noticed you almost always type it as “teh”, is that intentional?
I’m intrigued
When you teleport will the players feet be at the location you teleport to?
i've never seen him type 'the'
on occasion my fingers get it right
yes should be
Yes
Thanks ppl
I'm having a stroke
What is a A and B?
I think I'm being special
B is your main class
Here's a "the"
^
I thought so but it didn't work
A would be the other class
I only have 2 classes...
Yes
java.lang.IllegalArgumentException: Plugin cannot be null
you need to do instance = this; in onenable
Then you’re doing it incorrectly
No he doesnt
Show us your code
just use di
That’s what they’re doing
Main class in the onEnable():
new HardModeEvents().getPluginInstance(this);
The other class:
HardMode myplugininstance;
public void getPluginInstance(HardMode myplugin) {
this.myplugininstance = myplugin;
}
no no no
I messed alot upo
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
They already got sent that
some of us are talking about di and some about singleton :/
They didn’t understand it
Oh hmm
Does an item "meta" contain the "tags" seen in the playerdata?
Who’s talking about singleton?
Ok
Tags?
the static getter thing 🥺
still the same error man
Who’s doing a static getter?
Yes, uh, I can't send pictures, i'll upload it somewhere and send a link.
verify maybe
Oh, there's a verification.
did it say cant find portable git ?
I didn't notice
oh actually no
nop
No worries
dont attack me 🥺
If it helps, I want to get the instance in my events class
which particular file to delete
You need a constructor
For your listener class
Like the code I sent you
https://prnt.sc/iMU-ibp_ijUZ normaly there should be at least one those
Charlie you might also wanna learn a little bit about methods and constructors, especially the difference
^
dont have any file like that
can you send a screen?
There
If I add a constructor it breaks the getServer().getPluginManager().registerEvents(new HardModeEvents(), this);
new HardModeEvents(this), this
That "tag" field in there storing enchantments, and modded data.
there
what parameters do you parse
yes
java -jar BuildTools.jar --rev 1.11
can you send the log again?
Shall I just send my code in a pastebin?
.
Yes
@peak depot
1 sec
That is not the constructor I sent you
ok
First off - it needs to be public
Second - it needs to have a parameter of type HardMode
try if that helps you https://stackoverflow.com/questions/61227034/setting-up-spigotmc-causes-crash-and-asks-for-git-details
Then take that code inside getPluginInstance and stick it into the constructor
git config --global user.email "gjoncaadrian@gmail.com"
git config --global user.name "yourname"
got this
but where do I put this?
open portable git
in the cmd
yes
yes
ok now wut
how?
oh
wait
java -jar BuildTools.jar --rev 1.11
git config --global user.email "saraswathi.hts@gmail.com"
git config --global user.name "Dctrrr"
What're you doing
no you need to open cmd and then just do git config --global user.email "saraswathi.hts@gmail.com" git config --global user.name "Dctrrr"
Dependency injection
At this point I don't know
@quaint berry did you see my response
Yes
Did you follow those steps?
🤷♂️
It’s one thing to actively go against good practices in your own code, but at least don’t teach beginners bad practices when they ask for help lol
That’s exactly what you should do
That’s the right way
its just di?
So... Does the metadata in bukkit items contain the item tags?
Why were you talking about having public plugin variables earlier if you have it the right way in your code 🤦♂️
Like what
Well that is bad practice if you’re just modifying variables all over the place
did that, does the thing respond to that cmd
or?
Somehow it works
wheres the private final?
Well yeah but then how do I inject all the other instances lol
If you declare it final it requires initialization
whcih I'm not doing
and private would return null
Idk I saw someone using it like this
More parameters
I would have to create an object of the class
You’re welcome
@peak depot sitll the same error
*still
Use git bash to run the command
Buildtools is funky
I did
😮
like this is the 9 th time
do I send logs again or smth?
here da error
just in case
I have to make an entity float over a player. Would the most efficient strategy be to schedule a repeating task that teleport the entity over the player?
Is there any way for me to get the NBT data for an item?
the item-nbt-api dependency isn't working for me
are you just trying to do a normal build?
why does it not work for u?
it is trying to do something with spigot api
u need a user Key
AgentKloon — Today at 5:12 PM
it worked the first 3 times
Chimmy — Today at 5:12 PM
u ccan get that
in your
spigot account
then go api
and get API key
and use thay
There might not be a release available for my version, as expressed by a few users, and I can't seem to be able to install it. I'm in 1.7.10
Does anyone already worked with multiple database with HikariCP?
I have a some issues with the database selection after the connection times out
nbt supports 1.7
Thank you
Spigot has an API?
I thought spigot did a framework
Spigot is actually a really good restaurant
Database selection on connection timeout HikariCP
spigot is actually a tap
No, spigot was actually what was inside of you all along
Spigot is the friends we made along the way
how can i cast nms custom enite Zombie to craft Zombie?
you cannot
so how can i do this java Zombie zombie = (Zombie)entity; AttributeInstance dmgAttribute = zombie.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE); dmgAttribute.setBaseValue(200);
coz it error
you have other ways of getting the bukkit entity from an nms entity and vice versa
how?
getBukkitEntity
tysm
BRO WHATS WITH THIS AND NOT INSTALLING
https://paste.md-5.net/eroqekihik.makefile
you rlly shoulnt have _ in your class names
can you open a thread and explain the problem again
Does anyone know how to remove the "Respawnpoint set" message?
Hey! I'm facing this weird problem where every time the plugin reloads the listeners in my GUI get disabled
after opening the menu and reloading you can take out items
what
thats still a problem?
cant just tell the people that use it "dont reload lmao"
yeah...
reloading breaks stuff as the reload implementation of many plugins sucks..
huh
so no way of reregistering the listener on reload right?
because its in the constructor of the class
its not good to have a listener for each one of your guis instances too
rather have a kind of collection
well thats not possible until the first new call is made
does data in list get flushed once the server reloads?
also this isnt C#, dont prefix field names with an underscore
Short answer, yes.
damn thats bad
It makes sense though when you think about it.
I thought about closing all GUIs once the server reloads or the plugin gets disabled
?
isnt that just inefficient
people that use the plugin will reload
Some plugins have better support for reloading than others, but some vanilla features can get buggy as well. I recently experienced a visual bug that left ghost mobs on my screen, but upon relogging, everything was fine.
No not really
You shouldnt expect people to reload
Especially considering most servers use ProtocolLib
people who know what theyre doing wont reload plugins during prod
the reason it is stated to not use the reload command is because most developers do not code their plugins to handle that command. For testing purposes it is fine to use so as long as you coded your plugin to handle it.
You could always add a reload command for your plugin too
If its something you want to support
so I can ditch the efforts either way?
Usually best to provide such a command for your plugin as it is better to reload the single plugin, then to use the server reload command and reload everything in the server
however, you should always code your plugin to handle the reload command regardless
i was reloading the server for testing purposes and it broke my plugin smh
Eh i could disagree
Sometimes its just too bothersome to handle
at what line?
are you calling getConfig() in the plugins constructor?
I'm calling it in the method inside the class
its just called being lazy
but that is what defines a decent developer from those that are not
I don't understand why it doesn't work
you gotta show more code lol
probably nulls at the part where it says events
since it needs a config
which generally for some they have issues loading properly and thus nulling out 😛
how is it possible to handle 2k players on single server?
thought he was doing getConfig() stuff before plugin is enabled or smth?
custom servers
wdym
you can also have a plugin which allows players to view players from other servers
this is the whole class
well it could be happening in another class technically, but it being thrown at the part I stated
so theyre actually divided between server
what how
packets
is there any plugin like that yet?
you also need a MASSIVE network pipe to handle that many connections
the only way you are going to get 2k players on a single server other then cramming them into a hub server, is by running custom servers
i think
minecraft is not enterprise software and neither is spigot
or paper
if you want enterprise level software you are going to have to invest into it whether it be yourself with time or paying someone to do it for you
The 2k of mrbeast isn't a single server
I don't recall if it was a fork or a plugin on paper
it is funny how many people think it is like magic getting that many players on a single server
regardless of game
Well let's hope we get regionized ticking at some point
Would break all plugins but
Cool anyway
lol
one day I will create a custom fork of spigot to allow load balancing
and then maybe people can stop asking how you get 2k players on a server 😛
Just write it in rust /s
facts
yeah i know
he used a network
and then had players able to see eachother
with a plugin or smth
is the getConfig() thingy cached?
no
or does it even need to be cached 💀
unless you assign it to a field
its loaded when your plugin loads
it sits in memory
plugin is null
becase you never set it. I've not looked at your code but don;t need to
public AntiChatSpamConfig(AntiChatSpam plugin) {
this.plugin = plugin;
}
ok but where is this line
Lombok annotation
In an ArrayList where all ten indexs are full, but I wanna remove such as the 7 index, can Collections.sort() sort move the next indexs back to fill the empty one?
do you guys know how to get a SNBT string of a Itemstack?
https://coding.life-is-pa.in/5DtDXA6et
you do add it yeah
but unless a constructor is added this just does nothing
Lombok generates the constructor
it's there
apparently lombok failes?
?
idk tbh I never used it so sorry cant help you 💀
there's private final AntiChatSpam plugin; inside the class
so RequiredArgsConstructor should generate constructor for that field
attempting to animate a model lol this shit is hard
i cant set health above 20 ```java
public class battle_bot extends Zombie {
public battle_bot(Location loc, BotData data) {
super(EntityType.ZOMBIE, ((CraftWorld) loc.getWorld()).getHandle());
this.setHealth(data.health);
this.setPos(loc.getX(), loc.getY(), loc.getZ());
this.setCanPickUpLoot(false); // Can Pick up Loot
this.setAggressive(true); // Aggressive
this.setCustomNameVisible(true); // Custom Name Visible
}
@Override
public void registerGoals() {
this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Skeleton.class, 6f, 1d, 1.2d));
this.goalSelector.addGoal(1, new NearestAttackableTargetGoal<battle_bot>(this, battle_bot.class, true));
this.goalSelector.addGoal(0, new MeleeAttackGoal(this, 1, true));
}
}``` help
while although you have lombok generating this, do you even call this method that doesn't exist until compile time to have it set?
if no, then its pointless if it gets generated but not used
https://coding.life-is-pa.in/5DtG2E28r
they apparently do
wait you still handling with that instance?
I don't understand why it doesn't work at all lol
?
whats the function to play sound in a bungeecord plugin?
thank you
could also use protocollib or nms to send a sound packet from the proxy directly
instead of the server theyve connected to
i'm currently making a skills plugin thing, by breaking specific blocks, players will get xp for a specific category, how would i determine what category a material is?
oh no wait nvm
you mean type?
bungee doesnt have nms
Map<EnumSet<Material>, SkillCategory>?
this is my first time actually using bungeecord haha, so its a bit confusing. are you able to add the bukkit to a bungee plugin?#
bukkit api*
im tryna make a report system that works for bungee, and I just wanna play a sound after the report has been created
like a ding sound
so its not at all related to a minecraft game server
you can send a packet from the proxy
idk how tho
neither do I :p
a sound play packet
I have it in the main class constructor
have you even read it?
oh I didn't open that
I read the thread and found smth called PluginMessaging and such
is there a way to cancel the InventoryCloseEvent
reopen the inventory
doing event.getPlayer().openInventory(event.getInventory()); causes a stackoverflow
should i make a loop or something
stackoverflow
is there a maven build or dependency for BungeePackets?
infinite loop
or how do I install it and add it to my plugin
the way you are calling that method is causing it to infinitely loop
should i add a tick delay?
not sure if a delay would solve that problem lol
yes delay. if you do it in the close event you are triggering a second close event as its not fully closed yet
ello
i was thinking of a Map<EnumSet<Material>, SkillCategory>
wdym by category
uhh it has fields for how much xp you should get and stuff
hmm lemme take a look at Tag
works
:D
hmm maybe smth like this
love it when intellij crashes lol
anyways can i add the spigot javadocs to my ide?
Usually intellij should ask you if it should download sources when looking at a decompiled file
Iirc there is also a button somewhere in the maven or gradle menus
press shift quickly twice
cpu usage went up to 100% when decompiling class
then enter "download sources"
😳
!verify mfnalex
This account is already verified!
why cant I send screenshots anymore lol

download docs would make the javadocs available to my ide right?
yep
just do "shift shift", then enter "download sources and documentation"
lmao Alex don't have the verification role lol
This account is already verified!
iirc youd get it back with a kick and rejoin
Time to shit talk Alex in verified
there it is ❤️
:3
thx!
am i supposed to shade a h2 db driver lol?
actually dunno why ive chosen h2 long ago
@tender shard can u pls help me with this 🙏 you're very smart
lol
with what?
is there a better way than to just always reuse the same "random" UUID?
that's because plugin is always null
you declare it to be a field but you never assign any value to it
Can I cast an entity to sheep?
Only if said entity is a sheep
Thanks
the constructor assigns the value to it
from the main class
most entities implement entity but check the docs for others, as long as you cast it properly
hm no
at least it's not in your code
There's RequiredArgsConstructor from lombok
which generates the constructor for the plugin field
How do I teleport an entity one block towards where its looking
entity.teleport(entity.location.add(entity.getdirection().tolocation))
Something similar to this
Don't recall the exact method names
But the orientation of the entity is a normalized (so the length is one) vector
Can I also get behind?
who asked me to write the "custom heads" blog post, again?
Hi, i need help, i'm trying to make a simple vanish feature for a plugin, and i was looking to see how to hide vanished player from the tablist, by googling a bit i found some methods such as: manipulating packets, modifying the vanished player name in the tab and some of them just using p.hidePlayer(). My question is the same, what's the best method?
packets etc are not needed. Player#hidePlayer() is exactly what you're looking for, it handles all those stuff for you automatically (sending packets, hiding player from tab, etc)
ok, thx
Player#setInvisible also exists
Any idea why it's saying it's null?
ah
add a normal constructor passing yoru instance and see if it works.
What is AntiChatSpam:38 ?
not really, should work fine
sigh
@severe turret What is AntiChatSpam:38 ?
I sent the whole paste
.
where?
NO clue I don't see it
From yoru stacktrace line 38, is creating an instance without passing the plugin instance
without code I can;t advise
they sent all the code?
My best guess, you are somewhere (38) making a static access to the class
No clue. I looked back and didn;t see anything
I'm bettign he's accessed the class in a Field so its not been intialized yet
in line 11, they create the config, passing "this"
and lombok should set that "into" the "plugin" field
it actually looks good to me
Only if that is the first time he accesses the class
I've seen no code, only the stacktrace
It has to be Spigot instancing his main class. His constructor is never called
move it all into onLoad and it will work fine
why do I actually still code anything? Basically my only job left is to press "tab" all the time
btw if anyone needs gh copilot, let me know
I don;t see how though
I don't understand how to do relocation in maven... I'm trying to setup NBT API.
It says that when shaded, relocation needs to be done
it's extremely easy. do you already have the maven-shade plugin in your pom?
yep
okay so basically, you just tell maven the original location of the classes you wanna relocate, and then the desired destination location
like this:
this e.g. moves "com.jeff_media.jefflib.SomeClass" to "de.jeff_media.angelchest.SomeClass"
jeff
jeuff
Oh, I see!
it's also e.g. in my readme here, so you can just copy paste it https://github.com/JEFF-Media-GbR/JeffLib
Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - GitHub - JEFF-Media-GbR/JeffLib: Avoid writing the same code over and over again - use JeffLib for your Spig...
knock off redlib
I understand it now, though I still have a question...
<relocation>
<pattern>de.tr7zw.changeme.nbtapi</pattern>
<shadedPattern>com.mrkelpy.aosplayermanager</shadedPattern>
</relocation>```
the relocation on nbt api comes with "changeme" on the pattern
Do I change it to my project or is there something I'm missing?
I see
eg your plug-in name
Yep! It should work... but for some reason it still reds it out...
Maybe it's a visual? I'll restart intellij just in case...
maven reload?
Have done
except that it has nothing in common, lol
is it on github?
try restarting intelli
didnt I just send a link to it? lol
here ^
Yeah, one sec...
Yep, it was a visual
It's all working now, thank you so much!
idk in the past i’ve tries to pr to three diff people
all said “solo project no prs”
when i pr’d
Oh, by the way, do I need to install the plugin on my server in order for the nbt api to work? Or can I use it normally since it's shaded?
if it’s compiled then no
you do not need to have NBTAPI installed
if it’s provided then yes
that's the whole point of shading it
Yep, thank you. I was a bit paranoid about that.
bump ^
I think that's not even enabled by default, is it? I at least didn't notice it with a clean install
hm tbh I'm not sure. I have changed a ton of settings in IJ over the years and meanwhile I have no idea what the defaults were lol
There's UUID.randomUUID();
I know, but that would use a new UUID everytime / on every restart. and this would then eventually clutter the playerdata folder, because every player profile gets saved even if I only generate it for custom heads, etc. That's why I just thought about using one hardcoded UUID that's always the same
yeah well that's basically what I do
I currently do it like this. Just wondered if there's a better method lol
You can use GameProfile, which doesn;t get set in teh dat but it's also remapped
erm
wtf
is it actually called "changeme" in the package name?
this is from your readme
yeah it seems so... I found it weird that when I opened the .jar it was in de.guysname.changeme
i refused to believe it though
Maybe he forgot?
generate a random uuid?
it's actually called "de.tr7zw.changeme.nbtapi"
so set "pattern" to de.tr7zw.changeme.nbtapi" and "shadedPattern" to whatever you like, e.g. your.pluginname.nbtapi
if not when i get home i’ll also make a pr for that
I want to reuse the same UUID all the time though
Thanks! I'll do so.
huh?
so it doesn't clutter the player data folder with random profiles
oh i see
i only need the profiles temporarily to create skulls
but what if a player has that uuid lol?
also i think there is a better approach than player profiles
oki :3
Ah
This doesn't seem to be the correct version...
It says it supports 1.7.10, but I can't find the 1.7.10 version for it
pain.
what errors? also your screenshot doesnt load for me, can you send it again
hm
In the maven repositories there aren't any that's for sure
in the plugin there is but it's a manual download and + no reference to the mc version
But by date, it seems to be ver 1.5.1
How would I manually add the stuff? I've only ever done it through POM / Maven dependency browser
do you actually need NBTAPI? Do you need to support multiple versions?
you don't
lol
beautiful lol
I think I do, since I need to serialize item data and the normal item.serialize() doesn't seem to serialize tags
huh
normally it should contain that data too
at least when using a BukkitObjectOutputStream, it should contain ALL data
Really? I browsed through the implementation and didn't find anything about the tags
But I might've missed it then.
I'll give it another shot
this definitely saves ALL data
but you'll end up with a byte[] instead of some nice, readable yaml 😄
Oh, base64 encoding
That's actually something I hadn't thought about
Oh boy, that library is really nice. I might just use it
I don't need to manipulate the ItemStack at all, just save and load, so it really fits it.
Did you write that?
yeah, I basically threw everything into that lib that I'm using in more than exactly one plugin lol
That's stupid useful, I'm really happy you took the time to do that. You even did inventory handling nice and tidily
Jesus christ, there's something for everything
Thank you!
no problem 🙂 ❤️
I today wanted to add more entity / pathfinding goals, and a wrapper for NBT lol
itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, args[1]);
PDC ❤️

