#help-development
1 messages · Page 2187 of 1
/data get entity entityId
can you show the imports pls
I want the gui to have a 1 slot wide border around the swords which will fill up the inside box, but my math doesn't work, any help?
let me show u
inventory.setContents(new ItemStack[]{
itemStack, itemStack, itemStack, itemStack, itemStack, itemStack, itemStack, itemStack, itemStack,
itemStack, null, null, null, null, null, null, null, itemStack,
itemStack, null, null, null, null, null, null, null, itemStack,
itemStack, null, null, null, null, null, null, null, itemStack,
itemStack, null, null, null, null, null, null, null, itemStack,
null, itemStack, itemStack, itemStack, null, itemStack, itemStack, itemStack, null
});
make itemStack glass or whatever
u will see 3 null spots at the bottom, u can replace with itemStack as well
I'm using a for loop to implement my items into the gui
it starts at 0 from the top left
List<Integer> slots = Arrays.asList(
10, 11, 12, 13, 14, 15, 16,
19, 20, 21, 22, 23, 24, 25,
28, 29, 30, 31, 32, 33, 34,
37, 38, 39, 40, 41, 42, 43);
like this
slots.forEach(s -> inv.setItem(slot, stack))
@humble tulip did the persistent data work?
dont think so
seems to disappear on plugin disable
not even server stop
i can only use the command on players?
it would
persistent data is, as the name suggests, persistent
across server restarts, across plugin enable/disable, etc
ok yeah as expected it did work
why doesnt it work on nms entities though thats stupid
?
PDC is a bukkit feature
on NMS entities you gotta use regular plain old NBT tags
/kill doesnt even kill my custom horses
it does for me
how do i use NBT
and will the NBT data persist as well?
yes. PDC also uses NBT internally
it should if you use mc nbt
I'd use NBTAPI
whats that
well
i'm using pdc for the custom entity and it doesnt evenpersist a plugin reload
makes no sense. you don't have any PDC for custom entities
because you don't have any bukkit entitiy
OHHH
CraftEntity.getEntity() doesnt add it to list of entities in the world
of course it doesn't
you have to do that yourself
but tbh it's not worth the trouble
how would i add it
you shouldn't hack into bukkit to create bukkit objects of your NMS stuff
why though
alright
how do you manually add it then?
WorldServer#addFreshEntity iirc
that's what I did though
entity = new SuperiorHorseEntity(spawnLocation.getWorld());
ServerLevel serverLevel = ((CraftWorld) spawnLocation.getWorld()).getHandle();
serverLevel.addFreshEntity(entity);
entity.setPos(spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ());
...
CraftEntity craftEntity = CraftEntity.getEntity((CraftServer) Bukkit.getServer(), entity);
PersistentDataContainer persistentDataContainer = craftEntity.getPersistentDataContainer();
persistentDataContainer.set(new NamespacedKey(plugin, "hunger"), PersistentDataType.DOUBLE, 0.5);
ehhhhhhhhhhhhhhhhhhhhhhhhh
bukkit nbt tags for an nms entity
if you're going nms
do it all nms
if you're going bukkit
do it all bukkit
why though
bukkit is just a fancy nms wrapper after all
how
World bukkitWorld = Bukkit.getWorlds().get(0);
CustomHorse customHorse = new CustomHorse(bukkitWorld.getSpawnLocation());
Horse horse = ((CraftWorld) bukkitWorld).addEntity(customHorse, CreatureSpawnEvent.SpawnReason.CUSTOM);
horse.getPersistentDataContainer().set(key, PersistentDataType.INTEGER, 5);
System.out.println(horse.getPersistentDataContainer().get(key, PersistentDataType.INTEGER));
System.out.println(horse.getEntityId());
dont addFreshEntity yourself
use addEntity when you cast to CraftWorld
dont mind the huge mess, I plan on fixing it up soon
I spawn a new horse in a command using new SuperiorHorse(player.getLocation());
Hello, does someone know if it's possible to apply a custom name to a projectile ? (So having the name floating above the projectile)
That's what I do, but it doesn't display
did you make it visible
yes
that's an exotic dependency injection method
private static SuperiorSteed plugin;
whats the point of passing it through constructor if its gonna be static
remove the static
pretty sure they dont
im not
the call a setPlugin method
theres a static method to set it
u coult just have a static getter in ur main class lol
private static SuperiorSteed plugin;
private SuperiorHorseEntity entity;
// default values
private double hunger = 1.0;
private double trust = 0.5;
private double friendliness = 0.3;
private double comfortability = 0.2;
private double waterBravery = 0.1;
public static void setPlugin(SuperiorSteed javaPlugin) {
plugin = javaPlugin;
}
what
Oh
yeah
well still ew
why ew lol
^
try what i sent
alright gimme a moment
?di :3
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Ew cause di better
just have a getBukkitEntity method and return the bukkit horse
If I say something then all the karens are going to go after me
why are arrow physics so damn wonky
cuz its a block game
Hi when i spawn the armorstand the item in the main hand will not show up
anyone a idea?
WHY DOES IT GO INTO THE SIDE
np check it it persists restarts
alright
is it supposed to be a forcefeild?
no it's supposed to shoot backward
nvm its in degrees
arrows have always done this weird shit where they start homing to wherever their yaw/pitch/direction is
not just arrows but all projectiles
I've had fireballs just randomly turn
yes it does
holly
thanks
i was stuck on this for so long
apparently setting the direction on spawn fixes it
no message sent?
move the message above the if statement
make sure its registered
probably the "taxus" thing isn't equal to the boots in the inventory
also did you do ArmorEquipEvent.registerListener() ?
ok move the sendMessage thing above the if statement
if that prints a message whenever you equip armor, then you equals(taxus) thing is false
I'm surprised there is no armor equip event in regular spigot
yeah ik
is it bundled with something?
bundled?
wdym?
nah I meant like is armorequipevent in regular spigot just built into another even
no it simply doesn't exist
I did a huge upgrade of my pc and somehow the thing I'm happiest about is how quickly projects now open lol
there's a ton of ways to equip armor... right clicking without inv open, using normal inventory to put it there, using a dispenser, ...
ahh I guess
I think that's 12 seconds to be done opening intellij including indexing
not bad considering it's indexing 1273 files
what did you upgrade
motherboard, storage and cpu
oh upgrading motherboard is nasty, isn't it?
so it is nasty lol
all I ever did is add a new SSD or RAM or switch the graphics card
this is the worst upgrade process I've ever had
and install some RGB stuff for even more FPS lol
bad mobo, wrong storage, all packages were late, packages went missing, I thought I fried the cpu at one point
RIP
I had to image and clone my drives 4 times
hell I'm still doing one last image now
because I'm about to merge partitions and I don't want to risk losing data
yeah no backups = no mercy
good luck lol
LMAO java still trolling
Nice
np
i taught myself something lol
Ok now I'm doing the real sketchy part, fingers crossed
1.8 TB ssd? not bad
@tender shard
spawn in custom nms entities and have them put into the bukkit entities list
Yeah it's a wd m.2 nvme drive which is fast af boiiiii
unfortunately not, caused more headaches and i’ll revisit it tomorrow
Dont tag him, he will answer when he can
If i put that there randomly, how would he know it's for him?
Lmao today java is bullet proof
That why discord has the anwer option
so that does work? if yes, nice
yep it does, no problems
ok nice
mf
Could java today be anti bullet
Lmao what a shity day
Trying to solve 1 issue since 1h
wdym?
Im doing a claim plugin based on a block (protection block)
For some reason when the build flag is not enabled and the player is a member of claim, its telling him "you cannot build on this claim"., when it should receive another message
what's the error?
So looking code carefully i seen that the "if () return;" is not stopping the eecution
no way that's actually the problem
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
?paste your latest.log
@EventHandler(priority = EventPriority.MONITOR)
public void onBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
Block block = event.getBlock();
Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
if (claim == null) return;
if (claim.getLocation().equals(block.getLocation()) && claim.getOwner().equals(player.getUniqueId())) {
this.plugin.getClaims().delete(claim);
player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
return;
}
if (claim.getFlags().contains(Flag.Build) && claim.getMembers().contains(player.getUniqueId())) {
player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
return;
}
if (claim.getLocation().equals(block.getLocation()) && !claim.getOwner().equals(player.getUniqueId())) {
event.setCancelled(true);
return;
}
**if (!(claim.getOwner().equals(player.getUniqueId()) || claim.getMembers().contains(player.getUniqueId()))) {
player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
event.setCancelled(true);
}**
}
that's not the full log. send the full log pls
@edgy peak
can we see line 11 of your main class?
For some shity reason when the flag is not enabled, the code between "**" is being executed
bro you should never cancel events on MONITOR priority
i always go with cancel on lowest and log on highest
Someone told me to use Monitor instead of Higher
you can use MONITOR but not if you wanna cancel the event
Allright
MONITOR is to MONITOR the event
But in fact im annoyed
you should not change anything on that priority
if you wanna change something, use HIGHEST
But someone told it can interfere with others plugins
In fact dont worry
Let try to see why the heck is being executed the last condition
is the Build flag set?
anyone help pls?
My goal is to send the message when the flag is not enabled and only if is a claim member
I dont want to apply the flag to the owner
why is building not enabled if the build flag is set?
Wait for testing i didnt set the flag
player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
you print that when the flag is set
in your pom.xml, change armorequipevent from version 1.0.0 to 1.0.1
So if the player is the owner, dont tell anything == return
If player is claim member and flag is not enable == send message
No, if im negating
Im checking like:
if !(flag && mebers#contains(player)) send message
^^ ur not
u as the player or u as the owner?
in your pom.xml
the file where you added the dependency?
or did you just copy paste the code
ugh
yeah then
obviously it won't work
he didnt copy the files?
Testing a claim member
you need to have this file in your plugin
and it has to have the exact same file name
if you just copy pasted the code but didnt include this file, then it'll throw an error
can u ?paste this
why aren't you using maven to handle libraries etc?
i wanna edit it
The code yeah
I will send it with discord format, because i cannot open google now
ok np
@EventHandler(priority = EventPriority.HIGHEST)
public void onBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
Block block = event.getBlock();
Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
if (claim == null) return;
if (claim.getLocation().equals(block.getLocation()) && claim.getOwner().equals(player.getUniqueId())) {
this.plugin.getClaims().delete(claim);
player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
return;
}
if (!claim.getFlags().contains(Flag.Build)) {
player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
return;
}
if (claim.getLocation().equals(block.getLocation()) && !claim.getOwner().equals(player.getUniqueId())) {
event.setCancelled(true);
return;
}
if (!(claim.getOwner().equals(player.getUniqueId()) || claim.getMembers().contains(player.getUniqueId()))) {
player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
event.setCancelled(true);
}
}
You're testing as a member and you see "§f[BlockBreak] §cBuild flag is not enabled" right?
Also this is my claim object
im receiving the message "You cannot build on ..." when testing a member
ok
If i test being an owner its works perfect
And the member system was working perfect too before adding the flag check
feel free to ping me if you got any questions about maven
flag check shouldnt matter though because it does reach the last if
print claim.getMemebers.contains
For some reason the event is executing the last if
see what it actually is
I did a command for debug
what's the output?
the output is my uuid (the member account)
right but does the members list actaully contain ur uuid?
pls print it out in the event i beg
If the member list didnt contain my uuid, it wouldnt display it on the info command
Allright
At the end?
Or start
nah i understand
sorry for asking u to print that even though the info command shows that ur a member
but it's the only explannation
minion
ye
use the translator in lang reconognice mode
It just translate the message (no matter the lang) into your own lang
minion, im creating the claim as an owner. Them i add the member
And connect with the member account
yep..
right
After adding a member
good
lmfao
what does the debug statement say tho?
the uuid is the same
but if the flag is not set, i shouldnt be able to break if im a member
well u didnt cancel the event
oh im an idiot
ur logic is flawed
cuz owners wont be able to build if the flag isnt set
What sorry?
ok I was already ready to get started doing recovery because I thought I smoked my storage there, nah I'm gucci
My goal is:
- Claim owner do everything, no matter if flag is set
- Members break if flag is set
build flag is checked before owner is checked
So that its wrong?
i dont like using else
rewrite it basically
do you even have a pom.xml file?
hm hard to tell what's wrong without any screenshot
try View -> Tool Windows -> Maven
alternatively, right click your pom.xml. One of the bottom most option should be "Add as Maven project"
np
Minion
yes?
What do you think no?
you can reuse some variables here and there
like the player's uuid or the claim owner
Reuse?
owners cant break blocks now
oh that why
those if statements are hard to read
I wastesting the code and oner cannot break
which is why i suggested the above
why? i understand it easly
cuz you just wrote it
you insert the <dependency> and <repository> part into your pom.xml as described in the ArmorEquipEvent's Readme file
maven will then download it automatically etc
it's also not organised so if u wanna make a change, it's hard to know exactly where to put it. like the flag check being too early before
and click the "maven reload" button after you changed the pom.xml
that works
still reccommend my suggestion
Yes i know
Its better
What are you doing?
minions thanks i will try the code
I'm 1 hour afk, some dude is coming over
Minion: do you remember i dicuss cussedmore than 1h cuz of my menu library?
someone pls help Yev with the pom.xml stuff lol
😉
i remember you spoke of your menu lib
cant rem how long
Yeah i finally fix it with the help of redempt
I dicussed over 1h with many people and didnt fix the lib
With redempt in less than 20m i fix it
haha
minion
ye?
Up to know the owner, can create claim, delete it and place blocks
now its turn to check the flag
yeah
it hurt my eyes
i know but i cannot support using if+else
really
ur not using else
Its really ugly to develop like that
just nesting your statements
who gives a shit if it's ugly
atleast you can understand what's going on and follow the logic in ur head
ok
1 sec
fucked intellij does not anwers
i dont know why its eating 16gb of ram
i only have 16gb
send ur code
sorry
i didnt copy
@EventHandler(priority = EventPriority.HIGHEST)
public void onBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
Block block = event.getBlock();
Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
if (claim == null) return;
if (claim.getLocation().equals(block.getLocation()) && claim.getOwner().equals(player.getUniqueId())) {
this.plugin.getClaims().delete(claim);
player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
return;
}
if (claim.getLocation().equals(block.getLocation()) && !claim.getOwner().equals(player.getUniqueId())) {
event.setCancelled(true);
return;
}
if (claim.getOwner().equals(player.getUniqueId())) return;
if (!claim.getFlags().contains(Flag.Build) && claim.getMembers().contains(player.getUniqueId())) {
event.setCancelled(true);
player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
return;
}
event.setCancelled(true);
player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
}```
Ah
Discord crashed for some reason
Are u there?
@EventHandler(priority = EventPriority.HIGHEST)
public void onBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
Block block = event.getBlock();
Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
if (claim == null) return;
if (claim.getOwner().equals(player.getUniqueId())) {
//if source delete
if (claim.getLocation().equals(block.getLocation())) {
this.plugin.getClaims().delete(claim);
player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
return;
}
//allow everything else
return;
}
if (claim.getMembers().contains(player.getUniqueId())) {
//if source block cancel
if (claim.getLocation().equals(block.getLocation())) {
event.setCancelled(true);
return;
}
//if not build cancel
if(!claim.getFlags().contains(Flag.Build)) {
event.setCancelled(true);
player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
return;
}
//else allow
return;
}
//not member or owner
event.setCancelled(true);
player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
}
isn't it easier to follow?
But yeah i ill test it
Mye
ok conclure
i think today i have exported more than 1000
The same jar
Imagine
Im exausted
If i fix this i will go to smoke something to get unstressed
Im starting the server for time 500th
or something similar
just keep it running and use plugman
i have configured a local workflo
Which once the plugin is compiled its automatically is put inside plugins folder and the server is restarted
no i use spigot
world loading is slow af with spigot
I dont use it because most plugin dont ork on bukkit
not bukkit, paper
Because in my personal i always try plugins design for spigot into paper
And most of time get issue
minion
yes?
the output is the same: "you cannot built on claim..."
are you a member?
It doesnt show the output message from the flag
yes
And i copy-paste your code
😡
Im too much annoyed LMAO
At this time you are annoyed like me
Hahaha
yes
HMNN
Too much
They are the same
He ait
Could be cause because method /ps add <player> uses an OfflinePlayer object?
Maybe is that
the uuids are not the same
add when they;re online
Yeah i will refactor the command
oflline server mc names are case sensitive
and test again
the name is correct
did u use a capital C?
1234?
isnt 12345?
no 🤦♂️
Yes
braindead
Because the code was correct
So it was either the offline player or something else
sometimes it was sometimes, it wasnt
Oh
me being 21 and cant
yeah
LMAO
Im fucked idiot
I never realized i was writing wrong the name
It worked
thanks
i need some help mfnaleks
how do i build a plugin that is also a java program with maven
do you have a pom.xml for your project?
i'll send it 1 sec
maven's only purpose is to build java programs
you mean that it automatically runs this main method when you double click the .jar?
yep
oh ok
no problem one sec
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<finalName>${project.name}-${project.version}</finalName>
<archive>
<manifest>
<mainClass>com.jeff_media.standalonepluginscreen.StandalonePluginScreen</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
difference between maven-jar-plugin and compiler plugin?
mfalex with that you can build executable jars?
Same question
compiler plugin compiles your code. jar plugin takes the compiled stuff and puts it into a .jar file
the jar plugin is basically like winrar
it takes the compiled files and "zips" it into a .jar file
you need both
?paste
i never had the jar plugin setup before
im guessing it's deafult
just for example, here's one of my plugin's pom.xml
yes but you have to declare it if you wanna adjust the settings
am i allowed to upload plugins that can run a java tool to setup the plugin?
like my own program
not sure what you mean
i mean thats sketch as shit
so there's the plugin and then there's also a Main class that runs a regular java program which is used to setup the plugin
why would you need to do that
thats just gonna be annoying
what are people going to do if they are not running a system with a ui?
true..
of course you can do it like this
but I don't think it's very useful
99% of servers don't even have a desktop environment
I mean my plugins also have a tiny GUI that runs when you double click the file
i want to make it easy to configure but i cant be asked to use minecraft chest guis
sorry for asking again, but i still cannot figure how works the configuraction section code
ah ok
Im trying to code the configuration section any tutorial ?
only real men use config files for everything. no ingame or external assistance
Config section are literally a map right?
can you show what you mean?
yes
Me too hahaha
Because im doing a lib for parsing json and yaml files, for vanilla java. And i want to recreate the configuration section
Because then i can use that library for parsing Bungeecord and spigot yaml files
it's a Map<String,Object> basically
didn't you also want to do a plugin messaging API like half a year ago?
Mye
i made one kinda
really?
well it's nowhere near done
Is it public?
My hurts its running fast now that you said you have a plugin message api
Does it require an online player your api?
yeah
why cant bungee talk to servers with no players?
I was trying to do one undependable from users
i mean.. they're literally connected
they can
Same question
They cannot talk with servers with no players when using PDCs
i dont follow
?pdc
i know what pdc is
Bungee and Spigot can talk theirself just using the fucked server conection, instead of player connection so why do you they use player connection? HMN
its weird ¯_(ツ)_/¯
PMCs require a player on each end for some reason, never really looked into it but Ive never touched em for that reason
I always run redis pub/sub
I know
I guess it really is as the spigot/bungee servers dont actually talk to each other
they just communicate via player connections
cant bungee fake a player connection to talk to servers though
I dont think, because you can do "getServer" via bungee channel without player?
and since spigot is needed to connect to bungee, spigot can intercept the fake connection
Minion
ye?
I try to fake a connection
https://cdn.rackdevelopment.tech/img/VmR5uPbIWB.png no it is def enabled on my browser
But the fake pl,ayer get disconnected some seconds after
does it send the data tho?
Let try something
Im wondering to do such an api
Like that
For working with PMCs without player
Do you wanna to do it them together?
See you soon!
i'm gonna test something and i'll tell you
let me see how you created ur connection
Send keepalive too
I never figured ho
Imlussion
Is there a ay to fake a bungee player?
Without faking a real connection?
Hello, I ran into a problem with player.getDisplayName(). Whenever I use it to check the display name, or aka the prefixes and suffixes currently applied, it only updates them when the player chats. Is there a way of getting a more accurate display name?
what is the age measured in?
probably ticks
ticks since spawned in?
what does temper on a horse mean?
its an NBT tag
nevermind i doesnt matter
anyways
is it possible to convert a Horse's color and style into an integer that minecraft uses?
right now I'm resorting to doing this to identify every single color and style variant number
and its not fun
nvm i think i found the formula they use
Hey do you have filtering set to true?
yeah
thanks
*currently, yes it's safe
Player is the only HumanEntity, but that's not to say that won't change in the future
Ah it's all good, I didn't want to risk if the player died or something. Realized I only needed it's uuid anyways so there wasn't much point in casting
thanks!
skinwalker update
is it possible to set the age that a baby horse will grow up to an adult
no like
is it possible to set an amount of ticks
that when the horse's age hits that amount of ticks, itll automatically become an adult
Vector velocity = forwardsVector.multiply(new Vector(Util.randomDoubleBetween(-0.05, 0.25), Util.randomDoubleBetween(-0.05, 0.05), Util.randomDoubleBetween(-0.05, 0.05)));
alright so I'm basically trying to make a shotgun spray and this is the current code I have for modifying the forwards vector
can someone like explain to me why this doesn't work as expected? (projectiles fly everywhere including behind me and way to the side)
public static double randomDoubleBetween(double num1, double num2){
return ThreadLocalRandom.current().nextDouble(num1, num2);
}
that's the util methodby the way
Nevermind! I was using multiply instead of add 🤦♂️
I'm trying to access a private method of Horse from NMS
setArmorMethod = getClass().getSuperclass().getDeclaredMethod("setArmor", net.minecraft.world.item.ItemStack.class)
I'm getting a java.lang.NoSuchMethodException though
is this possible because I'm using Mojang Mapped?
if so, how would I get the obfuscated name of the method
Aren't you supposed to reobfuscate it on compile?
yeah, thats what its doing behind the scenes
although the problem is that I'm using Java Reflection API to access a private method
but this private method's name is being changed behind the scenes
yooo what the hell
how did I not see this before
I just found this site too, it's pretty cool.
anyways it worked too
I mean, normally you don't really have to configure the resources in pom. Files under src/main/resources are automatically included.
The behavior I was referring to is that you need to actually configure the resources in pom for ${project.version} to work/converted in your resources.
Or for any pom variables for that matter.
O.o
how do I convert an src to a jar
how could I stop client predictions regarding tripwire?
Yessir
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
watch literally any episode 1 of any youtuber's spigot tutorials
they show you how to build plugins
are u using maven or gradle/
grandle
Hello team, hope you are all good, I have a problem, I'm trying to use custom config file, I have this error in the log when i'm trying to execute the command : ```Caused by: java.lang.NullPointerException
at fr.valdara.valdara.romain.Braquage.SetOrRemoveBlock.onCommand(SetOrRemoveBlock.java:85) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
... 19 more``` but in the specified line, Intellij return me 0 error, what should I do ? specified line : ```getConfig().set("players." + p.getUniqueId().toString() + ".diamondBlockLocation", p.getTargetBlock(null, 100).getLocation());
they are not a developer just fyi
oh
what are you trying to do with p.getTargetBlock(null, 100);
I'm tryging to get the targeted block bcs i need to add the block location to a config file
which targeted block? the one that the players looks at?
Yes
I will try to remove that so, very strange bcs that return me no error when i just to p.getTarget block without the config.set
Same error, I do something wrong
show your code and full error pls
I found sorry
i just have a data.getConfig instead of juste getConfig
Probably think i was in another class i don't know why i put that, but thanks for your help instead !
Do you think there is a better way ?
no, but why null, 100 for int maxDistance, FluidMode mode
In a first time intellij return me i had to use a <Set> and an int maxDistance
now i Use p.getTargetExactBlock(int maxDistance)
👍
how does one get all the blocks that can be mined from the nether by means of tag
who pinged me?
need help. my buildtools isn't setting up. there is a compilation error or some sort
someone ghost pinging me
try get the latest buildtools jar
did man wait let me post the log
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
check the very end
that's where the error is logged
u need to declare config inside onPlayerJoin
u declared config on onEnable() method then tried to access it from onPlayerJoin method. that wont work
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
You are expected to learn Java before starting Spigot
Start by following a few of the guides above
You can't jump straight into the API without having at least a basic knowledge of how it works.
what is wrong with my di? (kotlin)
?main
will this solve my problem?
As for your issue I can't help I'm too bad at kotlin 🙃
No
would it help if i translated this to java?
Yes
constructor for main class??
First screenshot: (class CountdownInit)
public class CountDownInit implements Runnable {
Main plugin = null;
Second screenshot: (class CountdownInit)
public (static?) void CountdownInit(Main plugin) {
this.plugin = plugin
}
Third screenshot: (class Main)
public class Main extends JavaPlugin() {
CountdownInit countdownInit = null
Fourth screenshot: (class Main)
public Main Main() {
countdownInit = CountdownInit()
i put static in "?" as i dont know how its used
Yeah that's not even valid Java
yeah idk lol im not really good at it
The only issue I can see is that you're not passing the main instance in your CountdownInit method
how would i do that?
Ah yeah you defined it as a method instead of the constructor
Do what Intellij suggests
still getting a nullpointerexception
Could you show your code now
https://gyazo.com/2aa4f137b75b6132723c2706405a0ee7 i think i did something wrong with player meta idrk https://pastebin.com/Pq48NiUM
Alright you need to remove the CountdownInit function and move the code in to the constructor
I can't really help with that but a quick google search should be able to tell you how
which constructor
CountdownInit constructor
should i use singleton or is di a better solution?
di
ok
/give @p item_frame{EntityTag:{Invisible:1b}} how can I set this EntityTag on my itemstack, like how this command does it?
Can I make a bungecord module to make /gamemode for example?
Hm you might actually have to use NMS or modify the entity spawn directly with events
Yes. You can make the bungee pass a command to the server if you want
How?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
u r required to learn at least the basic concepts of java before starting spigot-api. the api itself is based on java. how r u supposed to work on something if u don't know to manipulate the language itself at basic level
hey does anyone know why buildtools isn't properly setting up on my system. There is a java runtime error of some sort while compiling craftbukkit
well u gotta learn it first. how else is it gonna turn into common sense. u aren't born with it. u acquire it through learning
no common sense to learn it
its not a requirement
i didnt learn it and i struggled
i did have some experience with like c++ and other stuff
which kind of helped
i struggled too when i started cuz i didn't know stuff about java except for variables and methods and a bit about classes. at the end I hit a big wall because my way of writing code became very inefficient. In areas where i would could have used java's builtin features I made my own cuz I didn't even knew these stuff existed. I had to go back learn java and come back to spigot.
yeah
i watched coded red
he taught the api well but java terribly
i had bad habits
i did python before it so i knew concepts of variable ands functions and stuff
but not much. i used to watch source code
:V well i would just copy his code and modify it. sometimes it worked sometimes it didn't
lmao
Oop was really hard to grasp
he just sort of vomited out code at you
When first learning
ye oop became a big help on big projects
lmao. drain that memory
i watched this one guy who instead of making a class for Island
no cap
Lmao
basically just didnt even know what OOP was
breh wot
yep
:V now i have to install buildtools on linux to see if it installs. its not working for my windows 10 pc. but it worked fine on windows 7
kinda weird
have you updated java
Ye I am using the updated version of Java 8. Cuz I am installing spigot 1.8.8
i have a yamlconfiguration like this: uuid: kills: 6 deaths: 9 how do i get the top 10 players that have the most kills
U gotta iterate my guy
Or use sqlite or something
yse
Basically this
turn it into a hashmap
get all of the entries
turn them into a hashmap
iterate through them
k
bu7g
If u see a bigger value set that as the biggest
i want to get the top 10
Honestly.. Just use some form of sql storage
too lazy
:v wdym
Sotring on the main thread can be laggy
Don't u know how to use sql@mighty pier
Easiest would actually be to throw it in a treemap and sort
Do u know hiw to use sqlite?
no
i will try to use that
Yml isn't meant for data
its not
Ye. It's meant for basic configuration. I remember I used to store server player data on these xd
the server became so laggy when players joined. Ticks would go down
That's more your fault than yaml
The one I linked says it has a commit for 1.17
Yeah port that
Ye I literally said it's meant for basic configuration
Hello, I need to know if is it possible to edit de max durability of an Iteam in 1.8.8 ?
I've try this code using reflection but cannot give the nms item to the player ..
Don't edit it directly with NMS
Keep track of durability yourself with events
Is there no way to directly increase the durability of the item?
You're only going to cause issues
So, there's an event that prevent when armor take loses damage?
no, that event doesn't prevent anything. it only notices you about durability loss and then you have to cancel that
PlayerItemDamageEvent
is there a way to get the list of mobs that spawn in the nether
Thank you 🙂
I think that you can use CreateSpawnEvent, then check if world == nether
no, just check the minecraft wiki
aight ill just put the mobs in a json file
I need it on runtime, so that will not work
but thanks though
yep there's no other way